-
Notifications
You must be signed in to change notification settings - Fork 8
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
should critical be a the top of head? #39
Comments
🤔 I agree with you. @cometkim what do you think? |
Gatsby merges all loaded styles into In most cases, this is not a problem because linaria is used for scoped style. However, declaring global styles in both ways(linaria and others) can be confusing no matter how we ordered it. |
If we imagine Linaria with other styles like this: import { styled } from 'linaria/react'
import '../styles/reset.css'
styled`
body {
background: purple;
color: white;
}
` or if |
Oh, actually styles already ordered how you expected, because this plugin attaches the same styles in the bottom of . We have another possible problem is: we can get blink of css problem if we use global styles with linaria. for exam: import { css } from 'linaria';
/**
* in other.css
* body { background: red; }
*/
import './other.css';
export const globalStyles = css`
:global() {
body { background: blue }
}
`; The result background color of body tag is RED in first paint, but it instantly changed into BLUE after fetching linaria's full css. |
Fix published in v2.0.0. |
first of all, thanks for creating this plugin, i love it :)
i have a question regarding this bit:
https://github.com/silvenon/gatsby-plugin-linaria/blob/a52b2cb3a2b0e59847ef0fdb291357008e1a325c/src/gatsby-ssr.js#L35-L43
i'm adding a reset by just doing
import 'reset.css'
and having gatsby inject it into the head. the same with some@font-face
s.when using this plugin, the linaria's critical css is inserted before any other css i've added.
this instinctively feels the wrong way round to me – i was wondering what your reason was for choosing this order?
The text was updated successfully, but these errors were encountered: