0.1.6 • Published 1 year ago

css-custom-property-extractor v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Intro

  • Parse css custom properties and output typescript files.By importing the output typescript files ,custom properties can be used type-safely in various libraries.
  • Supports css and sass and less.

Usage

  1. Install as devDependencies
npm i -D css-custom-property-extractor
  1. For example. Parsing ./samples/scss/bootstrap.scss outputs the following typescript file.
npx ccpe -i ./samples/scss/bootstrap.scss
/**
 *  #0d6efd;
 */
export const bsBlue = "var(--bs-blue)"
/**
 *  #6610f2;
 */
export const bsIndigo = "var(--bs-indigo)"
/**
 *  #6f42c1;
 */
export const bsPurple = "var(--bs-purple)"
...
  1. Import and use the output typescript file.

Command options

optiondescription
-o \<path>output path.
-i,--include include path (glob pattern). (default */.?(css | scss | sass | less))
-e,--exclude exclude path (glob pattern).
-v,--vite <path | false>Specify the relative path to vite.config.Read the css-preprocessoroptions property from vite.config. (default false)
0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago