Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add storybook css interface (4/7) #164

Merged
merged 2 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .storybook-css/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const path = require('path');

module.exports = {
module: {
loaders: [
{
test: /\.css?$/,
loaders: [ 'style', 'raw' ],
include: path.resolve(__dirname, '../')
}
]
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"prepublish": "in-publish && safe-publish-latest && npm run build || not-in-publish",
"lint": "eslint --ext .js,.jsx src test stories",
"storybook": "start-storybook -p 9001",
"prestorybook:css": "npm run build:css",
"storybook:css": "start-storybook -p 6006 -c .storybook-css",
"pretest": "npm run build && npm run lint",
"test": "nyc npm run test:all",
"tests-only": "npm run test:all",
Expand Down
6 changes: 0 additions & 6 deletions src/Slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -747,15 +747,10 @@ class Rheostat extends React.Component {
} = this.props;

const {
handleDimensions,
handlePos,
values,
} = this.state;

const handleContainerStyle = orientation === VERTICAL
? { left: 0, bottom: handleDimensions / 2, top: handleDimensions / 2 }
: { top: 0, left: handleDimensions / 2, right: handleDimensions / 2 };

return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
<div
Expand All @@ -770,7 +765,6 @@ class Rheostat extends React.Component {
ref={this.setHandleContainerNode}
{...css(
styles.handleContainer,
handleContainerStyle,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out that this didn't actually do anything, and was just being overridden. Since it is not overridden with the CSS interface, and was causing graphical issues, I removed it.

styles.rheostat_background,
orientation === VERTICAL
? styles.rheostat_background__vertical
Expand Down