Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit d4846dd

Browse files
committed
Inline styles automatically, no longer require loading external stylesheet
1 parent 2cc79db commit d4846dd

File tree

5 files changed

+967
-21
lines changed

5 files changed

+967
-21
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ First you'll need a wrapper component which will handle the updates from your da
6464
```jsx
6565
import React, { Component } from 'react';
6666
import DatGui, { DatBoolean, DatColor, DatNumber, DatString } from 'react-dat-gui';
67-
import 'react-dat-gui/dist/index.css';
6867

6968
class App extends Component {
7069
state = {

example/components/ReactDatGui.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import DatGui, {
99
DatSelect,
1010
DatString
1111
} from 'react-dat-gui';
12-
import 'react-dat-gui/dist/index.css';
1312
import Stats from './Stats';
1413

1514
/**

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-dat-gui",
3-
"version": "3.0.0",
2+
"name": "@tim-soft/react-dat-gui",
3+
"version": "4.0.9",
44
"description": "dat.GUI reimagined for React",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.es.js",
@@ -78,6 +78,7 @@
7878
"@babel/preset-react": "^7.0.0",
7979
"@testing-library/jest-dom": "^4.1.0",
8080
"@testing-library/react": "^9.1.3",
81+
"autoprefixer": "^9.6.1",
8182
"babel-eslint": "10.0.2",
8283
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
8384
"babel-polyfill": "^6.26.0",
@@ -101,6 +102,7 @@
101102
"rollup-plugin-commonjs": "^10.0.2",
102103
"rollup-plugin-filesize": "^6.2.0",
103104
"rollup-plugin-node-resolve": "^5.2.0",
105+
"rollup-plugin-postcss": "^2.0.3",
104106
"rollup-plugin-scss": "^1.0.2"
105107
},
106108
"peerDependencies": {

rollup.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import babel from 'rollup-plugin-babel';
33
import commonjs from 'rollup-plugin-commonjs';
44
import filesize from 'rollup-plugin-filesize';
55
import resolve from 'rollup-plugin-node-resolve';
6-
import scss from 'rollup-plugin-scss';
6+
import postcss from 'rollup-plugin-postcss';
7+
import autoprefixer from 'autoprefixer';
78
import pkg from './package.json';
89

910
const root = process.platform === 'win32' ? path.resolve('/') : '/';
@@ -27,8 +28,10 @@ export default {
2728
sourcemap: true
2829
}
2930
],
30-
external: id => !id.startsWith('.') && !id.startsWith(root),
31+
external: id =>
32+
!id.startsWith('.') && !id.startsWith(root) && !id.includes('style-inject'),
3133
plugins: [
34+
postcss({ plugins: [autoprefixer] }),
3235
babel({
3336
exclude: 'node_modules/**',
3437
runtimeHelpers: true
@@ -37,9 +40,6 @@ export default {
3740
commonjs({
3841
include: 'node_modules/**'
3942
}),
40-
scss({
41-
output: 'dist/index.css'
42-
}),
4343
filesize()
4444
]
4545
};

0 commit comments

Comments
 (0)