Skip to content

igormichalak/csskit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSSKit (still WIP)

A simple, dependency-free tool for generating CSS utility classes.

Missing features

  • 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.

Installation

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

Usage

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.

Grammar

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

Compatibility with other technologies such as Astro, TypeScript and JSX is not within the scope of this project.

About

A tool for generating CSS utility classes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages