Skip to content

Commit eedb9a2

Browse files
author
Philip Weiss
committed
add css storybook interface
1 parent e32f8c3 commit eedb9a2

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.storybook-css/webpack.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
module: {
5+
loaders: [
6+
{
7+
test: /\.css?$/,
8+
loaders: [ 'style', 'raw' ],
9+
include: path.resolve(__dirname, '../')
10+
}
11+
]
12+
}
13+
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"prepublish": "in-publish && safe-publish-latest && npm run build || not-in-publish",
1515
"lint": "eslint --ext .js,.jsx src test stories",
1616
"storybook": "start-storybook -p 9001",
17+
"prestorybook:css": "npm run build:css",
18+
"storybook:css": "start-storybook -p 6006 -c .storybook-css",
1719
"pretest": "npm run build && npm run lint",
1820
"test": "nyc npm run test:all",
1921
"tests-only": "npm run test:all",
@@ -71,7 +73,6 @@
7173
},
7274
"dependencies": {
7375
"airbnb-prop-types": "^2.10.0",
74-
"clean-css": "^4.1.11",
7576
"object.assign": "^4.1.0",
7677
"prop-types": "^15.6.2",
7778
"react-with-styles": "^3.2.0",

src/Slider.jsx

-6
Original file line numberDiff line numberDiff line change
@@ -747,15 +747,10 @@ class Rheostat extends React.Component {
747747
} = this.props;
748748

749749
const {
750-
handleDimensions,
751750
handlePos,
752751
values,
753752
} = this.state;
754753

755-
const handleContainerStyle = orientation === VERTICAL
756-
? { left: 0, bottom: handleDimensions / 2, top: handleDimensions / 2 }
757-
: { top: 0, left: handleDimensions / 2, right: handleDimensions / 2 };
758-
759754
return (
760755
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
761756
<div
@@ -770,7 +765,6 @@ class Rheostat extends React.Component {
770765
ref={this.setHandleContainerNode}
771766
{...css(
772767
styles.handleContainer,
773-
handleContainerStyle,
774768
styles.rheostat_background,
775769
orientation === VERTICAL
776770
? styles.rheostat_background__vertical

0 commit comments

Comments
 (0)