Skip Navigation

User banner
[dormant] Firefox CSS

Members
0
Posts
37
Created
3 yr. ago

Pushing the limits of the Firefox Browser through the use of CSS.

#join #firefoxcss:mozilla.org

Post your Firefox UI customizations here!

What is userChrome.css?

Rules (enforced)

  1. Posts must have flair!
  2. Follow Lemmy.World rules
  3. Posts cannot be memes/shitposts. They should be about Firefox customization with CSS.
  4. Please be civil. Bear in mind that many users come here for help and would be turned off by insults and rudeness.
  5. When posting large amount of code use a service dedicated to hosting text snippets, such as pastebin, hastebin, github gist or equivalent. Relatively short snippets can be wrapped in code-block for inline viewing.
  6. Do NOT use url-shorteners or link to compressed downloads (such as zip or rar) when sharing code.

Guidelines (not enforced)

Consider adding the following info to hel…

🌉 bridged from !firefoxcss@lemmy.world by Tidepoo

New URL bar issue after updating ESR. My fault?

EDIT: Fixed the dropdown by nuking line 15, still trying to solve the selection highlighting turning green again My userChrome:

 
menupopup:not(.in-menulist) > menuitem, 
menupopup:not(.in-menulist) > menu {
  padding-block: 0px !important; /* reduce to 3px, 2px, 1px or 0px as needed */ 
  min-height: unset !important; /* v92.0 - for padding below 4px */
}
:root {
  --arrowpanel-menuitem-padding: 0px 0px !important;
}

/* Make urlbar appear more compact */
#urlbar[breakout]{
  margin-inline-start: 0px !important;
  width: 100% !important;
  left: 0 !important;
  top: calc((var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2) !important;
}
#urlbar[breakout]:not([open]){ bottom: calc((var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2) !important; }
.urlbarView{ margin-inline: 0 !important; width: auto !important; }
.urlbarView-row{ padding: 0 2px !important; }
.urlbarView-row-inner{ padding-inline-start: 4px !important; }
#urlbar-background{ animation: none !important; }
#urlbar-input-container{ padding: 1px !important; height: 100% !important; }
#identity-icon{ margin-block: var(--urlbar-icon-padding) }
.urlbarView > .search-one-offs:not([hidden]){ padding-block: 0px !important; }


#nav-bar:-moz-lwtheme #urlbar ::-moz-selection,
#nav-bar:not(:-moz-lwtheme) #urlbar ::-moz-selection {
        background-color: #3040cf !important; /*it's green again; want to fix this too*/
    color: white !important;
}

/* Set blank page background-color */
/* Uses color from theme_colors if available */

#tabbrowser-tabpanels{
  background-color: var(--uc-light-bkgnd-color,rgb(0,0,0)) !important;
}

How hard is it for you to use Firefox's browser toolbox / dev tools? Do you ever feel like you're fighting it?

Personally I'm pretty frustrated with the way it works. I've noticed all of the following , and at least some of these apply to dev tools too. I don't like the way Google controls the internet with Chrome, but at least its dev tools just work. • Sometimes when I try to use the element picker tool it actually clicks the element instead of selecting it in the toolbox • I can't change selectors in CSS files in the sidebar, I have to go the style editor (Chrome lets me do this) • I can't easily copy HTML attributes, if I double click on an attribute, the text is selected but when I press CMD C, it copies the entire tag with all of its attributes. • A lot of the time CSS properties I write just don't apply and isn't crossed out. Its like it just has a hard time doing that.

Has anyone figured out how to have vertical native tabs, with no 3rd party addons like Tree Style Tabs?

Theoretically it should be possible to make child elements flow vertically instead of horizontally, by setting these properties on the parent: display: flex; flex-direction: column;. I tried that with a bunch of the tab elements and it didn't work. The problem with addons like TST is that they glitch out sometimes, and you have to wait for the tabs to load, it takes much longer on my M1 Mac once I have 100s of tabs open (don't judge me).

Firefox customization community on Fedia

Hi! Just FYI folks, the plan going forward would be to build this community on Fedia instead: Right here https://fedia.io/m/FirefoxCSS Thanks to federation, you can also participate in the community through lemmy if you want - though some features such as microblog or sidebar info won't be accessible via lemmy - for now at least. The link to access the community via lemmy world would be https://lemmy.world/c/FirefoxCSS@fedia.io See ya there!

How to make the accent on selected tab blue?

So I applied an updated version of Firefox-UI-fix for Firefox 120, and now my accent on selected tabs is gone. For context, this is what it looks like now - image The image below is in private window mode, because for some reason it works over there. Focus on the line above the selected tab, with a blue accent line. This is how I want it to be - image Here are my chrome and user.js folders.

Is it difficult to write or figure out good CSS? Is it normal to revisit your CSS and find lots of ways to improve it?

This is actually unrelated to the CSS lagging on my device, I also write CSS for Firefox's UI. It's not meant for 3rd party customization and the ability for customization is behind a configuration flag. With that in mind, Firefox's CSS just feels very dirty, like its very tricky to figure out how to best change this or that element because of how many moving parts there are between state changes (like :hover) and how variables interoperate. And in some places to make a single change you have to change multiple variables, like if you want to change the height of the URL bar row. I've spent many hours on the CSS, and each time I revisit it, I find that I could've wrote this or that better, and I looked for variables that the UI uses, and wonder why I didn't find them the first time. I've been writing CSS on and off for 8 years now, I wonder if I'm just bad it since I've never done web dev full time, or it's actually a lot of work to write good CSS.

Fx 113

PSA - Changes to default element display-model

Let's have this post here also... As a part of the front-end technical modernization the old xul box model is being replaced with modern flexbox all around the UI. Relevant bug 1820534 Previously, just about everything used display: -moz-box but in Firefox 113 the default display model was changed to modern display: flex instead. What this means first-hand is that all legacy box model -related properties will not do anything anymore so things like -moz-box-ordinal-group, -moz-box-orient, -moz-box-direction, -moz-box-align, -moz-box-pack or -moz-box-flex won't have any effect. The suggested way to deal with this is to just update your styles to use equivalent flexbox properties. Additionally, the old display: -moz-box is treated as invalid property value Some examples of conversions: • display: -moz-box -> display: flex • -moz-box-ordinal-group: 0 -> order: -1 • -moz-box-orient: vertical -> flex-direction: column • -moz-box-direction: reverse -> flex-direction: row-reverse • -moz-box-align: center -> align-content: center or align-items: center depending on what you are doing. • -moz-box-pack: start -> justify-content: flex-start or justify-items: flex-start • -moz-box-flex: 10 -> flex-grow: 10 Notes about order vs. -moz-box-ordinal-group: order supports negative values, whereas ordinal-group does not. Default value of order is 0 but default of ordinal-group is 1 so you might need to change what value to apply for it to have any effect. Also, see this firefox-dev post for more information.