-
Notifications
You must be signed in to change notification settings - Fork 538
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
Colocate Primer CSS global injections with components that need them #285
Conversation
This pull request is automatically deployed with Now. |
import sass from 'sass.macro' | ||
import {injectGlobal} from 'emotion' | ||
|
||
injectGlobal(sass` |
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.
Even though we're not using any actual Sass features here, processing it with Sass allows us to minify it with outputStyle: 'compressed'
.
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.
Looks good!
This is a follow-up to #276 that breaks up our global CSS injections so that we can more easily remove them as we port components over to Emotion. Here's why I think we should do this:
I clicked through all of the component docs to make sure that I didn't break anything, and fleshed out a couple of documentation bits and examples while I was in there.
Details changes
The Details component is kind of a weird case because the
details-reset
CSS lives in theprimer-buttons
module. Rather than double up Sass imports or inject them globally, I opted to make astyled('details')
with thedetails-reset
styles and use that in the Details component. The Details docs also now mention that you have bring your own<summary>
(or<Button is="summary">
), and make it clearer that if you use thechildren
function orrender
prop you have to implement thetoggle
function yourself.Merge checklist