uncss
astroturf
Our great sponsors
uncss | astroturf | |
---|---|---|
5 | 4 | |
9,388 | 2,261 | |
0.2% | 0.1% | |
5.3 | 2.1 | |
24 days ago | 4 months ago | |
JavaScript | JavaScript | |
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.
uncss
-
Optimize CSS with SAT Solving
Check out: https://github.com/uncss/uncss
I've only used it once but it did the job (NOTE: Plain HTML, plain CSS, no build pipeline. So YMMV)
-
PurgeCSS & styled-components: Does It Work?
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.
-
Lessons learned from building landing pages
In the process of trying to figure out how to remove the unused code, I found out about UnCSS, a tool that removes unused CSS from your stylesheets. It can be installed by running:
-
Any tool the will scan HTML and css and show unused css rules?
Also UnCSS.
-
remove unwanted css using post css
https://github.com/uncss/uncss https://shorturl.at/yzSVX https://uncss-online.com/
astroturf
-
VueJS turns 10 years old
CSS-in-JS has been a challenge – we're currently using https://github.com/astroturfcss/astroturf which seemed the simplest zero-runtime-cost option back when we were looking, but the library is starting to feel a bit under-maintained (if the author of Astroturf reads this, we love your work and will do whatever we can to support you in it!). But it's worked well for us over the last 2 years.
Happy to share a component example. We also use a small library for managing CSS classes in a typed fashion, which can also be used by our UI test code to target various elements. So that does add a bit of cryptic boilerplate, but the repo README has an example component with syntax highlighting:
-
SFC - single file components
Try https://github.com/4Catalyzer/astroturf
-
PurgeCSS & styled-components: Does It Work?
On the other side of our titular question is styled-components. While I'm talking about styled-components specifically, the topics and concepts here apply to any CSS-in-JS provider (e.g. emotion). There is a smaller CSS-in-JS library called astroturf that aims to give the developer the best of all worlds, so the limitations I'll discuss later on don't apply there. But be careful with smaller projects/ones that claim you can have it all! You are wading through uncharted territory :)
- Is it possible to directly write SCSS inside React components?
What are some alternatives?
purgecss - Remove unused CSS
PostCSS - Transforming styles with JS plugins
Tailwind CSS - A utility-first CSS framework for rapid UI development.
styled-components - Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
Bulma - Modern CSS framework based on Flexbox
purifycss - Remove unused CSS. Also works with single-page apps.
babel-sublime - Syntax definitions for ES6 JavaScript with React JSX extensions.
stellar-photos - Beautiful hi-res photos in your browser tabs - Available for the desktop versions of Chrome, Firefox, Microsoft Edge, Opera, Vivaldi, Brave, and other Chromium browsers.
Sass - Sass makes CSS fun!