purifycss
lightningcss
purifycss | lightningcss | |
---|---|---|
5 | 11 | |
9,924 | 5,966 | |
0.2% | 2.0% | |
0.0 | 8.7 | |
over 3 years ago | 5 days ago | |
JavaScript | Rust | |
MIT License | Mozilla Public License 2.0 |
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.
purifycss
-
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.
-
Parcel CSS: A new CSS parser, compiler, and minifier
> Isn't there a process of reducing it to only what one needs?
Yes there is: https://github.com/purifycss/purifycss
-
Clean CSS: How to Spring Clean your Project
PurifyCSS
-
Is there a way to check which CSS I am not using?
Check out purifycss, I’m not sure if it works with scss though.
-
Bootstrap Templates
Unelte de genul PurifyCSS și niște elbowgrease îți pot scoate un cod utilizabil.
lightningcss
-
I'm fed up with it, so I'm writing a browser
Would you consider using some libraries in your project? There are lots of good ones in the Rust ecosystem, and many of them are not part of any existing browsers.
For example:
- https://github.com/servo/html5ever (HTML parsing - note: this is used in Servo)
- https://github.com/parcel-bundler/lightningcss (CSS parsing)
- https://github.com/DioxusLabs/taffy (web layout)
- https://github.com/pop-os/cosmic-text (text layout and rendering)
Obviously you should be free to work on whatever you like, but just as a benchmark on the scope of your project: I spent ~6 months implementing just the CSS Grid algorithm in Taffy last year. An entire browser from literal scratch is probably a 10 year project for one person.
- LightningCSS Benchmark
-
We're building a browser when it's supposed to be impossible
Libraries for a lot of this stuff exist (albeit in many cases not very mature yet):
- https://github.com/pop-os/cosmic-text does text layout (which Taffy explicitly considers out of scope)
- https://github.com/AccessKit/accesskit does accessibility
- https://github.com/servo/rust-cssparser does value-agnostic CSS parsing (it will parse the general syntax but leaves value parsing up to the user, meaning you can easily add support for whatever properties you what). Libraries like https://github.com/parcel-bundler/lightningcss implement parsing for the standard css properties.
- There are crates like https://github.com/BurntSushi/bstr and https://docs.rs/wtf8/latest/wtf8/ for working with non-unicode text
We are planning to add a C API to Taffy, but tbh I feel like C is not very good for this kind of modularised approach. You really want to be able to expose complex APIs with enforced type safety and this isn't possible with C.
-
Help with "returns a value referencing data owned by the current function"
Background: I encountered this problem using lightningcss.
-
On Using Rust in Parcel and Vitest
You can do it - that's actually exactly what my project is doing. I have a single repository with a Rust project, that builds the .wasm file (+ .d.ts + .js) using wasm-pack, and a Node.js project, that uses this .wasm file. There's no problem in packing that and exposing as a npm package. See parcel-bundler/lightningcss for a full blown example (it's not using wasm-pack but builds the Rust project directly).
- An fast CSS parser, transformer, bundler, and minifier written in Rust
- Parcel-Css - A CSS parser, transformer, and minifier written in Rust.
- ParcelCSS – A CSS parser, transformer, and minifier written in Rust
-
Parcel CSS: A new CSS parser, compiler, and minifier
Initial commit, 9 Oct 2021. That is pretty new.
What are some alternatives?
ngx-unused-css - Angular unused css detection
PostCSS - Transforming styles with JS plugins
purgecss - Remove unused CSS
swc - Rust-based platform for the Web
uncss - Remove unused styles from CSS
rust-cssparser - Rust implementation of CSS Syntax Level 3
parse5 - HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.
lighthouse - Automated auditing, performance metrics, and best practices for the web.
x-ray - The next web scraper. See through the <html> noise.
antd - An enterprise-class UI design language and React UI library
excel-stream