项目作者: Cinamonas

项目描述 :
An opinionated React-Static plugin that enables CSS Modules with SCSS syntax and PostCSS processing
高级语言: JavaScript
项目地址: git://github.com/Cinamonas/react-static-plugin-scss-modules.git
创建时间: 2019-04-12T10:00:09Z
项目社区:https://github.com/Cinamonas/react-static-plugin-scss-modules

开源协议:MIT License

下载


react-static-plugin-scss-modules

An opinionated React-Static plugin that enables CSS Modules with SCSS syntax and PostCSS processing.

Installation

  1. yarn add react-static-plugin-scss-modules

or

  1. npm install react-static-plugin-scss-modules

Then add to plugins array:

  1. // static.config.js
  2. export default {
  3. // <…>
  4. plugins: [
  5. 'react-static-plugin-scss-modules',
  6. ],
  7. // <…>
  8. }

Note: if you already have other styling-related plugins included, make sure to remove them to prevent potentially conflicting behavior. This plugin takes care of all your styling needs.

Configuration

No configuration is currently available. If you want to modify this plugin’s behavior, describe your scenario in an issue and I’ll add it in.

Usage

  1. // Button.scss
  2. .root {
  3. color: red;
  4. &:hover {
  5. color: blue;
  6. }
  7. }
  1. // Button.js
  2. import React from 'react';
  3. import styles from './Button.scss';
  4. const Button = () => (
  5. <button className={styles.root}>Click here</button>
  6. );

Included PostCSS plugins