/sssa

A toy CSS preprocessor implementation with SASS like grammar.

Primary LanguageJavaScriptMIT LicenseMIT

SSSA

A toy CSS preprocessor implementation with SASS like grammar.

Software License Issues JavaScript Style Guide NPM

Usage

CLI

npm i sssa -g

# examples
sssa --help
cat file.sssa | sssa
echo '.a { .b { color: red; } }' | sssa

NodeJS

import { compile } from 'sssa';

const {
  tokens,
  ast,
  code,
} = compile('b {}', opts);

Options

  • opts.scan Only proceed tokenize and return tokens;
  • opts.parse Proceed tokenize and generate corresponding ast;
  • opts.transform Transform SSSA ast to CSS ast;

Develop

# install deps
npm install

# build app
npm run build

# build & watch app
npm run watch

# build & launch app
npm run start

# run unit test
npm run test

License

© BinRui Guan