0.0.13 • Published 3 years ago
@juliani/sass2ts v0.0.13
@juliani/sass2ts
This package converts a sass variables file into 3 files:
- variables.json
- varaibles.interfaces.ts
- varaibles.proxies.ts
Typescript files generated with make-types (only dependancy)
Install
npm i -D @juliani/sass2ts maketypes
yarn add -D @juliani/sass2ts maketypes
Usage
sass2ts input.scss output.json
params
- inputSass
- outputJson - typescript files will also be placed in this location
It ignores any lines that don't contain variables including maps. If using maps ensure they are backed with variables to ensure all values are exported.
{variables}.json
A JSON representation of all variables - can be imported directly in Typescript as JSON Module
{variables}.interfaces.ts + varaibles.proxies.ts
Both of these files can be used to type-check the JSON output, interfaces has no run-time guarantees but proxies is heavier. See here for a full explanation and usage examples.