Skip to main content

max / alloy

5.7 KB · 119 lines History Blame Raw
1 @{! variants = default, night }
2 /*
3 * Alloy GTK 4 palette patch
4 *
5 * Applied over adw-gtk3 (or plain libadwaita in GTK 4 apps that use it
6 * directly). Overrides libadwaita's named color tokens with @{meta.name}.
7 * Chrome stays warm and muted; only the information colors
8 * (success/warning/error) actually pop.
9 *
10 * Palette source of truth: the makeover theme this file rendered against.
11 * Derivation rules (border-subtle, border-strong): docs/TOKENS.md.
12 *
13 * Both polarities come out of this one file. A @media (prefers-color-scheme)
14 * block would be the other way to do it, and it is the wrong one here: the
15 * polarity is not the display's preference, it is the mode the session was
16 * started in, which gtk-application-prefer-dark-theme in settings.ini already
17 * decides. Two mechanisms disagreeing is how an app ends up with dark widgets
18 * and light fills.
19 */
20
21 /* -------------------------------------------------------------------
22 * Palette
23 * ------------------------------------------------------------------- */
24 @define-color alloy_surface_sunken @{surface.sunken};
25 @define-color alloy_surface @{surface.page};
26 @define-color alloy_surface_raised @{surface.raised};
27 @define-color alloy_surface_overlay @{surface.overlay};
28 @define-color alloy_border_subtle @{border.subtle};
29 @define-color alloy_border @{line.border};
30 @define-color alloy_border_strong @{border.strong};
31 @define-color alloy_text_muted @{content.muted};
32 @define-color alloy_text_secondary @{content.secondary};
33 @define-color alloy_text_primary @{content.primary};
34 @define-color alloy_accent_error @{status.danger};
35 @define-color alloy_accent_warn @{status.warning};
36 @define-color alloy_accent_ok @{status.success};
37 @define-color alloy_action_primary @{action.primary};
38
39 /* The tone every shade token below is an alpha of. A shadow is dark in both
40 * polarities, so this cannot be the ink: under a dark theme the ink is the
41 * pale tone and a "shade" made from it lights the surface it is meant to sink.
42 * `ansi.0` is the one token that already means *the darkest tone this theme
43 * has* and flips its intent with the polarity, which is exactly the question
44 * being asked (skelgen's achromatic_slot has the reasoning). */
45 @define-color alloy_shade @{ansi.0};
46
47 /* -------------------------------------------------------------------
48 * libadwaita chrome — window, view, dialog, headerbar, sidebar, card
49 * ------------------------------------------------------------------- */
50 @define-color window_bg_color @alloy_surface;
51 @define-color window_fg_color @alloy_text_primary;
52
53 @define-color view_bg_color @alloy_surface_raised;
54 @define-color view_fg_color @alloy_text_primary;
55
56 @define-color headerbar_bg_color @alloy_surface_raised;
57 @define-color headerbar_fg_color @alloy_text_primary;
58 @define-color headerbar_border_color @alloy_border_subtle;
59 @define-color headerbar_backdrop_color @alloy_surface;
60 @define-color headerbar_shade_color alpha(@alloy_shade, 0.06);
61 @define-color headerbar_darker_shade_color alpha(@alloy_shade, 0.09);
62
63 @define-color sidebar_bg_color @alloy_surface_sunken;
64 @define-color sidebar_fg_color @alloy_text_primary;
65 @define-color sidebar_backdrop_color @alloy_surface;
66 @define-color sidebar_shade_color alpha(@alloy_shade, 0.06);
67 @define-color sidebar_border_color @alloy_border_subtle;
68
69 @define-color secondary_sidebar_bg_color @alloy_surface;
70 @define-color secondary_sidebar_fg_color @alloy_text_primary;
71 @define-color secondary_sidebar_backdrop_color @alloy_surface_sunken;
72 @define-color secondary_sidebar_shade_color alpha(@alloy_shade, 0.06);
73 @define-color secondary_sidebar_border_color @alloy_border_subtle;
74
75 @define-color card_bg_color @alloy_surface_raised;
76 @define-color card_fg_color @alloy_text_primary;
77 @define-color card_shade_color alpha(@alloy_shade, 0.06);
78
79 @define-color popover_bg_color @alloy_surface_overlay;
80 @define-color popover_fg_color @alloy_text_primary;
81 @define-color popover_shade_color alpha(@alloy_shade, 0.06);
82
83 @define-color dialog_bg_color @alloy_surface;
84 @define-color dialog_fg_color @alloy_text_primary;
85
86 @define-color thumbnail_bg_color @alloy_surface_raised;
87 @define-color thumbnail_fg_color @alloy_text_primary;
88
89 @define-color shade_color alpha(@alloy_shade, 0.06);
90 @define-color scrollbar_outline_color @alloy_border_subtle;
91
92 /* -------------------------------------------------------------------
93 * Semantic — accent (chrome), destructive, success, warning, error
94 * ------------------------------------------------------------------- */
95 @define-color accent_bg_color @alloy_action_primary;
96 @define-color accent_fg_color @{readable_on(action.primary)};
97 @define-color accent_color @alloy_action_primary;
98
99 @define-color destructive_bg_color @alloy_accent_error;
100 @define-color destructive_fg_color @{readable_on(status.danger)};
101 @define-color destructive_color @alloy_accent_error;
102
103 @define-color success_bg_color @alloy_accent_ok;
104 @define-color success_fg_color @{readable_on(status.success)};
105 @define-color success_color @alloy_accent_ok;
106
107 @define-color warning_bg_color @alloy_accent_warn;
108 @define-color warning_fg_color @{readable_on(status.warning)};
109 @define-color warning_color @alloy_accent_warn;
110
111 @define-color error_bg_color @alloy_accent_error;
112 @define-color error_fg_color @{readable_on(status.danger)};
113 @define-color error_color @alloy_accent_error;
114
115 /* -------------------------------------------------------------------
116 * Borders (libadwaita's borders alpha token)
117 * ------------------------------------------------------------------- */
118 @define-color borders alpha(@alloy_text_primary, 0.15);
119