- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi everyone, my question is : someone add their css reset as part of the critical css, referring to the css that should be inline in the html and non produces a block in the render.
Thanks in advance…
Not sure exactly what you are asking. However, I put all of my css resets in my main style sheet. I do not use inline styling. It would only appear when a contributor to the site adds inline HTML with styling.
@ztgst are you using this Grunt plugin, criticalCSS?
Not yet, actually I’m evaluating options about it, I testing whit this script (https://gist.github.com/scottjehl/b6129da04733e4e0f9a4), per example for me maybe the styles for layout are more important than the result, so for that is my question, if the reset css should be part of the critical CSS, I don’t know if I explain well
I Actually linked to the wrong repo, it’s this one for grunt-criticalcss.
Thinking about adding custom styles to this, maybe have a custom criticalcss-custom.css
as well, for the things you want in there, but are omitted by criticalcss. No harm in keeping those separated I suppose.
“`html
<style><?php include(‘/path/to//criticalcss.css’);?></style>
<style><?php include(‘/path/to//criticalcss-custom.css”);?></style>
</code></pre>
You shouldn’t need a reset in there, to keep it lightweight *{margin:0;padding:0}
will do. But you just will have to try this out for yourself, and see what kind of CSS the plugin actually generates.
Yeah! thanks @Atelierbram, maybe I should testing more and deal this on diferent way, because the criticalCSS is all styles you need for paint on the first render, but What happen if you need repaint when you load your .css file?.
I will share my results after, maybe this can help someone.