Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knpwrs/css-modules-electron
A require hook to compile and use CSS modules in Electron.
https://github.com/knpwrs/css-modules-electron
Last synced: 3 months ago
JSON representation
A require hook to compile and use CSS modules in Electron.
- Host: GitHub
- URL: https://github.com/knpwrs/css-modules-electron
- Owner: knpwrs
- License: mit
- Created: 2015-08-29T17:17:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-19T14:00:08.000Z (over 7 years ago)
- Last Synced: 2024-10-02T03:07:49.197Z (4 months ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 22
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# css-modules-electron
Load [CSS Modules] in [Electron]. Once registered, you can `require` CSS modules
and they will automatically be compiled and injected into the `head` element of
your [Electron] app.## Usage
This module has the same requirements as [`css-modules-require-hook`]. That
means you must have the following modules installed:* `postcss` version 4 or higher
* `postcss-modules-extract-imports`
* `postcss-modules-local-by-default`
* `postcss-modules-scope`You can register the hook in Electron by requiring the `register` module:
```js
require('css-modules-electron/register');
```You can also specify options using the same API as [`css-modules-require-hook`]
by requiring the core module directly:```js
require('css-modules-electron')({
// `css-modules-require-hook` options here
});
```See `example/src/front.js` for a working example.
## Running the Example
```sh
npm i
npm start
```[`css-modules-require-hook`]: https://github.com/css-modules/css-modules-require-hook/tree/552c64a920c6c0b67a6d47aac100e1a43ba781ef "css-modules-require-hook"
[CSS Modules]: https://github.com/css-modules "CSS Modules"
[Electron]: http://electron.atom.io/ "Electron"