decker-edu / decker

A markdown based tool for slide deck creation.
GNU General Public License v3.0
60 stars 15 forks source link

Change generated CSS variables from preprocessor to using color-mix #112

Open salbeira opened 6 months ago

salbeira commented 6 months ago

Around middle 2023 the css function "color-mix" is now available everywhere.

Currently our CSS rules for accent0-fg etc. get generated during compile time. The resulting values are equal to the srgb-linear color-mix function.

We can now change the export of the palette to just the shade and accent colors and insert static rules for the -bg, -bbg, -fg and -ffg modifiers:

:root {
  --contrast: 40%;
  --accent0-bg: color-mix(in srgb-linear, var(--accent0), var(--background-color) var(--contrast));
  --accent0-bbg: color-mix(in srgb-linear, var(--accent0), var(--background-color) calc(2 * var(--contrast)));
}
monofon commented 3 months ago

Hauer baut das CSS. Henrik schmeisst dann den Haskell Kram weg.