From 0d7755925b3ff24e0c71c8b36539511e914b1da3 Mon Sep 17 00:00:00 2001 From: Louis-Maxime Piton Date: Fri, 27 Oct 2023 08:27:18 +0200 Subject: [PATCH] Dark mode: Back to top (#2329) --- scss/_back-to-top.scss | 4 +- scss/_variables.scss | 4 +- site/content/docs/5.3/dark-mode.md | 79 +++++++++++++++++++++++++++++- 3 files changed, 84 insertions(+), 3 deletions(-) diff --git a/scss/_back-to-top.scss b/scss/_back-to-top.scss index 2e2e3b0623..051b68401f 100644 --- a/scss/_back-to-top.scss +++ b/scss/_back-to-top.scss @@ -16,9 +16,10 @@ --#{$prefix}back-to-top-link-icon: #{$back-to-top-icon}; --#{$prefix}back-to-top-link-width: #{$back-to-top-icon-width}; --#{$prefix}back-to-top-link-height: #{$back-to-top-icon-height}; + --#{$prefix}back-to-top-link-bg: #{$back-to-top-bg}; --#{$prefix}back-to-top-title-offset-right: #{$back-to-top-title-offset-right}; --#{$prefix}back-to-top-title-padding: #{$back-to-top-title-padding}; - --#{$prefix}back-to-top-title-color: #{color-contrast($back-to-top-title-bg-color)}; + --#{$prefix}back-to-top-title-color: #{$back-to-top-title-color}; --#{$prefix}back-to-top-title-bg-color: #{$back-to-top-title-bg-color}; --#{$prefix}back-to-top-title-active-decoration: #{$link-decoration}; // scss-docs-end back-to-top-css-vars @@ -43,6 +44,7 @@ position: sticky; top: var(--#{$prefix}back-to-top-link-offset-top); pointer-events: all; + background-color: var(--#{$prefix}back-to-top-link-bg); @include button-icon(var(--#{$prefix}back-to-top-link-icon), $size: var(--#{$prefix}back-to-top-link-width) var(--#{$prefix}back-to-top-link-height), $pseudo: "after", $position: calc(50% - 1px)); &::after { diff --git a/scss/_variables.scss b/scss/_variables.scss index 0961f26ae7..21291e15b1 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -2262,7 +2262,9 @@ $back-to-top-link-offset-top: subtract(100vh, $back-to-top-offset * 4) !defau $back-to-top-link-offset-top-xl: subtract(100vh, $spacer * 5) !default; $back-to-top-title-offset-right: add(100%, var(--#{$prefix}border-width)) !default; $back-to-top-title-padding: subtract($btn-padding-y, 1px) $btn-padding-x add($btn-padding-y, 1px) !default; -$back-to-top-title-bg-color: $white !default; +$back-to-top-title-color: var(--#{$prefix}body-color) !default; +$back-to-top-title-bg-color: var(--#{$prefix}body-bg) !default; +$back-to-top-bg: var(--#{$prefix}highlight-color) !default; $back-to-top-icon: var(--#{$prefix}chevron-icon) !default; $back-to-top-icon-width: add(.5rem, 1px) !default; $back-to-top-icon-height: subtract(1rem, 1px) !default; diff --git a/site/content/docs/5.3/dark-mode.md b/site/content/docs/5.3/dark-mode.md index b6cf9b3b6e..94e94a00e8 100644 --- a/site/content/docs/5.3/dark-mode.md +++ b/site/content/docs/5.3/dark-mode.md @@ -444,6 +444,83 @@ sitemap_exclude: true +### Back to top + +

No theme

+ +
+ + +
+ +

Dark theme on container

+ +
+ + +
+ +

Light theme on container

+ +
+ + +
+ +

Dark theme on component

+ +
+ + +
+ +

Light theme on component

+ +
+ + +
+ ### Breadcrumb

No theme

@@ -3273,7 +3350,7 @@ sitemap_exclude: true -### Form validation +### Validation

No theme