A small, fast successor to Stylus, written in Rust.
stylet keeps the parts of Stylus that modern CSS still lacks and drops the rest:
{}blocks andprop: valuedeclarations, no semicolons- nesting and
&, emitted as native CSS nesting @importbundling (imported once, path aliases, source maps,url()rebasing)@extendfor$placeholderselectors
No variables, mixins, loops, math or built-in functions — use CSS custom properties and friends instead.
@import '@/components/button'
$btn {
padding: 4px 8px
}
.button {
@extend $btn
color: red
&:hover {
color: blue
}
}Tooling: formatter, stylet migrate for existing Stylus code and a browser playground.
Editor support (VS Code, tree-sitter, language server) is in progress.
stylet build src/index.styl -o dist/index.css
stylet fmt --check
stylet migrate client/index.styl --dry-runSee the website, the documentation and PLAN.md.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.