Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 782 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 782 Bytes

parse-css-custom-property

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);