+@use "sass:color";
+@use "sass:math";
+
// Bootstrap functions
//
// Utility mixins and functions for evaluating source code across our variables, maps, and mixins.
// Colors
@function to-rgb($value) {
- @return red($value), green($value), blue($value);
+ @return math.round(color.channel($value, "red", $space: rgb)), math.round(color.channel($value, "green", $space: rgb)), math.round(color.channel($value, "blue", $space: rgb));
}
// stylelint-disable scss/dollar-variable-pattern
// See https://www.w3.org/TR/WCAG/#dfn-contrast-ratio
@function luminance($color) {
$rgb: (
- "r": red($color),
- "g": green($color),
- "b": blue($color)
+ "r": math.round(color.channel($color, "red", $space: rgb)), // stylelint-disable-line scss/at-function-named-arguments
+ "g": math.round(color.channel($color, "green", $space: rgb)), // stylelint-disable-line scss/at-function-named-arguments
+ "b": math.round(color.channel($color, "blue", $space: rgb)) // stylelint-disable-line scss/at-function-named-arguments
);
@each $name, $value in $rgb {
}
}
@include color-mode(dark, true) {
- --custom-color: #{mix($indigo, $blue, 50%)};
+ --custom-color: #{$indigo};
}
}
@include expect() {
background-color: var(--bs-primary-bg-subtle);
}
[data-bs-theme=dark] {
- --custom-color: #3a3ff8;
+ --custom-color: #6610f2;
}
}
}
}
}
@include color-mode(dark, true) {
- --custom-color: #{mix($indigo, $blue, 50%)};
+ --custom-color: #{$indigo}
}
}
@include expect() {
}
@media (prefers-color-scheme: dark) {
:root {
- --custom-color: #3a3ff8;
+ --custom-color: #6610f2;
}
}
}
module.exports = (filename, { describe, it }) => {
const data = fs.readFileSync(filename, 'utf8')
- const TRUE_SETUP = '$true-terminal-output: false; @import "true";'
+ const TRUE_SETUP = '$true-terminal-output: false; @use "true" as *;'
const sassString = TRUE_SETUP + data
runSass(