-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add html and body to PurgeCSS whitelist #2435
Conversation
Purgecss removes styling for html and body which will have an impact of normalise/resets, add both to whitelist. FullHuman/purgecss-webpack-plugin#69)
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.
Thanks @darrenjacoby. This is a good change. Can you please rebase this or resolve the merge conflicts?
This is still removing some block styles for me. I'm not sure how to usefully show that. |
I think it's just that .purgeCss({
extend: {
content: [path.join(__dirname, 'index.php')],
},
}) |
I'm kind of torn on this whole situation right now. The reason the styles aren't being purged is because I extracted a majority of Generally, I am unhappy at the idea of not using Blade for everything. Moving everything to Personally, I go out of my way on my own projects to revert the change and put everything back into While the approach used in Sage 9 isn't the prettiest – it is still an option to just do the same in Sage 10 (behind the scenes in Acorn). The only thing I'm unsure of is if/is there is any noteworthy technical debt of the Sage 9 approach. Otherwise.... it works. |
I just encountered this very issue. Lots of styles were missing when I ran the production build - it was not finding header styles etc. Easily fixed by extending the purgeCss as described by @oxyc but it might be good to extend out to include |
All of |
@Log1x Thanks for the pointer. I'm not 100% sure I understand what you mean - ie. if this is already supposed to be present in Sage 10. The Sage 10 |
The rules are bundled into |
OK thanks. I just can't get it to work well - loads of styles missing even after adding the |
You might have to make a few whitelist rules depending on your application and where styles are rendered (e.g. plugin styles would need their own pattern whitelisted, etc.) There is the option of whitelisting in the CSS directly https://purgecss.com/whitelisting.html#in-the-css-directly Otherwise, as far as |
Thanks again for the pointers - I will dig into this tomorrow. Certain things just won’t work - for example a custom icon font. But I’m sure I’ll be able to figure it out thanks to your guide in the right direction. |
@Log1x tl;dr There is no inherent issue with Sage 10 here, and the purgeCss rules are fine. Thanks again for your pointers. I am using Roots Soil, which changes the name of all menu item classes to
I do think that the unexpected nature of styles missing for the first time on That said, it works incredibly well and I love it. My CSS file is 10k despite a full import of Bootstrap in the SCSS (I used to have to break out the |
Glad you got it working!
I agree. Once the documentation is written, I'm hoping we will be able to make any "gotchas" like that very clear from the beginning. |
Sorry for the bump – as far as the menu styles go, check out https://github.com/log1x/navi – it will save your sanity & solve the need to whitelist the menu rules by having the markup in a view. Check my repos for a lot of other Sage 10 goodies. |
No need for apologise, always glad to get more info - I'll look at your repos for goodies. PS: Do you never sleep? ;) PPS: I'm actually sitting with my jaw on the floor - |
Purgecss removes styling for html and body which will have an impact of normalise/resets, add both to whitelist. FullHuman/purgecss-webpack-plugin#69