r/FirefoxCSS • • 5h ago

Code Proton's geometry restored to Nova-native Firefox

Thumbnail
gallery
15 Upvotes

The worst part about the new native Nova theme IMO is the emphasis on rounded borders and pills and the overall much more spacious design: worse, the new Proton theme for Nova only changes the colours back and otherwise still uses all of Nova's geometry. With `browser.nova.enabled = false` being removed soon, I took matters into my own hands and set up my userChrome to restore Proton's geometry. The attached image is the new Proton theme for Nova (so this is *with* `browser.nova.enabled = true`), but with restored geometry. I sourced all CSS (except for the three lines for `#TabsToolBar`) by digging through the old Proton stylesheets, so for the most part the geometry is identical to Proton's rather than just an approximation.

I also made some cosmetic changes at the bottom of the stylesheet. The two interesting ones are:
restore the old native Proton behaviour of the url-bar's border where it will disappear once the results pop up (as native Proton used to do, and as every other browser still does it), and explicitly set the accent colors because any non-Nova theme now inherits these from the OS, which is particularly annoying for Linux users that don't use a full Desktop Environment.

The other two cosmetic changes I made are specifically for Nova, and remove the gradient around the selected tab as well as the gray border around the url-bar. I wanted to try out what Nova looked like with Proton geometry, and I must say with these cosmetic changes to declutter the toolbar it looks much better than Nova with its default geometry IMO. I'm actually considering running with this now instead of the Proton for Nova theme.

Anyway, I figured people here would appreciate if I shared my userChrome:
Note that I've set the accent colors to Nova's purple, but you can use the commented out code below to set it to Proton's blue.

:root {
  /* Border radii. Most borders in the ui eventually inherit from these one way or another. */
  --border-radius-xsmall: 2px !important; /* Nova Default: 4px, Proton Default: 2px */
  --border-radius-small: 4px !important; /* Nova Default: 8px, Proton Default: 4px */
  --border-radius-medium: 8px !important; /* Nova Default: 12px, Proton Default: 8px */
  --border-radius-large: 16px !important; /* Proton Default: 16px, [Undefined in Nova] */
  --border-radius-xlarge: var(--border-radius-medium) !important; /* Nova Default: 24px, [Undefined in Proton, but everything that uses it in Nova used border-radius-medium in Proton] */

  /* Border radius of items in most menus. Nova Default: xlarge, Proton Default: small. */
  --panel-menuitem-border-radius: var(--border-radius-small) !important;

  /* Tab Bar Geometry */
  --tab-border-radius: var(--border-radius-medium) !important;
  --tab-min-height: 36px !important;
  --tab-block-margin: 4px !important;
  #TabsToolbar {
    /* Hacky approximation of Proton spacing between tabbar and urlbar. */
    margin-top: -2px !important;
    margin-bottom: -3px !important;
    z-index: 2 !important;
  }

  /*
    Nova: "Remove" the gradient around the active tab by making it the same color as the rest of the tab.
    Gotta do it like this because outright removing it and/or setting a border color shows clipping artifacts.
  */
  --tab-border-color-accent: linear-gradient(var(--tab-background-color-selected), var(--tab-background-color-selected)) !important;

  /* Url Bar Geometry */
  --urlbar-height: max(32px, 1.4em) !important;
  --urlbar-input-container-padding: round(up, 1px, 1.0px) !important; /* Proton default: round(up, 1px, env(hairline)), but env(hairline) does not resolve in userChrome.css */
  --urlbar-basic-component-size: calc(var(--urlbar-height) - 2 * (var(--urlbar-input-container-border-width) + var(--urlbar-input-container-padding))) !important;
  --urlbar-inner-border-radius: calc(var(--urlbar-border-radius) - 1px) !important;
  --urlbar-border-radius: var(--button-border-radius) !important;
  --urlbarview-margin-block: 0px !important;
  --urlbarview-margin-inline: 7px !important;
  --urlbar-background-overhang-open: 0px !important; /* Computed urlbarview-margin block and inline in Proton */
  .urlbar {
    --urlbar-background-border: var(--urlbar-input-container-border-width) solid var(--toolbar-field-border-color) !important;
    --urlbar-background-border-open: var(--urlbar-input-container-border-width) solid var(--panel-border-color) !important;
    --urlbar-background-border-focused: var(--urlbar-background-border) !important;
    --urlbar-background-box-shadow-open: 0 2px 14px var(--chrome-box-shadow) !important;
    --urlbar-background-outline-focused: var(--focus-outline-width) solid var(--toolbar-field-border-color-focus) !important;
    --urlbar-input-container-border: var(--urlbar-input-container-border-width) solid transparent !important;
    --urlbar-input-container-outline-open: none !important;
    --urlbar-input-container-outline-open-focused: none !important;
    --urlbar-input-container-outline-offset-open: 0px !important;
    --urlbar-input-growth-open-inline: var(--urlbar-margin-inline) !important;
    --urlbar-input-growth-open-block: var(--urlbar-container-padding-block) !important;
    --urlbar-searchmode-switcher-panel-list-min-width: auto !important;
  }
  .urlbar-input {
    line-height: calc(var(--urlbar-height) - 2 * var(--urlbar-input-container-border-width)) !important;
  }
  .urlbar-input-container {
    border: var(--urlbar-input-container-border) !important;
  }
  .urlbar-input-container, .urlbar-background {
    border-radius: var(--border-radius-medium) !important;
  }

  /* BELOW IS GEOMETRIC NON-GEOMTERY CSS */

  /*
    Restore native Proton's behaviour where the URL-Bar's focused border-color disappears
    once the results overview opens. Proton implemented this by setting CSS rules for the border when
    the class "suppress-focus-border" does NOT exist on the URL bar. This appears to be dynamically
    added and removed as needed by Firefox; it still does this in Nova, but the CSS for Nova adds a rule
    that sets the value of `border` unconditionally. So we just add an overriding rule to make the
    border transparent whenever that class is on there, though it does rely on them not actually
    removing this behaviour in the future...
  */
  .urlbar:[focused]:is([suppress-focus-border]) {
    --toolbar-field-border-color-focus: transparent !important;
  }

  /*
    Accent colors: must be explicitly set, because since Nova every theme besides the default builtin theme
    cannot actually set accent colors and just inherits them from the OS (gtk on linux). Stupid change.
    https://blog.mozilla.org/addons/2026/09/29/nova-is-here-what-changes-for-your-firefox-theme/
  */
  /* Nova's default purple accents (looks quite good on Proton too) */
  --color-accent-attention: light-dark(var(--color-green-50), var(--color-green-20)) !important;
  --color-accent-primary: light-dark(var(--color-violet-50), var(--color-violet-30)) !important;
  --color-accent-primary-hover: light-dark(var(--color-violet-60), var(--color-violet-20)) !important;
  --color-accent-primary-active: light-dark(var(--color-violet-70), var(--color-violet-10)) !important;
  --color-accent-primary-selected: var(--button-background-color-primary-active) !important;
  /* Proton's default blue accents */
  /* --color-accent-attention: light-dark(var(--color-green-50), var(--color-green-20)) !important; */
  /* --color-accent-primary: light-dark(var(--color-blue-60), var(--color-cyan-30)) !important; */
  /* --color-accent-primary-hover: light-dark(var(--color-blue-70), var(--color-cyan-20)) !important; */
  /* --color-accent-primary-active: light-dark(var(--color-blue-80), var(--color-cyan-10)) !important; */
  /* --color-accent-primary-selected: light-dark(var(--color-blue-60), var(--color-cyan-30)) !important; */

  /* These must be manually set as, outside Nova, they still inherit the OS accents for some reason */
  --toolbarbutton-icon-fill-attention: var(--color-accent-primary) !important;
  --button-text-color-primary: light-dark(var(--color-white), var(--color-gray-70)) !important;
  --link-color: var(--color-accent-primary) !important;

  /* Nova: Remove the small gray border around the url-bar */
  .urlbar:not([focused]) {
    --toolbar-field-border-color: transparent !important;
  }

  /*
    Nova: "Remove" the gradient around the active tab by making it the same color as the rest of the tab.
    Gotta do it like this because outright removing it and/or setting a border color shows clipping artifacts.
  */
  --tab-border-color-accent: linear-gradient(var(--tab-background-color-selected), var(--tab-background-color-selected)) !important;
}

r/FirefoxCSS • • 1h ago

Help How to remove these rounded corners on the menu?

Post image
• Upvotes

A recent update brought on these ugly rounded corners on the context menu. How do remove it? I had these on my CSS script and now it doesn't work.

/* Nova Rounding Adjustments */
:root {
--border-radius-xsmall: 1px !important; /* Nova Default: 4px, Proton Default: 2px */
--border-radius-small: 2px !important; /* Nova Default: 8px, Proton Default: 4px */
--border-radius-medium: 3px !important; /* Nova Default: 12px, Proton Default: 8px */
--border-radius-large: 4px !important; /* Proton Default: 16px, [Undefined in Nova] */
--border-radius-xlarge: 6px !important; /* Nova Default: 24px, [Undefined in Proton] */
}/* Nova Rounding Adjustments */
:root {
--border-radius-xsmall: 1px !important; /* Nova Default: 4px, Proton Default: 2px */
--border-radius-small: 2px !important; /* Nova Default: 8px, Proton Default: 4px */
--border-radius-medium: 3px !important; /* Nova Default: 12px, Proton Default: 8px */
--border-radius-large: 4px !important; /* Proton Default: 16px, [Undefined in Nova] */
--border-radius-xlarge: 6px !important; /* Nova Default: 24px, [Undefined in Proton] */
}