1.0.1 • Published 4 years ago

parse-css-custom-property v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Licensed under the ISC License Travis CI

Parse CSS custom property strings.

Installation

npm i -S parse-css-custom-property

Usage

import ParseCSSCustomProperty, {
  getDeclaration,
  getFallback,
} from 'parse-css-custom-property';

const cssCustomProperty = 'var(--foo, bar)';

// { declaration: '--foo', fallback: 'bar' }
ParseCSSCustomProperty(cssCustomProperty);

// '--foo'
getDeclaration(cssCustomProperty);

// 'bar'
getFallback(cssCustomProperty);