-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: implement adoptedStyleSheets + optional native CSS nesting #420
Conversation
|
✅ Deploy Preview for outlinejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a lot of this is great.
We need to, however, consider the browser impact of the Native CSS nesting. It limits us to more browsers than adoptedStylesheet
does presently. In 6 months, maybe a year, I think we'll be there. Based on several discussions around the browser support and our ongoing requirements, it's not a safe time to implement native nesting. We still have (and will for some time) have postcss
in our toolchain.
If we could:
- Remove CSS Nesting
- Evaluate
addPrefixToCurlyGroups
when we aren't using native nesting - Focus on the functionality of
addSlotStyles
This controller should primarily be responsible for:
- Attaching a previously processed CSS file to
adoptedStylesheet
- Optionally wrapping the CSS file in a configurable selector. (Random ID, Class, Component, etc.)
Important Auto Review SkippedDraft detected. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Closing in favor of the slim @phase2/outline-adopted-stylesheets-controller controller |
Description
This PR simplifies how we add slot styles from within the component.
Style Manager controller does the following:
Reads the CSS (that alternatively could be loaded globally by the consumer)
Only if
generateRandomId === true
-:host
and:root
Uses
adoptedStylesheets
to modify the document's CSS (instead adding CSS into the DOM)