From 56a39e51bf98aab45c7bafc42721e51589b9c653 Mon Sep 17 00:00:00 2001 From: Louis-Maxime Piton Date: Tue, 3 Oct 2023 15:11:56 +0200 Subject: [PATCH] Star rating dark mode (#2275) --- scss/_variables.scss | 7 +- scss/forms/_star-rating.scss | 4 +- site/content/docs/5.3/dark-mode.md | 149 ++++++++++++++++++++++++----- 3 files changed, 131 insertions(+), 29 deletions(-) diff --git a/scss/_variables.scss b/scss/_variables.scss index 03f5aaeb8e..50d4cc621a 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -1179,9 +1179,10 @@ $form-star-size: 1.5625rem !default; $form-star-size-sm: 1.25rem !default; $form-star-margin-between: -.125rem !default; -$form-star-rating-checked-color: $accessible-orange !default; -$form-star-rating-unchecked-color: $gray-700 !default; -$form-star-rating-hover-color: $black !default; +$form-star-rating-checked-color: var(--#{$prefix}link-hover-color) !default; +$form-star-rating-unchecked-color: var(--#{$prefix}secondary-color) !default; +$form-star-rating-hover-color: var(--#{$prefix}highlight-bg) !default; +$form-star-rating-disabled-color: var(--#{$prefix}border-color-translucent) !default; $form-star-rating-checked-icon: escape-svg(url("data:image/svg+xml,")) !default; $form-star-rating-unchecked-icon: escape-svg(url("data:image/svg+xml,")) !default; diff --git a/scss/forms/_star-rating.scss b/scss/forms/_star-rating.scss index e707d9aca2..7fe06fe3a2 100644 --- a/scss/forms/_star-rating.scss +++ b/scss/forms/_star-rating.scss @@ -12,8 +12,8 @@ &:disabled { pointer-events: none; - --#{$prefix}star-rating-checked-color: var(--#{$prefix}border-color-translucent); - --#{$prefix}star-rating-unchecked-color: var(--#{$prefix}border-color-translucent); + --#{$prefix}star-rating-checked-color: #{$form-star-rating-disabled-color}; + --#{$prefix}star-rating-unchecked-color: #{$form-star-rating-disabled-color}; } > label { diff --git a/site/content/docs/5.3/dark-mode.md b/site/content/docs/5.3/dark-mode.md index 8d2376e3c2..8e85c925ab 100644 --- a/site/content/docs/5.3/dark-mode.md +++ b/site/content/docs/5.3/dark-mode.md @@ -83,9 +83,11 @@ sitemap_exclude: true -## Accordions +## Components -### No theme +### Accordions + +#### No theme
@@ -126,7 +128,7 @@ sitemap_exclude: true
-### Dark theme on container +#### Dark theme on container Using bg-body @@ -169,7 +171,7 @@ Using bg-body -### Light theme on container +#### Light theme on container Using bg-body @@ -212,7 +214,7 @@ Using bg-body -### Dark theme on component +#### Dark theme on component
@@ -253,7 +255,7 @@ Using bg-body
-### Light theme on component +#### Light theme on component
@@ -294,9 +296,9 @@ Using bg-body
-## Alerts +### Alerts -### No theme +#### No theme
-### Dark theme on container +#### Dark theme on container Using bg-body @@ -340,7 +342,7 @@ Using bg-body -### Light theme on container +#### Light theme on container Using bg-body @@ -363,7 +365,7 @@ Using bg-body -### Dark theme on component +#### Dark theme on component
-### Light theme on component +#### Light theme on component
-## Stepped process +### Stepped process -### No theme +#### No theme
-### Dark theme on container +#### Dark theme on container Using bg-body @@ -459,7 +461,7 @@ Using bg-body -### Light theme on container +#### Light theme on container Using bg-body @@ -486,7 +488,7 @@ Using bg-body -### Dark theme on component +#### Dark theme on component
-### Light theme on component +#### Light theme on component
-## Local navigation +### Local navigation -### No theme +#### No theme
-### Dark theme on container +#### Dark theme on container Using bg-body @@ -579,7 +581,7 @@ Using bg-body -### Light theme on container +#### Light theme on container Using bg-body @@ -601,7 +603,7 @@ Using bg-body -### Dark theme on component +#### Dark theme on component
-### Light theme on component +#### Light theme on component
+ + +## Forms + +### Star rating + +#### No theme + +
+
+ Results relevance + + + + + + + + + + +
+
+ +#### Dark theme on container + +Using bg-body + +
+
+ Results relevance + + + + + + + + + + +
+
+ +#### Light theme on container + +Using bg-body + +
+
+ Results relevance + + + + + + + + + + +
+
+ +#### Dark theme on component + +
+
+ Results relevance + + + + + + + + + + +
+
+ +#### Light theme on component + +
+
+ Results relevance + + + + + + + + + + +
+