Our great sponsors
PostCSS | purgecss | |
---|---|---|
53 | 37 | |
26,249 | 6,945 | |
0.8% | 1.4% | |
9.3 | 8.9 | |
6 days ago | 7 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PostCSS
-
PurgeCSS & styled-components: Does It Work?
The second of those two reasons is very disappointing, as PostCSS is a rich ecosystem of plugins to extend your CSS' functionality and build process. PostCSS is what Babel is for JavaScript, and unfortunately styled-components is missing out on an entire suite of new functionality.
- Error: PostCSS plugin tailwindcss requires PostCSS 8
-
How to Build a Fullstack Next.js Application (with Storybook & TailwindCSS)
postcss and autoprefixer are tools for transforming CSS that Tailwind uses to do its job.
- postcss 7.0.0 - 8.2.9 Severity: moderate Regular Expression Denial of Service
-
tailwind: no simple way to get started
PostCSS is a whole other package. Tailwind can integrate with PostCSS.
Same goes for PostCSS, which I also mentioned. If you don't know what that is, please do take the time to find out. I suggested that you may want to avoid it for the time being while you're still learning, though.
-
Supercharge your CSS with Tailwind
With the pre-processors, you can shrink your CSS and increase reuse through variables. In almost all working cases, it will be an improvement above vanilla CSS. There are also implementations now, via PostCSS, that add vendor prefixes for you. The major drawback is, of course, that you have to compile your CSS beforehand; usually done via part of your tooling such as Grunt or Gulp.
-
Engineering Design Systems In 2022
Making your library as modular as possible will aid with the adoption of it. A team should be able to pick and choose which parts they need of your system to keep their application as performant as possible. There are numerous tools you can use to aid with this process such as Sass, PostCSS and TailwindCSS.
-
Some front-end web technologies you should be aware of as a newcomer 🧐
PostCSS
- Why isn't tailwind v3 working with React?
purgecss
-
PurgeCSS & styled-components: Does It Work?
{ resolve: `gatsby-plugin-purgecss`, options: { // set this to true for debugging purposes; see what was removed printRejected: false, // ignore the antd styles you want to completely keep ignore: [ 'node_modules/antd/lib/select', 'node_modules/antd/lib/checkbox', ], purgeCSSOptions: { content: [ path.join(process.cwd(), 'src/**/!(*.d).{ts,js,jsx,tsx}'), // antd doesn't mesh well w purgecss, so keep the files we use // by listing them as content files. // reference: https://purgecss.com/ant_design.html path.join( process.cwd(), 'node_modules/antd/lib/{tooltip,modal,radio}/**/*.{css,less}' ), // utility styles from ant, let's keep it path.join( process.cwd(), 'node_modules/antd/lib/style/**/*.{css,less}' ), ], extractors: [ { // on top of listing antd files as content, we need an extractor to work // with css/less to get the selectors extractor: (content) => content.match(/([[email protected]&:{}]+)(?= {)/g) || [], extensions: ['css', 'less'], }, ], }, }, }
Wait, we still have that selector with .child... what's going on here? As it turns out, PurgeCSS doesn't handle descendant selectors/combinators like these well, just like styled-components. If we go back to the quick note on PurgeCSS' comparison logic, this actually makes sense. PurgeCSS isn't yet smart enough to build up nested selectors; so even though the HTML does represent .parent .child in this case, the list of selectors are only the smallest possible, e.g.
-
Bootstrap 5 framework?
Yeah, what /u/zaibuf didn't mention is that in addition to only including the modules you want, you have to use something like https://purgecss.com/ in your build, which will parse your HTML (or Blade, or Twig) files looking for classes, and remove all the CSS classes that are not used.
-
Purge unused CSS on a Flask app
So I have this flask app where I currently use flask-assets to create a few Bundles for my JS and CSS. I use bootstrap, I end up with a lot of unused CSS on my minimised bundle. I have been searching for a while and I don't see a way to use the famous purgecss with flask-assets. I was thinking on maybe switch my bundler to something node.js based like webpack, but almost have no experience with JS. Also, flask-assets hasn't been updated in two years. So maybe is time for a change.
-
PurgeCSS: Remove unused CSS code
PurgeCSS is very easy to get started with and includes thorough documentation. At the time of writing, PurgeCSS is loved by developers with 1.9m weekly downloads on npm and 6.5k GitHub stars.
Removing unnecessary code will make your website load faster because the browser will request and parse less code. In this tutorial, we’ll explore PurgeCSS, a tool for removing unused CSS code. With PurgeCSS as a part of our development workflow, we can easily remove unused CSS, resulting in smaller CSS files and improving our application overall. Let's get started!
-
Vanta.js - Animated website backgrounds in a few lines of code
I meant including three, similar to https://purgecss.com/ but for js libraries
-
I said "we can make everything with css" in class
Though, you can use another dependency to purge your css. eg purgecss
-
Website optimization for SEO
Need to optimized a website for SEO. I was looking at purgecss.com (purgecss.com/configuration.html#configuration-file) but that appears to using NPM.
-
Facing difficulty while Fixing the issues of Reducing unused CSS [Help Me]
You could try using PurgeCSS
What are some alternatives?
styled-components - Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
esbuild - An extremely fast JavaScript and CSS bundler and minifier
emotion - 👩🎤 CSS-in-JS library designed for high performance style composition
vue-vite-starter-template - A single page app Vite starter template, created to easily bootstrap Vue.js 2 apps
cssnano - A modular minifier, built on top of the PostCSS ecosystem.
Tailwind CSS - A utility-first CSS framework for rapid UI development.
Sass - Sass makes CSS fun!
esbuild-loader - ⚡️ Speed up your Webpack build with esbuild
cssbundling-rails - Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.
JSS - JSS is an authoring tool for CSS which uses JavaScript as a host language.
lit-element - LEGACY REPO. This repository is for maintenance of the legacy LitElement library. The LitElement base class is now part of the Lit library, which is developed in the lit monorepo.
prettier - Prettier is an opinionated code formatter.