Skip to content

Commit 2c4cc47

Browse files
committed
Unify tag row default color styles and use CSS variables
1 parent a8228ab commit 2c4cc47

3 files changed

Lines changed: 24 additions & 22 deletions

File tree

data/style.css

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
--purple: #ba68c8;
1414
--pink: #f06292;
1515
--brown: #bcaaa4;
16+
--default: #e3e2e8;
1617

1718
--app-bg: #f9f5f4;
1819
--dialog-bg: #f5f1f0;
@@ -477,6 +478,16 @@ popover flowbox button.flat,
477478
}
478479

479480
/* --- Tag Row Color Classes --- */
481+
.tag-row-default:selected {
482+
background: alpha(var(--default), 0.2);
483+
}
484+
.tag-row-default:hover {
485+
background: alpha(var(--default), 0.14);
486+
}
487+
.tag-row-default:active {
488+
background: alpha(var(--default), 0.16);
489+
}
490+
480491
.tag-row-red:selected {
481492
background: alpha(var(--red), 0.15);
482493
}
@@ -597,17 +608,6 @@ popover flowbox button.flat,
597608
background: alpha(var(--brown), 0.14);
598609
}
599610

600-
/* Default fallback */
601-
.tag-row-default:selected {
602-
background: #f3f2f8;
603-
}
604-
.tag-row-default:hover {
605-
background: #f3f2f8;
606-
}
607-
.tag-row-default:active {
608-
background: #f3f2f8;
609-
}
610-
611611
/* --- Tag Chip Styles --- */
612612
.tag-chip {
613613
padding: 2px 10px;

data/style_dark.css

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
--purple: #ab47bc; /* saturated purple */
1414
--pink: #ec407a; /* lively pink */
1515
--brown: #a1887f; /* muted brown for dark mode */
16+
--default: #333238;
1617

1718
/* Dark surfaces & text */
1819
--app-bg: #121315;
@@ -178,6 +179,16 @@ window,
178179
}
179180

180181
/* --- Tag Row Color Classes --- */
182+
.tag-row-default:selected {
183+
background: alpha(var(--default), 0.2);
184+
}
185+
.tag-row-default:hover {
186+
background: alpha(var(--default), 0.14);
187+
}
188+
.tag-row-default:active {
189+
background: alpha(var(--default), 0.16);
190+
}
191+
181192
.tag-row-red:selected {
182193
background: alpha(var(--red), 0.15);
183194
}
@@ -297,14 +308,3 @@ window,
297308
.tag-row-brown:active {
298309
background: alpha(var(--brown), 0.14);
299310
}
300-
301-
/* Default fallback */
302-
.tag-row-default:selected {
303-
background: alpha(var(--text-secondary), 0.15);
304-
}
305-
.tag-row-default:hover {
306-
background: alpha(var(--text-secondary), 0.08);
307-
}
308-
.tag-row-default:active {
309-
background: alpha(var(--text-secondary), 0.14);
310-
}

src/Application.vala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ namespace Notejot {
8484

8585
// React to dark-mode changes
8686
this.app_css_provider = new Gtk.CssProvider ();
87+
Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), app_css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
88+
load_theme_css ();
8789
var gsettings = Gtk.Settings.get_default ();
8890
if (gsettings != null) {
8991
gsettings.notify["gtk-application-prefer-dark-theme"].connect (() => {

0 commit comments

Comments
 (0)