Scan files with .css extension
See original GitHub issueLove this package, thanks so much! This is a different question from #67 (I am sending my css through postCSS, and I’m trying to not purge certain classes).
Maybe I’m missing something, but is there a way to scan for classes defined in my own .css
files? Very minimal reproduction of my setup:
// webpack.mix.js
mix.postCss('resources/css/app.css', 'public/css', [
require('postcss-import'),
require('tailwindcss'),
])
if (mix.inProduction()) {
mix.purgeCss({
extensions: ['html', 'js', 'php', 'vue', 'css']
})
}
/* resources/css/app.css */
@import 'custom';
/* resources/css/custom.css */
.special-snowflake-class {
@apply .block .bg-blue-500;
height: 42px;
}
I would have thought that because I listed css
in the extensions to scan, any of my own classes in my css files would be included, that’s not happening. I need .special-snowflake-class
included in my build even if it doesn’t appear anywhere else in my project besides where it’s defined in custom.css
. Is that possible?
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
CSS Scan - The fastest and easiest way to check, copy and ...
The smartest browser extension for CSS inspection. No unuseful, duplicated, overridden, or longhand CSS. CSS Scan runs hundreds of real-time advanced ...
Read more >CSS Scan
The fastest and easiest way to check, copy and edit CSS. This extension is paid and requires a license to use it. You...
Read more >CSS Scan Pro
A re-imagined Devtools for web design · Built to work on any website · Powerful, accurate and lightspeed CSS inspection · See an...
Read more >Use CSS Scan To Easily Find All CSS For Any Element On ...
CSS Scan is a powerful browser extension that will help you uncover the CSS needed for any CSS styling on any website. You'll...
Read more >6 Awesome CSS Extensions for VS Code - DigitalOcean
Supports Zen Coding completion for class and id attributes. Scans workspace folder for css and scss files. Supports remote css files.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Iirc mix.styles only concatenates css files, it doesn’t do any processing. You’ll need to use mix.postCss instead.
@bakerkretzmar Surprisingly painless and disappointed I didn’t figure that out myself. Thanks for pointing me in the right direction. In case anyone else lands here, Baker has the right approach from his comment: