Skip to content

Commit 391aadf

Browse files
authored
Merge pull request #164 from airbnb/pw--add-storybook-css-interface
Add storybook css interface (4/7)
2 parents f54c6b5 + f5bd378 commit 391aadf

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
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
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",

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)