Skip to content

Commit 842acc4

Browse files
committed
Color tweaks
1 parent 7a9a6e8 commit 842acc4

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

src/sass/_defaults.scss

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// These are the colors apps are can override. We define the defaults here and
99
// define variables for them in _colors.scss
1010

11-
// The main accent color and the matching text value
12-
1311
@use 'sass:color';
1412
@use 'settings' as *;
1513
@use 'functions' as *;
@@ -22,27 +20,39 @@ $_fg_color: #323233; // Similar to rgba(0,0,6,0.8) on the background #fafafb
2220
$_text_color: #333334; // Similar to rgba(0,0,6,0.8) on the background #ffffff
2321
$_hb_fg_color: #2f2f30; // Similar to rgba(0,0,6,0.8) on the background #ebebed
2422

23+
// The main accent color and the matching text value
2524
@define-color accent_bg_color @blue_3;
2625
@define-color accent_fg_color white;
27-
@define-color accent_color #{if($variant == 'dark', gtkmix('@accent_bg_color', white, 60%), gtkmix('@accent_bg_color', black, 83%))};
2826

2927
// destructive-action buttons
30-
@define-color destructive_bg_color #{if($variant == 'dark', '@red_4', '@red_3')};
28+
@define-color destructive_bg_color #{if($variant == 'light', '@red_3', '@red_4')};
3129
@define-color destructive_fg_color white;
32-
@define-color destructive_color #{if($variant == 'dark', gtkmix('@destructive_bg_color', white, 60%), gtkmix('@destructive_bg_color', black, 83%))};
3330

3431
// Levelbars, entries, labels and infobars. These don't need text colors
35-
@define-color success_bg_color #{if($variant == 'dark', '@green_5', '@green_4')};
32+
@define-color success_bg_color #{if($variant == 'light', '@green_4', '@green_5')};
3633
@define-color success_fg_color white;
37-
@define-color success_color #{if($variant == 'dark', gtkmix('@success_bg_color', white, 60%), gtkmix('@success_bg_color', black, 83%))};
3834

39-
@define-color warning_bg_color #{if($variant == 'dark', '#cd9309', "@yellow_5")};
35+
@define-color warning_bg_color #{if($variant == 'light', '@yellow_5', "#c01c28")};
4036
@define-color warning_fg_color rgba(0,0,0,0.8);
41-
@define-color warning_color #{if($variant == 'dark', gtkmix('@warning_bg_color', white, 60%), gtkmix('@warning_bg_color', black, 83%))};
4237

43-
@define-color error_bg_color #{if($variant == 'dark', '@red_4', '@red_3')};
38+
@define-color error_bg_color #{if($variant == 'light', '@red_3', '@red_4')};
4439
@define-color error_fg_color white;
45-
@define-color error_color #{if($variant == 'dark', gtkmix('@error_bg_color', white, 60%), gtkmix('@error_bg_color', black, 83%))};
40+
41+
// Colors derived from their matching bg color
42+
// Not quite the same as libadwaita but "close enough"
43+
@if $variant == 'light' {
44+
@define-color accent_color #{gtkmix('@accent_bg_color', black, 83%)};
45+
@define-color destructive_color #{gtkmix('@destructive_bg_color', black, 83%)};
46+
@define-color success_color #{gtkmix('@success_bg_color', black, 83%)};
47+
@define-color warning_color #{gtkmix('@warning_bg_color', black, 83%)};
48+
@define-color error_color #{gtkmix('@error_bg_color', black, 83%)};
49+
} @else {
50+
@define-color accent_color #{gtkmix('@accent_bg_color', white, 60%)};
51+
@define-color destructive_color #{gtkmix('@destructive_bg_color', white, 60%)};
52+
@define-color success_color #{gtkmix('@success_bg_color', white, 60%)};
53+
@define-color warning_color #{gtkmix('@warning_bg_color', white, 60%)};
54+
@define-color error_color #{igtkmix('@error_bg_color', white, 60%)};
55+
}
4656

4757
// Window
4858
@define-color window_bg_color #{if($variant == 'light', '#fafafb', '#222226')};

0 commit comments

Comments
 (0)