Replace SCSS compilation with CSS variables (#4191)

* Replace SCSS compilation with CSS variables

* Update tests

* Update src/pretix/presale/style.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/presale/context.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/presale/views/widget.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/presale/context.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/static/pretixbase/scss/_variables.scss

Co-authored-by: Richard Schreiber <schreiber@rami.io>

* Last minor changes

* Rename file

---------

Co-authored-by: Mira <weller@rami.io>
Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
Raphael Michel
2024-06-25 13:01:20 +02:00
committed by GitHub
parent 7672e6274d
commit f0a06cd9fe
72 changed files with 867 additions and 1600 deletions

View File

@@ -289,10 +289,8 @@ $linear-channel-values:
.9911020971138298
1;
/**
* Calculate the luminance for a color.
* See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
*/
// Calculate the luminance for a color.
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
@function luminance($color) {
$red: nth($linear-channel-values, red($color) + 1);
$green: nth($linear-channel-values, green($color) + 1);
@@ -301,10 +299,8 @@ $linear-channel-values:
@return .2126 * $red + .7152 * $green + .0722 * $blue;
}
/**
* Calculate the contrast ratio between two colors.
* See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
*/
// Calculate the contrast ratio between two colors.
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
@function contrast($back, $front) {
$backLum: luminance($back) + .05;
$foreLum: luminance($front) + .05;
@@ -312,10 +308,8 @@ $linear-channel-values:
@return max($backLum, $foreLum) / min($backLum, $foreLum);
}
/**
* Determine whether to use dark or light text on top of given color.
* Returns black for dark text and white for light text.
*/
// Determine whether to use dark or light text on top of given color.
// Returns black for dark text and white for light text.
@function choose-contrast-color($color, $l, $d) {
$lightContrast: contrast($color, $l);
$darkContrast: contrast($color, $d);