https://github.com/simonfinney/parse-css-custom-property
Parse CSS custom property string
https://github.com/simonfinney/parse-css-custom-property
css-custom-properties javascript npm-package
Last synced: 6 months ago
JSON representation
Parse CSS custom property string
- Host: GitHub
- URL: https://github.com/simonfinney/parse-css-custom-property
- Owner: SimonFinney
- License: isc
- Created: 2020-03-22T15:19:30.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-04T12:58:22.000Z (almost 3 years ago)
- Last Synced: 2024-04-24T13:17:50.906Z (over 1 year ago)
- Topics: css-custom-properties, javascript, npm-package
- Language: JavaScript
- Homepage:
- Size: 2.14 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
parse-css-custom-property
[](LICENSE)
[](https://travis-ci.org/SimonFinney/parse-css-custom-property)
Parse CSS custom property strings.
## Installation
```bash
npm i -S parse-css-custom-property
```
## Usage
```js
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);
```