Skip to content

Create CSS modules with the full power of JavaScript

Notifications You must be signed in to change notification settings

MicheleBertoli/styling

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Styling

Style components with JavaScript.

Add the following configuration to webpack.config.js:

module: {
  loaders: [
    {
      test: /\.styling\.js/,
      loader: 'style!css!styling!babel'
    }
  ]
}

Now you can write styles with the full power of JavaScript, Button.styling.js:

import styling import 'styling'

export let self = styling({
  backgroundColor: 'red',
  borderWidth: 1 + 10,

  hover: {
    borderWidth: 100
  }
})

And consume them, Button.js:

import ButtonStyle from './Button.styling'

export function render() {
  return `<button className="${ButtonStyle.self}">Click!</button>`
}

About

Create CSS modules with the full power of JavaScript

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%