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: about 2 months ago
JSON representation
Loader that modularize, export and enables easy theming css
- Host: GitHub
- URL: https://github.com/vinpac/styled-css-loader
- Owner: vinpac
- Created: 2018-04-19T19:39:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-01T04:08:35.000Z (about 8 years ago)
- Last Synced: 2026-03-30T09:21:54.852Z (4 months ago)
- Language: JavaScript
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
)
```