-
Notifications
You must be signed in to change notification settings - Fork 61
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
docs: add pages about Atomic CSS, build time optimisations #217
Conversation
📊 Bundle size reportUnchanged fixtures
|
@@ -0,0 +1,13 @@ | |||
diff --git a/lib/Mermaid.mjs b/lib/Mermaid.mjs |
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.
f49dbca
to
3487bdf
Compare
# Child Window/Shadow DOM Rendering | ||
|
||
When rendering in the main browser window, many components will need access to window or document to apply styles, listening for events, or measuring things. However it is possible to render to child windows and elements hosted in iframes. | ||
# Child Window |
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 removed "Shadow DOM" there to fit a single line in the sidebar
f06c97e
to
d12f95d
Compare
d12f95d
to
8de3420
Compare
apps/website/docs/react/ahead-of-time-compilation/introduction.md
Outdated
Show resolved
Hide resolved
apps/website/docs/react/ahead-of-time-compilation/technical-details.md
Outdated
Show resolved
Hide resolved
apps/website/docs/react/ahead-of-time-compilation/with-webpack.md
Outdated
Show resolved
Hide resolved
} | ||
``` | ||
|
||
- Use local CSS variables for nested/pseudo selectors. Prefer to use inline styles, but they can't be used for pseudo selector, for example. |
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.
why recommend inline styles over local css variables ?
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.
IMO it's redundant for one offs as it requires additional work without obvious benefits: you still need to pass a CSS variable via inline styles.
makeStyles({
color: { color: 'var(--color)', }
})
<div style={{ '--color': props.color }} />
// vs.
<div style={{ color: props.color }} />
@@ -4,6 +4,52 @@ sidebar_position: 2 | |||
|
|||
# Limitations | |||
|
|||
## Runtime styles | |||
|
|||
Styles can't be created at runtime which includes dynamic selectors as well. |
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.
This section is missing a part on conditional styles
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.
Did not get it, can you please clarify?
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.
a scenario like a size
prop where you can enumerate the possible options. Then it's simply a case of applying the correct class
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.
Got it, will push updates 👍
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.
Co-authored-by: ling1726 <[email protected]>
Co-authored-by: ling1726 <[email protected]>
Requires #215, #216.