simplecss

A simple CSS 2.1 parser and selector

Latest version: 0.2.2 registry icon
Maintenance score
4
Safety score
100
Popularity score
72
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.2.2 0 0 0 0 0
0.2.1 0 0 0 0 0
0.2.0 0 0 0 0 0
0.1.0 0 0 0 0 0

Stability
Latest release:

0.2.2 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant


Apache-2.0   -   Apache License 2.0

Not a wildcard

Not proprietary

OSI Compliant



SimpleCSS

A simple CSS 2.1 parser and selector.

Linebender Zulip, #resvg channel dependency status Apache 2.0 or MIT license. Build status Crates.io Docs

This is not a browser-grade CSS parser. If you need one, use cssparser + selectors.

Since it's very simple we will start with limitations:

Limitations

  • Most at-rules are not supported. They will be skipped during parsing. The only supported at-rule is @font-face.
  • 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.
  • @font-face parsing support.
  • !important parsing support.
  • Has a high-level parsers and low-level, zero-allocation tokenizers.
  • No unsafe.

Minimum supported Rust Version (MSRV)

This version of SimpleCSS has been verified to compile with Rust 1.65 and later.

Future versions of SimpleCSS might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.

Click here if compiling fails.

As time has passed, some of SimpleCSS's dependencies could have released versions with a higher Rust requirement. If you encounter a compilation issue due to a dependency and don't want to upgrade your Rust toolchain, then you could downgrade the dependency.

# Use the problematic dependency's name and version
cargo update -p package_name --precise 0.1.1

Community

Linebender Zulip, #resvg channel

Discussion of SimpleCSS development happens in the Linebender Zulip at https://xi.zulipchat.com/, specifically the #resvg channel. All public content can be read without logging in.

License

Licensed under either of

at your option.

Contribution

Contributions are welcome by pull request. The Rust code of conduct applies. Please feel free to add your name to the AUTHORS file in any substantive pull request.

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 licensed as above, without any additional terms or conditions.