Dark mode for mark tag (text highlighting) #39139
-
Hello, I'm using the But I find it too bright in dark mode: In my specific case ( So I ended up using this CSS snippet: [data-bs-theme=dark] { --bs-highlight-bg: var(--bs-gray-700); } Questions:
:root,
[data-bs-theme=light] {
--bs-highlight-bg: #fff3cd;
}
[data-bs-theme=dark] {
/* No color override for --bs-highlight-bg in dark mode */
}
mark, .mark {
padding: 0.1875em;
background-color: var(--bs-highlight-bg);
} Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I'll let the designer answer in the PR since it is more of a design choice.
We could indeed have an overridable Sass var (e.g. @if $enable-dark-mode {
@include color-mode(dark, true) {
/* ... */
--#{$prefix}highlight-bg: #{$mark-bg-dark};
}
} Created a PR for that (#39141), thanks for pointing that out @angely-dev. |
Beta Was this translation helpful? Give feedback.
-
Thanks @julien-deramond for the quick answer and PR, I appreciate it. I marked it as answer, hoping for the PR to be reviewed and accepted in a future release. |
Beta Was this translation helpful? Give feedback.
I'll let the designer answer in the PR since it is more of a design choice.
We could indeed have an overridable Sass var (e.g.
$mark-bg-dark
) with whatever value and then have in our_root.scss
:Created a PR for that (#39141), thanks for pointing that out @angely-dev.