Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vinpac/styled-css-loader

Loader that modularize, export and enables easy theming css
https://github.com/vinpac/styled-css-loader

Last synced: 5 days ago
JSON representation

Loader that modularize, export and enables easy theming css

Awesome Lists containing this project

README

        

# Styled css loader
Theme and use css fastly

# Getting Started

## Installation

```bash
$ npm install --save styled-css-loader
```

or

```
$ yarn add styled-css-loader
```

## Usage

```js
/* webpack-config.js */
module.exports = {
module: {
rules: [
{
test: /\.css/,
loader: 'styled-css-loader',
}
]
}
}
```

```css
/* home.css */
.page {
background: --colorPrimary;
}

.title {
color: white;
}
```

```jsx
/* home.js */
import s, { sheet } from './home.css'
import compile from 'styled-css-loader/compile'

// You can also use {sheet.css}
const Home = () => (


{compile(sheet, { colorPrimary: '#333' })}

Home



)

```