Skip to content

Commit

Permalink
[Slider] Remove visual zero state from thumb (#12242)
Browse files Browse the repository at this point in the history
* [Slider]: Remove visual zero state from thumb

The spec does not show any visual difference between thumbs at zero and
non-zero values. Zero values now allow different thumb colors depending
on state (i.e. enabled sliders appeared to be disabled).
  • Loading branch information
eps1lon authored and mbrookes committed Jul 25, 2018
1 parent 245f973 commit a9aad33
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
1 change: 0 additions & 1 deletion packages/material-ui-lab/src/Slider/Slider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export type SliderClassKey =
| 'focused'
| 'activated'
| 'disabled'
| 'zero'
| 'vertical'
| 'reverse'
| 'jumped';
Expand Down
18 changes: 1 addition & 17 deletions packages/material-ui-lab/src/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,6 @@ export const styles = theme => {
height: 9,
backgroundColor: colors.disabled,
},
'&$zero': {
border: `2px solid ${colors.disabled}`,
backgroundColor: 'transparent',
},
'&$focused$zero': {
border: `2px solid ${colors.primary}`,
backgroundColor: fade(colors.primary, 0.34),
boxShadow: `0px 0px 0px 9px ${fade(colors.primary, 0.34)}`,
},
'&$activated$zero': {
border: `2px solid ${colors.primary}`,
},
'&$jumped': {
width: 17,
height: 17,
Expand All @@ -143,8 +131,6 @@ export const styles = theme => {
activated: {},
/* Class applied to the root, track and container to trigger JSS nested styles if `vertical`. */
vertical: {},
/* Class applied to the thumb to trigger nested styles if `value` = `min` . */
zero: {},
};
};

Expand Down Expand Up @@ -440,9 +426,7 @@ class Slider extends React.Component {
[classes.vertical]: vertical,
});

const thumbClasses = classNames(classes.thumb, commonClasses, {
[classes.zero]: percent === 0,
});
const thumbClasses = classNames(classes.thumb, commonClasses);

const trackProperty = vertical ? 'height' : 'width';
const thumbProperty = vertical ? 'top' : 'left';
Expand Down
1 change: 0 additions & 1 deletion pages/lab/api/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ This property accepts the following keys:
| <span class="prop-name">focused</span> | Class applied to the track and thumb elements to trigger JSS nested styles if `focused`.
| <span class="prop-name">activated</span> | Class applied to the track and thumb elements to trigger JSS nested styles if `activated`.
| <span class="prop-name">vertical</span> | Class applied to the root, track and container to trigger JSS nested styles if `vertical`.
| <span class="prop-name">zero</span> | Class applied to the thumb to trigger nested styles if `value` = `min` .

Have a look at [overriding with classes](/customization/overrides#overriding-with-classes) section
and the [implementation of the component](https://github.com/mui-org/material-ui/tree/master/packages/material-ui-lab/src/Slider/Slider.js)
Expand Down

0 comments on commit a9aad33

Please sign in to comment.