Giter VIP home page Giter VIP logo

react-static-plugin-scss-modules's Introduction

react-static-plugin-scss-modules

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

Installation

yarn add react-static-plugin-scss-modules

or

npm install react-static-plugin-scss-modules

Then add to plugins array:

// static.config.js
export default {
  // <…>
  plugins: [
    'react-static-plugin-scss-modules',
  ],
  // <…>
}

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

// Button.scss
.root {
  color: red;
  
  &:hover {
    color: blue;
  }
}
// Button.js
import React from 'react';
import styles from './Button.scss';

const Button = () => (
  <button className={styles.root}>Click here</button>
);

Included PostCSS plugins

react-static-plugin-scss-modules's People

Contributors

cinamonas avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

react-static-plugin-scss-modules's Issues

Global Styles Support

Thanks for this library, it saved me a lot of hassle!

I was wondering there could be support for global style scss file that doesn't get the hash css names and can be imported Only i.e. Dont have to use styles.somestyle in your JS code. In the create-react-app, they support this by allowing you to name your module files differently i.e. foo.module.scss which signals this scss file needs hashing of the css class names. Whereas, foo.scss doesnt. This allows you to import global styles while still have module scss.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.