Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/razrfalcon/simplecss
A simple CSS 2.1 parser and selector
https://github.com/razrfalcon/simplecss
Last synced: 2 months ago
JSON representation
A simple CSS 2.1 parser and selector
- Host: GitHub
- URL: https://github.com/razrfalcon/simplecss
- Owner: RazrFalcon
- License: apache-2.0
- Created: 2016-12-20T14:36:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-21T07:45:21.000Z (over 3 years ago)
- Last Synced: 2024-10-16T05:59:28.149Z (2 months ago)
- Language: Rust
- Homepage:
- Size: 45.9 KB
- Stars: 35
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
## simplecss
![Build Status](https://github.com/RazrFalcon/simplecss/workflows/simplecss/badge.svg)
[![Crates.io](https://img.shields.io/crates/v/simplecss.svg)](https://crates.io/crates/simplecss)
[![Documentation](https://docs.rs/simplecss/badge.svg)](https://docs.rs/simplecss)
[![Rust 1.37+](https://img.shields.io/badge/rust-1.37+-orange.svg)](https://www.rust-lang.org)
![](https://img.shields.io/badge/unsafe-forbidden-brightgreen.svg)A simple [CSS 2.1](https://www.w3.org/TR/CSS21/) parser and selector.
This is not a browser-grade CSS parser. If you need one,
use [cssparser](https://crates.io/crates/cssparser) +
[selectors](https://crates.io/crates/selectors).Since it's very simple we will start with limitations:
### Limitations
- [At-rules](https://www.w3.org/TR/CSS21/syndata.html#at-rules) are not supported.
They will be skipped during parsing.
- Property values are not parsed.
In CSS like `* { width: 5px }` you will get a `width` property with a `5px` value as a string.
- CDO/CDC comments are not supported.
- Parser is case sensitive. All keywords must be lowercase.
- Unicode escape, like `\26`, is not supported.### Features
- Selector matching support.
- The rules are sorted by specificity.
- `!important` parsing support.
- Has a high-level parsers and low-level, zero-allocation tokenizers.
- No unsafe.### License
Licensed under either of
- Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.