Implement proper dark mode

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
hossainemruz 2023-09-30 04:53:27 +06:00
parent 6dc9d1d33d
commit 1913cf1e9d
38 changed files with 1136 additions and 353 deletions

View file

@ -1,3 +1,21 @@
@function get-color($mode, $key) {
@if map-has-key($themes, $mode) {
$theme: map-get($themes, $mode);
@if map-has-key($theme, $key) {
@return map-get($theme, $key);
}
}
@return red; // default color for debugging purpose
}
@function get-light-color($key) {
@return get-color('light', $key);
}
@function get-dark-color($key) {
@return get-color('dark', $key);
}
@mixin reset-list {
margin: 0;
padding: 0;
@ -24,7 +42,11 @@
transition: all $transition-type $transition-duration;
}
@mixin selection-color() {
background: $accent-color;
color: $text-over-accent-color;
@mixin selection-color($theme: 'light') {
background: get-light-color('accent-color');
color: get-light-color('text-over-accent-color');
@if $theme == 'dark' {
background: get-dark-color('accent-color');
color: get-dark-color('text-over-accent-color');
}
}