Comments (2)
PurgeCss matches words in the source files to get the selectors before any execution, therefore it cannot match variables to the actual classes.
Unfortunately I don't see any simple way to make it work without whitelisting the classes.
Instead of using whitelist
, you could add the classes in the comments in the same file and they would be kept.
Maybe you could run purgecss directly by extracting the css from the generated html files.
from gatsby-plugin-purgecss.
hmm that's a pity, it kind of needs to do all classes as the js might change some classes in the future. And whitelisting will be a pain to keep up to date. Guess it won't work for our use case then.
thanks for the quick response!
from gatsby-plugin-purgecss.
Related Issues (20)
- Gatsby 5 Peer Dependency Support? HOT 3
- Remove css classes that are not present in the rendered html file HOT 1
- Support for reactstrap or third party react elements HOT 2
- Using Tailwind with new extensions, like MDX HOT 8
- how to whitelist a Loadable component ? HOT 3
- Remove css classes from a theme HOT 2
- Option to run against rendered html HOT 1
- PurgeCss is not working with tailwindui HOT 12
- Rerun purgecss on changes during development HOT 1
- How to specify custom tailwind config file? HOT 2
- Invalid syntax error HOT 1
- Disable print with the tailwind option HOT 6
- Not understanding how to configure content option. Documentation unclear HOT 2
- Purge specific files is ignoring with build command HOT 1
- className styles are purged if `purge` object is present in tailwind.config.js HOT 1
- TypeScript support HOT 2
- purgeCSSOptions.content override is not working HOT 1
- Dependency Dashboard
- compatibility with Gatsby 4 update? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-purgecss.