decaporg / gatsby-starter-decap-cms

Example Gatsby + Decap CMS project
https://gatsby-netlify-cms.netlify.app/
MIT License
2.07k stars 982 forks source link

Refactoring sass styles to avoid confusion with purgecss. #906

Closed tarehart closed 1 year ago

tarehart commented 1 year ago

Motivation While working on a site forked from gatsby-starter-decap-cms, I got very confused about why my styles weren't being applied. It turns out I was falling victim to known risks described at https://www.gatsbyjs.com/plugins/gatsby-plugin-purgecss/

NOTE: This is NOT an install and forget type plugin. By default, it may remove required styles too.

This change aims to protect others from the same pitfall by setting up a custom-styles.sass file that won't get processed by Purgecss. I also added some code comments that I would have found useful when first reading the sass files.

I chose a three-file sass setup because:

Testing

What kind of change does this PR introduce?

Does this PR introduce a breaking change? No breaking changes.

What needs to be documented once your changes are merged? No documentation changes needed.

martinjagodic commented 1 year ago

Good work @tarehart

tarehart commented 1 year ago

Thanks, I appreciate the quick review!