Socket
Socket
Sign inDemoInstall

react-app-rewire-css-modules

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-app-rewire-css-modules

Add [CSS Module](https://github.com/css-modules/css-modules) loaders to your [create-react-app](https://github.com/facebookincubator/create-react-app) via [react-app-rewired](https://github.com/timarney/react-app-rewired).


Version published
Weekly downloads
9
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

react-app-rewire-react-toolbox

Add CSS Module loaders to your create-react-app via react-app-rewired.

Installation

This package is not yet published to the npm registry. Install from GitHub:

yarn add --dev KaplanTestPrep/react-app-rewire-css-modules react-app-rewired

Example

In your package.json

  /* package.json */

  "scripts": {
-   "start": "react-scripts start",
+   "start": "react-app-rewired start",
-   "build": "react-scripts build",
+   "build": "react-app-rewired build",
-   "test": "react-scripts test --env=jsdom",
+   "test": "react-app-rewired test --env=jsdom"
}

In your react-app-rewired configuration:

/* config-overrides.js */
const rewireCssModules = require('react-app-rewire-css-modules');
const customProperties = {
  '--checkbox-color': 'purple',
  '--input-text-label-color': 'purple'
};

module.exports = function override(config, env, customProperties) {
  config = rewireCssModules(config, env, customProperties);
  return config;
};

In your React application:

// src/App.css

.app {
  color: aqua;
  
  &:hover {
    color: lawngreen;
  }
}
// src/App.js

import React from 'react';
import styles from './App.css';
import { Input } from '@abot/react-higgs/lib/input'; // Note: not from @abot/react-higgs/lib/input/Input


export default ({text}) => (
    <div>
      <div className={styles.app}>{text}</div>
      <Input label="xxx" />
    </div>
)

FAQs

Package last updated on 23 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc