final polish

This commit is contained in:
Nuno Coração 2024-06-19 17:37:35 +01:00
parent 2245ef7ac5
commit ad9ab104db
3 changed files with 38 additions and 9 deletions

View file

@ -2220,6 +2220,10 @@ select {
overflow:visible
}
.overflow-y-scroll {
overflow-y:scroll
}
.overscroll-contain {
overscroll-behavior:contain
}
@ -3197,6 +3201,22 @@ select {
--scrollbar-thumb:rgba(var(--color-neutral-400), 1) !important
}
.scrollbar-thumb-primary-400 {
--scrollbar-thumb:rgba(var(--color-primary-400), 1) !important
}
.scrollbar-thumb-primary-100 {
--scrollbar-thumb:rgba(var(--color-primary-100), 1) !important
}
.scrollbar-thumb-primary-500 {
--scrollbar-thumb:rgba(var(--color-primary-500), 1) !important
}
.scrollbar-thumb-primary-600 {
--scrollbar-thumb:rgba(var(--color-primary-600), 1) !important
}
.\!\[clip\:rect\(0\2c 0\2c 0\2c 0\)\] {
clip:rect(0,0,0,0) !important
}
@ -5225,6 +5245,18 @@ pre {
--scrollbar-thumb:rgba(var(--color-neutral-600), 1) !important
}
.dark\:scrollbar-thumb-primary-600:is(.dark *) {
--scrollbar-thumb:rgba(var(--color-primary-600), 1) !important
}
.dark\:scrollbar-thumb-primary-400:is(.dark *) {
--scrollbar-thumb:rgba(var(--color-primary-400), 1) !important
}
.dark\:scrollbar-thumb-primary-100:is(.dark *) {
--scrollbar-thumb:rgba(var(--color-primary-100), 1) !important
}
.group:hover .dark\:group-hover\:text-neutral-700:is(.dark *) {
--tw-text-opacity:1;
color:rgba(var(--color-neutral-700), var(--tw-text-opacity))

View file

@ -8,7 +8,7 @@
{{- partial "head.html" . -}}
<body
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 scrollbar scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600">
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600">
<div id="the-top" class="absolute flex self-center">
<a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
href="#main-content"><span

View file

@ -1,5 +1,5 @@
<details open id="TOCView"
class="toc-right mt-0 overflow-y-scroll overscroll-contain scrollbar scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600 rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 hidden lg:block">
class="toc-right mt-0 overflow-y-scroll overscroll-contain scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600 rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 hidden lg:block">
<summary
class="block py-1 text-lg font-semibold cursor-pointer bg-neutral-100 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden">
{{ i18n "article.table_of_contents" }}
@ -22,9 +22,8 @@
<script>
var overflowOn = false;
var margin = 300;
var marginError = 150;
var margin = 200;
var marginError = 50;
(function () {
var $window = $(window);
@ -33,15 +32,13 @@
function onResize() {
var windowAndMarginHeight = $window.height() - margin;
if(tocHeight >= windowAndMarginHeight) {
$toc.css("overflow-y", "scroll")
overflowOn = true;
$toc.css("max-height", (windowAndMarginHeight + marginError) + "px")
} else {
$toc.css("overflow-y", "hidden")
$toc.css("max-height", "9999999px")
}
$toc.css("max-height", (windowAndMarginHeight + marginError) + "px")
}
$window.on('resize', onResize);