NovaSheets is a powerful CSS preprocessor with the ability to easily create intricate CSS files.
NovaSheets has very simple syntax that is easy to pick up and use as it builds largely off of CSS itself.
Extend your stylesheets with variables and functions to keep code duplication to a minimum.
Make use of the many built-in functions offered to you, or create your own with an easy API.
Improve variables by providing arguments, making them into functions:
@var border | color // or just `@var border`; arguments are automatically created
border-bottom: 2px solid $[color];
@endvar
div {$(border | color = #111);}
Download NovaSheets for the command line globally using npm install -g novasheets then get started by typing novasheets --help.
The command-line tool uses the same functions as the Node usage, giving you two commands: --parse and --compile.
novasheets {-p|--parse} "<input">
Parses NovaSheets input and outputs it back in the command line.
novasheets [{-c|--compile}] <input> [<output>]
Compiles the file(s) set as the input (which may be a glob) into the output (which, if unset or set to a folder, uses the original filename but with an extension of .css).
Browser usage
See the releases page of this repository to choose a version to use.
Simply import the script into your HTML document and any embedded NovaSheets stylesheets will be parsed:
If you are using a static site generator that supports npm packages (such as eleventy), it is recommended to use the command-line usage to compile NovaSheets during the site's build process instead of client-side.
This can be done by adding novasheets --compile **/*.nvss to your post-build command after installing NovaSheets using npm install --save-dev novasheets.
The NovaSheets class is available to use in the browser, allowing you to add custom functions. Example:
const sheet = new NovaSheets();
sheet.addFunction('@invert boolean', (match, val) => val === 'false');
NovaSheets.parse('$(@invert boolean | true)', sheet); // 'false'
VSCode extension
A VSCode extension for NovaSheets formatting and syntax highlighting is available in the VSCode Marketplace via repository NovaSheets/vscode.