#css-selectors #css #css-parser

parcel_selectors

CSS Selectors matching for Rust - forked for lightningcss

18 releases

Uses old Rust 2015

0.26.4 Oct 25, 2023
0.26.2 Sep 17, 2023
0.26.0 Jun 7, 2023
0.25.1 Feb 13, 2023
0.24.0 Dec 29, 2021

#16 in #css-selectors

Download history 4546/week @ 2023-12-04 3383/week @ 2023-12-11 3831/week @ 2023-12-18 2785/week @ 2023-12-25 4606/week @ 2024-01-01 5101/week @ 2024-01-08 5876/week @ 2024-01-15 6984/week @ 2024-01-22 8504/week @ 2024-01-29 7611/week @ 2024-02-05 6867/week @ 2024-02-12 6220/week @ 2024-02-19 6659/week @ 2024-02-26 6581/week @ 2024-03-04 6360/week @ 2024-03-11 6233/week @ 2024-03-18

26,336 downloads per month
Used in 66 crates (7 directly)

MPL-2.0 license

250KB
6K SLoC

rust-selectors

This is a fork of the selectors crate, updated to use the latest version of cssparser.

CSS Selectors library for Rust. Includes parsing and serialization of selectors, as well as matching against a generic tree of elements. Pseudo-elements and most pseudo-classes are generic as well.

Warning: breaking changes are made to this library fairly frequently (13 times in 2016, for example). However you can use this crate without updating it that often, old versions stay available on crates.io and Cargo will only automatically update to versions that are numbered as compatible.

To see how to use this library with your own tree representation, see Kuchiki’s src/select.rs. (Note however that Kuchiki is not always up to date with the latest rust-selectors version, so that code may need to be tweaked.) If you don’t already have a tree data structure, consider using Kuchiki itself.

Dependencies

~1.3–2MB
~43K SLoC