How to properly introduce a light/dark mode in Bootstrap?

Bootstrap 5.3.0-alpha (update 2023) Bootstrap has introduced a dark mode, and the ability to create other color-modes. However, this feature is currently limited to a few variables, and it’s not possible to customize the dark theme colors. For the dark mode switch, simply add the data-bs-theme attribute to the doc’s html tag: <html data-bs-theme=”dark”> Using … Read more

Creating CSS3 Circles connected by lines

You can achieve this effect with no additional markup using pseudo-elements and the adjacent sibling selector (~): li { width: 2em; height: 2em; text-align: center; line-height: 2em; border-radius: 1em; background: dodgerblue; margin: 0 1em; display: inline-block; color: white; position: relative; } li::before{ content: ”; position: absolute; top: .9em; left: -4em; width: 4em; height: .2em; background: … Read more

SASS implementation for Java? [closed]

With ANT: Download JRuby complete jar file (JRuby Complete jar download page) Download the latest HAML/SASS code (HAML/SASS tarball), and extract it. Put it in “/libs/sass-[VERSION]” Add the following to an ant build file. Replace [VERSION] in the script to the corresponding versions of JRuby and SASS Run the ant script, and the sass or … Read more

Pass function or mixin by reference in SASS

Functions and mixins are not first-class in Sass, meaning you can’t pass them around as arguments like you can with variables. Sass 3.2 and older The closest you can get is with the @content directive (Sass 3.2+). @mixin foo { a { @content; } } @include bob { b: foo(c); // this replaces `@content` in … Read more

Interpolation of prefixes on @keyframes in Sass

This simply isn’t possible using variable interpolation. You can get around the @ assignment like this: $at: unquote(“@”); // either of these will work $amp: #{“@”}; But then you end up with this error: error sass/test.scss (Line 4: Invalid CSS after “”: expected selector_comma_sequence, was “@-ms-keyframes …”) Interpolation on @keyframes is not currently supported, but … Read more