Skip to content

Commit

Permalink
Fix broken colours on Firefox 126 beta #143
Browse files Browse the repository at this point in the history
Mozilla seems to have removed `:-moz-lwtheme` in favour of using
`:root[lwtheme]` instead.
  • Loading branch information
bmFtZQ committed Apr 18, 2024
1 parent 2895b47 commit d7cce43
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions chrome/global/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* https://github.com/bmFtZQ/edge-frfox */

/* default colours (light & dark) */
:root:not(:-moz-lwtheme),
:root:not([lwtheme]),
/* `--newtab-background-color-secondary used` to differentiate between a dark
* private window and private window with the 'Dark' theme enabled.
* May not be the most reliable method, but works for now up to FF 123. */
Expand Down Expand Up @@ -122,7 +122,7 @@
}

/* Apply colours to the default 'Auto' theme. */
#navigator-toolbox:not(:-moz-lwtheme) {
:root:not([lwtheme]) #navigator-toolbox {
background-color: var(--lwt-accent-color) !important;
color: var(--lwt-text-color) !important;

Expand All @@ -140,7 +140,7 @@
}

/* Make the titlebar buttons black/white on default themes */
:root:not(:-moz-lwtheme)[tabsintitlebar] .titlebar-buttonbox {
:root:not([lwtheme])[tabsintitlebar] .titlebar-buttonbox {
color: var(--lwt-text-color) !important;
}

Expand Down Expand Up @@ -173,7 +173,7 @@
/* Use accent colour in titlebar when Windows option is enabled. */
@media (-moz-windows-accent-color-in-titlebar) and (-moz-bool-pref: "browser.theme.windows.accent-color-in-tabs.enabled") {
/* Uses :root:root to beat specificity of floating tabs adjustments. */
:root:root:not(:-moz-lwtheme) {
:root:root:not([lwtheme]) {
--lwt-accent-color: ActiveCaption !important;
--lwt-text-color: CaptionText !important;
--lwt-accent-color-inactive: InActiveCaption !important;
Expand Down Expand Up @@ -276,7 +276,7 @@

/* Linux / GTK csd support */
@media (-moz-gtk-csd-available) {
:root:not(:-moz-lwtheme),
:root:not([lwtheme]),
/* `--newtab-background-color-secondary used` to differentiate between a dark
* private window and private window with the 'Dark' theme enabled.
* May not be the most reliable method, but works for now up to FF 123. */
Expand Down
6 changes: 3 additions & 3 deletions chrome/global/tweaks.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/* force tabs to toolbar bg (useful for proton themes) (might experience some
bugs with certain themes eg. dark text on dark background.) */
@media (-moz-bool-pref: "uc.tweak.force-tab-colour") {
:root:-moz-lwtheme {
:root[lwtheme] {
--tab-selected-bgcolor: var(--toolbar-bgcolor) !important;
--tab-selected-textcolor: var(--toolbar-color) !important;
}
Expand All @@ -27,7 +27,7 @@ bugs with certain themes eg. dark text on dark background.) */
}

@media (-moz-bool-pref: "uc.tweak.floating-tabs") {
:root:not(:-moz-lwtheme),
:root:not([lwtheme]),
/* `--newtab-background-color-secondary used` to differentiate between a dark
* private window and private window with the 'Dark' theme enabled.
* May not be the most reliable method, but works for now up to FF 123. */
Expand All @@ -54,7 +54,7 @@ bugs with certain themes eg. dark text on dark background.) */
}

@media (-moz-gtk-csd-available) {
:root:not(:-moz-lwtheme) {
:root:not([lwtheme]) {
--toolbar-bgcolor: color-mix(in srgb, -moz-dialog 80%, #fff) !important;
--toolbar-field-background-color: Field !important;
--lwt-tab-text: -moz-dialogtext !important;
Expand Down
2 changes: 1 addition & 1 deletion chrome/toolbar/findbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
background-color: var(--toolbar-field-background-color) !important;

/* Add shadow when in light mode with no theme applied, like the URL bar. */
&:not(:-moz-lwtheme) {
:root:not([lwtheme]) & {
box-shadow: 0 0 4px light-dark(rgb(0 0 0 / .1), transparent) !important;
}

Expand Down
6 changes: 3 additions & 3 deletions chrome/toolbar/urlbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
border-radius: calc(var(--urlbar-icon-border-radius) + 2px) !important;

/* Shadow for URL bar, only appears in light mode. */
:root:not(:-moz-lwtheme) #nav-bar:not([brighttext]) & {
:root:not([lwtheme]) #nav-bar:not([brighttext]) & {
box-shadow: var(--uc-urlbar-shadow, none);
}

Expand All @@ -49,7 +49,7 @@
box-shadow: 0 10px 16px rgb(0 0 0 / 0.18), 0 3px 5px rgb(0 0 0 / 0.33) !important;
outline: 0.5px solid var(--arrowpanel-border-color) !important;

&:not(:-moz-lwtheme) {
:root:not([lwtheme]) & {
outline-color: var(--panel-separator-color) !important;
}
}
Expand Down Expand Up @@ -128,7 +128,7 @@

/* Search engine indicator. */
#urlbar-search-mode-indicator {
:root:not(:-moz-lwtheme) & {
:root:not([lwtheme]) & {
background-color: var(--urlbar-box-hover-bgcolor) !important;
}

Expand Down

0 comments on commit d7cce43

Please sign in to comment.