Software Alternatives & Reviews

PurgeCSS & styled-components: Does It Work?

Tailwind CSS styled-components Sass Purgecss PostCSS PurifyCSS jsdom Skeleton CSS Bootstrap BEM
  1. A utility-first CSS framework for rapidly building custom user interfaces.
    Pricing:
    • Open Source
    PurgeCSS is a build/bundle time tool to transform your CSS into the bare minimum it should be. It aims to reduce your overall bundle size by sending only the critical CSS you need, instead of all the CSS you have written and imported. You can use it with any flavor of CSS you use: Sass, Less, Tailwind, Bootstrap, Material UI, Bulma, the list goes on.

    #Developer Tools #Design Tools #Website Design 864 social mentions

  2. styled-components is a visual primitive for the component age that also helps the user to use the ES6 and CSS to style apps.
    Pricing:
    • Open Source
    Here at Anvil, we use styled-components. PurgeCSS functionality is essentially baked into styled-components, with a few caveats. If PurgeCSS is already included in styled-components, can you still use both? And if you can, is there any benefit to doing so?

    #Developer Tools #Design Tools #Javascript UI Libraries 153 social mentions

  3. 3
    Syntatically Awesome Style Sheets
    Pricing:
    • Open Source
    While CSS itself is ubiquitous, the way each project uses it is certainly not. Before preprocessors like Sass and Less, there were entire methodologies, like BEM, for writing and maintaining your CSS. Even with methodologies and preprocessors to help our style writing, there is still an abundance of CSS bloat in all projects.

    #Developer Tools #Design Tools #Javascript UI Libraries 131 social mentions

  4. Easily remove unused CSS
    Pricing:
    • Open Source
    { 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(/([a-zA-Z-0-9-@&:{}]+)(?= {)/g) || [], extensions: ['css', 'less'], }, ], }, }, }.

    #Developer Tools #Development #Design Tools 33 social mentions

  5. Increase code readability. Add vendor prefixes to CSS rules using values from Can I Use. Autoprefixer will use the data based on current browser popularity and property support to apply prefixes for you.
    Pricing:
    • Open Source
    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.

    #Developer Tools #Design Tools #CSS Framework 39 social mentions

  6. Plugin to remove unused css.
    PurgeCSS analyzes your HTML and internally keeps track of which selectors are being used or not. PurgeCSS actually analyzes other types of files besides HTML for selectors, such as template files and JavaScript. This feature is what makes PurgeCSS different from a similar solution, UnCSS, and related to a 'predecessor' solution called PurifyCSS. More on both of those later on.

    #Development Tools #Developer Tools #CSS Tools 3 social mentions

  7. 7
    A JavaScript implementation of various web standards, for use with Node.js - jsdom/jsdom
    Pricing:
    • Open Source
    This project is very interesting. It actually solves the problem of excess CSS the best; it does so by loading your HTML into jsdom, and then querySelector-ing all of the selectors found in your CSS against the emulated DOM. If a selector isn't found in the emulated DOM, UnCSS will not include the CSS rule in its output.

    #Development #Browser Testing #Automated Testing 28 social mentions

  8. A Beautiful Boilerplate for Responsive, Mobile-Friendly Development
    Pricing:
    • Open Source
    I'm not sure what the stats are, but I'm willing to bet that over 50% of websites and webapps started off using a CSS framework. I'm talking about frameworks like Bootstrap, Bulma, Ant, Material UI, Skeleton, and many more.

    #CSS Framework #CSS Tools #Design Tools 17 social mentions

  9. Simple and flexible HTML, CSS, and JS for popular UI components and interactions
    Pricing:
    • Open Source
    PurgeCSS is a build/bundle time tool to transform your CSS into the bare minimum it should be. It aims to reduce your overall bundle size by sending only the critical CSS you need, instead of all the CSS you have written and imported. You can use it with any flavor of CSS you use: Sass, Less, Tailwind, Bootstrap, Material UI, Bulma, the list goes on.

    #CSS Framework #Development Tools #Design Tools 326 social mentions

  10. 10

    BEM

    BEM — Block Element Modifier is a methodology, that helps you to achieve reusable components and code sharing in the front-end.
    While CSS itself is ubiquitous, the way each project uses it is certainly not. Before preprocessors like Sass and Less, there were entire methodologies, like BEM, for writing and maintaining your CSS. Even with methodologies and preprocessors to help our style writing, there is still an abundance of CSS bloat in all projects.

    #Developer Tools #Design Tools #CSS Framework 42 social mentions

  11. 11
    Bulma is an open source CSS framework based on Flexbox and built with Sass. It's 100% responsive, fully modular, and available for free.
    Pricing:
    • Open Source
    PurgeCSS is a build/bundle time tool to transform your CSS into the bare minimum it should be. It aims to reduce your overall bundle size by sending only the critical CSS you need, instead of all the CSS you have written and imported. You can use it with any flavor of CSS you use: Sass, Less, Tailwind, Bootstrap, Material UI, Bulma, the list goes on.

    #CSS Framework #Development Tools #Design Tools 109 social mentions

  12. 12
    Babel is a compiler for writing next generation JavaScript.
    Pricing:
    • Open Source
    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.

    #Development Tools #Javascript UI Libraries #JavaScript Framework 134 social mentions

  13. An enterprise-class UI design language and React implementation with a set of high-quality React components, one of best React UI library for enterprises
    Pricing:
    • Open Source
    The other edge case to consider is if, like us at Anvil, you use Ant Design. PurgeCSS has a hard time with Ant Design to keep the correct styles, and PurgeCSS is aware of this. Here's the solution straight from the docs, but it isn't adapted for the Gatsby plugin.

    #Development Tools #Design Tools #UI 96 social mentions

Discuss: PurgeCSS & styled-components: Does It Work?

Log in or Post with