项目作者: SimonFinney

项目描述 :
Parse CSS custom property string
高级语言: JavaScript
项目地址: git://github.com/SimonFinney/parse-css-custom-property.git
创建时间: 2020-03-22T15:19:30Z
项目社区:https://github.com/SimonFinney/parse-css-custom-property

开源协议:ISC License

下载


parse-css-custom-property

Licensed under the ISC License
Travis CI

Parse CSS custom property strings.

Installation

  1. npm i -S parse-css-custom-property

Usage

  1. import ParseCSSCustomProperty, {
  2. getDeclaration,
  3. getFallback,
  4. } from 'parse-css-custom-property';
  5. const cssCustomProperty = 'var(--foo, bar)';
  6. // { declaration: '--foo', fallback: 'bar' }
  7. ParseCSSCustomProperty(cssCustomProperty);
  8. // '--foo'
  9. getDeclaration(cssCustomProperty);
  10. // 'bar'
  11. getFallback(cssCustomProperty);