mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
feat: contrast util with yiq calculator (#3652)
* add yiq calculator util * fix: convert 3 chars hex to 6 chars hex * fix: clarify util name * feat: add text color variables not depending on the dark/light mode * refactor: change getContrast to isDark with for a more direct approach * fix: adjust snippet description * chore: change `var` to `let` Co-authored-by: David Wheatley <david@davwheat.dev>
This commit is contained in:
@@ -64,6 +64,13 @@
|
||||
@code-color: #fff;
|
||||
}
|
||||
|
||||
// Beyond dark or light mode, we need stable colors depending on the luminosity
|
||||
// of the parents element's background. This allow not to change the color
|
||||
// variable depending on the dark/light mode to get the same final color, and
|
||||
// thus to simplify the logic.
|
||||
@text-on-dark: #ddd;
|
||||
@text-on-light: #111;
|
||||
|
||||
@hero-bg: @control-bg;
|
||||
@hero-color: @control-color;
|
||||
@hero-muted-color: @control-color;
|
||||
|
Reference in New Issue
Block a user