A simple, dependency-free tool for generating CSS utility classes.
- Support for template expressions.
- Support for script tags in HTML.
- Ignoring HTML comments.
- Tests.
Feel free to contribute.
But before you start working on a pull request for a feature that is not listed here, please create a proposal first.
Prerequisites:
Install CSSKit from source:
go install github.com/igormichalak/csskit/cmd/csskit@latest
If the csskit
command can't be found, make sure that the $GOBIN
(or $GOPATH/bin
) directory is added to your system PATH.
Here's how to find the location of the binary:
go env GOBIN
echo "$(go env GOPATH)/bin"
More info: https://go.dev/wiki/GOPATH
Only JavaScript, HTML and Go template files can be scanned for class names.
csskit -out outfile.css infile1.js infile2.html ...
Supported extensions: .js
, .html
, .gohtml
.
letter = 'a' ... 'z' .
digit = '0' ... '9' .
keyword = letter, { letter } .
number = digit, { digit }, [ '.', digit, { digit } ] .
unit = 'px' | '%' | 'vw' | 'vh'
| 'rad' | 'deg' | 'ms' | 's' .
className = keyword, { '-', keyword },
[ '-', number, [ unit ] ] .
Compatibility with other technologies such as Astro, TypeScript and JSX is not within the scope of this project.