From f4af53b350944bb7127bd193d9a440834946ca06 Mon Sep 17 00:00:00 2001 From: Louis-Maxime Piton Date: Wed, 25 Oct 2023 10:47:53 +0200 Subject: [PATCH] Dark mode: Quantity selector (#2287) --- scss/_variables.scss | 5 ++ scss/forms/_quantity-selector.scss | 11 ++- site/content/docs/5.3/dark-mode.md | 117 +++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+), 3 deletions(-) diff --git a/scss/_variables.scss b/scss/_variables.scss index d7f8fb0128..aad3b86a6d 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -2324,6 +2324,11 @@ $quantity-selector-sm-width: 5.625rem !default; $quantity-selector-btn-padding-x: add($btn-icon-padding-x, 2px) !default; $quantity-selector-btn-padding-x-sm: add($btn-icon-padding-x-sm, 2px) !default; +$quantity-selector-btn-bg: var(--#{$prefix}body-bg) !default; +$quantity-selector-btn-border: var(--#{$prefix}border-width) solid var(--#{$prefix}border-color-translucent) !default; + +$quantity-selector-disabled-color: var(--#{$prefix}disabled-color) !default; +$quantity-selector-disabled-bg: var(--#{$prefix}body-bg) !default; $quantity-selector-icon-width: .875rem !default; $quantity-selector-icon-sm-width: .625rem !default; diff --git a/scss/forms/_quantity-selector.scss b/scss/forms/_quantity-selector.scss index 0bcfd834ea..7ca212339d 100644 --- a/scss/forms/_quantity-selector.scss +++ b/scss/forms/_quantity-selector.scss @@ -24,13 +24,18 @@ } &:disabled { - color: $gray-500; - background-color: $white; + color: $quantity-selector-disabled-color; + background-color: $quantity-selector-disabled-bg; } } button { - border: var(--#{$prefix}border-width) solid $gray-500; + background-color: $quantity-selector-btn-bg; + border: $quantity-selector-btn-border; + + &:disabled { + background-color: $quantity-selector-btn-bg; + } &:first-of-type { @include button-icon($quantity-selector-icon-remove, $size: $quantity-selector-icon-width $quantity-selector-icon-remove-height, $pseudo: "after"); diff --git a/site/content/docs/5.3/dark-mode.md b/site/content/docs/5.3/dark-mode.md index 35434394b5..c2447c513c 100644 --- a/site/content/docs/5.3/dark-mode.md +++ b/site/content/docs/5.3/dark-mode.md @@ -2621,6 +2621,123 @@ sitemap_exclude: true
Form text helper
+### Quantity selector + +

No theme

+ +
+
+ + + +
+
+ + + +
+
+ +

Dark theme on container

+ +
+
+ + + +
+
+ + + +
+
+ +

Light theme on container

+ +
+
+ + + +
+
+ + + +
+
+ +

Dark theme on component

+ +
+
+ + + +
+
+ + + +
+
+ +

Light theme on component

+ +
+
+ + + +
+
+ + + +
+
+ ### Range

No theme