Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authork <68973000+moll-y@users.noreply.github.com>2021-06-20 16:49:35 +0300
committerGitHub <noreply@github.com>2021-06-20 16:49:35 +0300
commitdda55f87e28e5132abfe0bcb4991e93c79688e5e (patch)
treeba1c136baa6821cb6f138ddf0257ba6ab4fedd17 /assets/scss/partials/base.scss
parent495a3b0289797ef675d2d7befa1362a07e7f6bdd (diff)
feat: change the page vertical scrollbar styles (#227)
* fix: take out [data-scheme="dark"] from :root Taking out the [data-scheme="dark"] from :root allows us to fix the precedence of CSS when the [data-scheme="dark"] is placed in the <html> tag. This is needed in order to make the dark styles accesible from the <html> elment, this will allow us to change the vertical scrollbar styles following the dark and light schemes. * change document.body.dataset.scheme to document.documentElement.dataset.scheme When the dark mode is on or when the light mode is on, the [data-scheme="light"] or [data-scheme="dark"], respectively, will be placed in the <html> tag. Allowing us to access the dark and light color schemes from the <html> to change the vertical scrollbar styles according to the current color scheme. * feat: change the page vertical scrollbar styles This change will make the vertical scrollbar styles to follow the dark and light color scheme modes. Also, this change will make the vertical scrollbar to look consistent in both, Chromium and Firefox. * make the scrollbar-track background-color transparent The body has this transition: 'transition: background-color 0.3s ease 0s'. Making the scrollbar-track background-color transparent allow us to appreciate that transition in the scrollbar-track when switching the background-color. * Move [data-scheme=dark] back to :root block * fix(comment/waline): detect dark mode from html tag * feat: apply custom scrollbar style to all elements Co-authored-by: Jimmy Cai <jimmehcai@gmail.com>
Diffstat (limited to 'assets/scss/partials/base.scss')
-rw-r--r--assets/scss/partials/base.scss21
1 files changed, 21 insertions, 0 deletions
diff --git a/assets/scss/partials/base.scss b/assets/scss/partials/base.scss
index 42e460e..e7aefe6 100644
--- a/assets/scss/partials/base.scss
+++ b/assets/scss/partials/base.scss
@@ -15,3 +15,24 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
+
+/* scrollbar styles for Firefox */
+* {
+ scrollbar-width: auto;
+ scrollbar-color: var(--scrollbar-thumb) transparent;
+}
+/**/
+
+/* scrollbar styles for Chromium */
+::-webkit-scrollbar {
+ height: auto;
+}
+
+::-webkit-scrollbar-thumb {
+ background-color: var(--scrollbar-thumb);
+}
+
+::-webkit-scrollbar-track {
+ background-color: transparent;
+}
+/**/