Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davibe/next.js-css-poller
React "hot reloaded" global styles for Next.js
https://github.com/davibe/next.js-css-poller
Last synced: about 1 month ago
JSON representation
React "hot reloaded" global styles for Next.js
- Host: GitHub
- URL: https://github.com/davibe/next.js-css-poller
- Owner: davibe
- Created: 2017-01-28T15:49:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-29T08:24:04.000Z (almost 8 years ago)
- Last Synced: 2024-10-13T17:56:01.709Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
README
------Next.js has great support for scoped css thanks to `styled-jsx` implementation. However, using only styled-jsx and a large and existing project can be difficult and a bit extreme. Global styles however can be more familiar and most designers already know how to work with them.
This react component allows you to include `css` files in your pages. It does not matter how you generate the css file, wether you edit it directly, generate it with `less` or `sass` or you automatically build it with your editor. The file will be releloaded and if the style changes it will be applied.
Unfortunately this is using http polling to pick up changes therefore has to be considered just an experiment and it can't be used in production. See notes.
### Install
npm install next.js-css-poller
### Example
export default () =>
ciao
### Notes
- Don't put this component inside next's Head component. It will not work properly.
- I am still looking for transparent way to avoid polling when in production.