Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ktsn/vue-custom-properties
Make easier to use CSS custom properties in Vue components
https://github.com/ktsn/vue-custom-properties
css css-custom-properties vue
Last synced: about 1 month ago
JSON representation
Make easier to use CSS custom properties in Vue components
- Host: GitHub
- URL: https://github.com/ktsn/vue-custom-properties
- Owner: ktsn
- License: mit
- Created: 2017-05-13T13:28:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-13T13:29:09.000Z (over 7 years ago)
- Last Synced: 2024-11-19T22:52:54.965Z (about 1 month ago)
- Topics: css, css-custom-properties, vue
- Language: TypeScript
- Size: 45.9 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-custom-properties
Make easier to use CSS custom properties in Vue components
## Installation
```bash
$ npm install --save vue-custom-properties
# or
$ yarn add vue-custom-properties
```## Example
1. Install it into Vue.js.
```js
import Vue from 'vue'
import VueCustomProperties from 'vue-custom-properties'Vue.use(VueCustomProperties)
```2. Define `customProperties` option in your components.
```js
export default {
data() {
return {
color: 'red',
size: 12
}
},customProperties: {
'--base-color': 'color', // --base-color: red;
'--base-size'() {
return this.size + 'px' // --base-size: 12px;
}
}
}
```## License
MIT