Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on browser_style: true #4

Open
tdulcet opened this issue Sep 27, 2023 · 4 comments
Open

Remove dependency on browser_style: true #4

tdulcet opened this issue Sep 27, 2023 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tdulcet
Copy link

tdulcet commented Sep 27, 2023

As of Firefox 118, support for browser_style: true was removed from Manifest V3. This library should include any CSS needed to follow the Firefox/Thunderbird Photon design locally. See the migration guide on MDN for more information. Also see this comment on BMO for more details on what specific styles were removed and their effect.

This would be needed for TinyWebEx/common#14.

@rugk
Copy link
Member

rugk commented Sep 29, 2023

Yeah AFAIK/IIRC the dependency is not large, it is mostly the style of the controls and IIRC the style of the (reset) button was so flat that I never used it for that.

Actually I also found rugk/offline-qr-code#44 and rugk/offline-qr-code#97 where you can actually see the default stuff I did not want to apply.
So as it is gone now, maybe it is not too bad (though it's sad to see the cool styling of input elements being “lost” or I again need to copy Mozilla source code for that… 🙃

@Croydon
Copy link

Croydon commented Jan 29, 2025

In order to unblock migrations to MV3, I would just add the entire CSS file that browser-style: true injects: https://searchfox.org/mozilla-central/source/browser/components/extensions/extension.css

Any optimization like removing everything unneeded can happen somewhen in the future.

Croydon added a commit to Croydon/tinywebex-CommonCss that referenced this issue Jan 29, 2025
Copied from https://github.com/mozilla/gecko-dev/blob/338230dfeb14c047b55228a21b3e49657f00ae83/browser/components/extensions/extension.css

This is the unmodified CSS file that gets included in Firefox in WebExtension Manifest V2 addons, when they choose to use `browser_style: true`

`browser_style: true` is removed in Manifest V3, therefore addons need a replacement. One quick fix is to include this CSS file locally.

See also TinyWebEx#4
@rugk
Copy link
Member

rugk commented Jan 31, 2025

Hmm a neat idea, though we did not use that much, IIRC. Dunno, what is your opinion, @tdulcet?

@tdulcet
Copy link
Author

tdulcet commented Feb 1, 2025

Yeah, I would vote to just add at most the small subset of global styles from the style sheet, maybe without the user-select:

/* Global */
html,
body {
background: transparent;
box-sizing: border-box;
color: light-dark(#222426, CanvasText);
cursor: default;
display: flex;
flex-direction: column;
font: caption;
margin: 0;
padding: 0;
user-select: none;
}
body * {
box-sizing: border-box;
text-align: start;
}
I do not believe there are any add-ons using this library that depend on the rest. Of course, long term the library will need to be updated to better follow the Firefox/Thunderbird Photon design and unfortunately, this CSS does not seem to help much with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants