-
Notifications
You must be signed in to change notification settings - Fork 37
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
Style isolation #923
Style isolation #923
Conversation
this breaks literally all of our styles sorry give me a second
#914 moved modnotes window rendering into a portal to |
81dbe75
to
e573b35
Compare
this is actually working reasonably well?? currently shouldn't be merged because i still need to style a couple more components used in modnotes, but once that looks the same as it did pre-this i think we just merge this and add this to the list of slow ongoing projects that are happening concurrently on master |
jsx handles so much of this shit for us we don't even need to worry about it anymore
holy shit this actually mostly works????!? i thought this would be so much more difficult
This reverts commit 83c496c.
Marking this as ready-to-review now - the modnotes module, the will merge after some more testing and getting out some other small stuff i've been sitting on probably. excited for this to hit the beta channel |
fuck it we ball |
Extremely WIP branch, just putting something up here to get on the board and have something to reference in the release notes of v7.0.0-beta.2
Pulls in
rollup-plugin-postcss
which lets us use CSS modules for our style code. Also modifies our React rendering helper to put all React content in shadow roots which are isolated from page styles. This prevents the page from interacting with Toolbox's UI styles at all, which means we don't have to worry about Naut compatibility of our CSS or working around environment differences between frontends nearly as much. In particular this will make it actually reasonable to get Toolbox running in Shreddit, since its CSS is significantly different than old or new Reddit's.This has the direct impact of preventing subreddit stylesheets on old Reddit from interacting with Toolbox UI, which is good for Naut-related reasons but also kinda sucks because I've seen some people do really neat stuff to our buttons that way. I think it's a trade-off that's necessary for us to make now that we're supporting so many different frontends though.
The other downside of this method is that we basically have to incrementally rewrite all the CSS in the extension as it moves to React and .module.css files. This just means that styles for some common controls which exist in both jQuery-backed and React-backed forms will be duplicated for now, and that I have a lot of effort to put into this before it will be done.