MCPcopy Index your code
hub / github.com/csskit/csskit

github.com/csskit/csskit @v0.0.27

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.27 ↗ · + Follow
5,413 symbols 9,666 edges 702 files 363 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img alt="csskit" src="https://github.com/csskit/csskit/raw/v0.0.27/website/images/logo.svg" width="890">

csskit on npm recent builds License

[!WARNING] Alpha Quality: csskit is in active development and not yet ready for production use. APIs may change without notice.

csskit is a high-performance CSS toolchain written in Rust, inspired by oxc. It provides blazingly fast parsing, minification, linting, formatting, as well as IDE integration with an LSP.

Features

  • Parser: Spec-compliant CSS parser with full AST support
  • Minifier: Aggressive minification for faster asset delivery
  • Formatting: Beautify your CSS with consistent formatting
  • Transformations: Transform modern syntax to support a wide variety of browsers.
  • LSP: Language server integration for editors and IDEs
  • Highlighting: Syntax highlighting support with Semantic Tokens

Visit csskit.rs for full documentation and guides →

Installation

Node.js

npm install csskit

Packages

Rust Crates

Crate Description
css_ast CSS Abstract Syntax Tree
css_lexer CSS tokenizer/lexer
css_parse CSS parser
csskit Main CLI and library
csskit_lsp Language Server Protocol
csskit_transform AST transformations
csskit_highlight Syntax highlighting
chromashift Color space conversions
css_feature_data Browser compatibility data

Node.js Packages

Package Description
csskit CLI tool for Node.js

Editor Extensions

Package Description
VSCode VSCode Extension
Zed Zed Extension

Acknowledgments

Previously known as hdx. Special thanks to @sethvincent for graciously transferring the csskit name.

License

MIT

Extension points exported contracts — how you extend this code

QueryableNode (Interface)
Marker trait for AST nodes that can be queried with selectors. Implemented by `#[derive(Visitable)]` for queryable node [6 …
crates/css_ast/src/visit/mod.rs
ToSpan (Interface)
A trait representing an object that can derive its own [Span]. This is very similar to `From for Span`, however [42 implementers]
crates/css_lexer/src/span.rs
Matcher (Interface)
Trait for matching selector components against a node context. [9 implementers]
crates/csskit_ast/src/selector/matcher/matchers.rs
ToAlpha (Interface)
Trait for extracting the alpha channel of a color. [18 implementers]
crates/chromashift/src/channels.rs
Parse (Interface)
This trait allows AST nodes to construct themselves from a mutable [Parser] instance. Nodes that implement this trait a [121 …
crates/css_parse/src/traits/parse.rs
Plan (Interface)
(no doc) [8 implementers]
crates/csskit_derives/src/parse.rs
ToFieldName (Interface)
Generate a suitable name for an enum variant or struct member given the Def. [3 implementers]
crates/csskit_proc_macro/src/generate.rs
Extract (Interface)
Trait for a command that walks a CSS AST and emits records. Implementors define: - `Row`: the command-specific data pay [3 …
crates/csskit/src/commands/extract.rs

Core symbols most depended-on inside this repo

iter
called by 280
crates/chromashift/src/named.rs
clone
called by 257
crates/css_parse/src/bump_box.rs
len
called by 180
crates/css_lexer/src/span.rs
contains
called by 163
crates/css_lexer/src/span.rs
collect
called by 161
crates/csskit_ast/src/collector/mod.rs
advance
called by 139
crates/css_lexer/src/lib.rs
peek_n
called by 117
crates/css_parse/src/parser.rs
token
called by 100
crates/css_lexer/src/cursor.rs

Shape

Function 2,085
Method 1,563
Class 1,046
Enum 653
Interface 66

Languages

Rust98%
TypeScript2%

Modules by API surface

crates/csskit_ast/src/selector/matcher/tests.rs141 symbols
crates/css_ast/src/values/borders/mod.rs119 symbols
crates/css_ast/src/values/webkit.rs115 symbols
crates/csskit_lsp/src/server/handler.rs95 symbols
crates/css_lexer/src/token.rs82 symbols
website/script/index.js77 symbols
crates/csskit_ast/src/selector/query.rs77 symbols
crates/csskit_proc_macro/src/test/test_generate.rs75 symbols
crates/css_ast/src/values/ms.rs59 symbols
crates/css_lexer/tests/tests.rs50 symbols
crates/csskit_derives/src/test/test_parse.rs47 symbols
crates/css_value_definition_parser/src/test.rs45 symbols

For agents

$ claude mcp add csskit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact