A command line and library to generate typescript definition file from CSS, SASS, SCSS or SVG file.
npm i -D @krobkrong/resources-utilities
yarn add @krobkrong/resources-utilities -D
Command Line Usage
Resource utilities provide a command line that accept the last argument with glob pattern input syntax. For example, the command line below will generate a typescript definition file from a CSS file in the current work directory:
If you've a specific location to store typescript definition file then you can use output directory option:
resutil -o types theme*.css
The command above will generate the typescript definition file in the folder types in the current working directory.
For more information run
Resource utilities provided APIs for both CSS and SVG. The below code utilize
StyleUtils namespace to parse raw css file: