Skip to content

Commit 45cb389

Browse files
authored
feat(value-box): Tweaks for dark mode (#791)
1 parent 126b76a commit 45cb389

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

inst/builtin/bs5/shiny/_rules.scss

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,30 @@ $icon-classes: ("bi", "fa", "fas", "far", "fab", "material-icons") !default;
9797
}
9898
}
9999

100+
100101
.bslib-value-box {
101-
&.text-info,
102-
&.text-cyan {
103-
color: #028097 !important; // Contrast 4.63
102+
$cyan: #028097; // Contrast 4.63
103+
$warning: #A87600; // Contrast 4 (okay for 16px+ text)
104+
105+
&.text-info {
106+
&, &.text-cyan {
107+
--bslib-color-fg: $cyan !important;
108+
}
109+
color: $cyan !important;
104110
}
111+
105112
&.text-light {
106-
color: $gray-600 !important;
113+
--bslib-color-fg: $gray-600 !important;
107114
}
108-
&.text-yellow.text-yellow,
109-
&.text-warning.text-warning {
110-
color: #A87600; // Contrast 4 (okay for 16px+ text)
115+
116+
&.text-warning {
117+
&, &.text-yellow {
118+
--bslib-color-fg: $warning !important;
119+
}
120+
color: $warning !important;
111121
}
122+
112123
&.text-teal.text-teal {
113-
color: #008558; // Contrast 4.67
124+
--bslib-color-fg: #008558; // Contrast 4.67
114125
}
115126
}

inst/components/dist/value_box/value_box.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/components/scss/value_box.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,10 @@ $bslib-value-box-horizontal-break-point: 300px;
233233
}
234234
}
235235
}
236+
237+
@include color-mode(dark) {
238+
.bslib-value-box {
239+
// Bootstrap doesn't have a dark shadow, but the default isn't quite right
240+
--bslib-value-box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 50%);
241+
}
242+
}

0 commit comments

Comments
 (0)