Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 973 Bytes

README.md

File metadata and controls

48 lines (35 loc) · 973 Bytes

vue-styletron

Travis David David npm

Styletron for Vue.js

Install

Add dependency

npm install vue-styletron --save or yarn add vue-styletron

Initialize plugin

import VueStyletron from 'vue-styletron'

Vue.use(VueStyletron)

Usage

Define style in data, use v-style in template

new Vue({
  el: '#el',
  data: {
    style: {
      el: {
        color: 'white'
      }
    }
  }
  template: '<div v-style="el">White text</div>'
})

// Styletron generated style:
// .a {
//   color: white
// }

// Vue rendered template:
// <div class="a">White text</div>