Skip to content

Commit da05e8d

Browse files
committed
use sx
1 parent 552f608 commit da05e8d

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

docs/src/pages/components/slider/VerticalAccessibleSlider.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,8 @@ import * as React from 'react';
22
import Box from '@material-ui/core/Box';
33
import Typography from '@material-ui/core/Typography';
44
import Slider from '@material-ui/core/Slider';
5-
import { makeStyles } from '@material-ui/core/styles';
6-
7-
const useStyles = makeStyles({
8-
forceWebkitVerticalOrientation: {
9-
'& input[type="range"]': {
10-
'-webkitAppearance': 'slider-vertical',
11-
},
12-
},
13-
});
145

156
export default function VerticalSlider() {
16-
const classes = useStyles();
17-
187
function preventHorizontalKeyboardNavigation(event) {
198
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
209
event.preventDefault();
@@ -28,7 +17,11 @@ export default function VerticalSlider() {
2817
</Typography>
2918
<Box sx={{ height: 300 }}>
3019
<Slider
31-
className={classes.forceWebkitVerticalOrientation}
20+
sx={{
21+
'& input[type="range"]': {
22+
WebkitAppearance: 'slider-vertical',
23+
},
24+
}}
3225
orientation="vertical"
3326
defaultValue={30}
3427
aria-labelledby="vertical-accessible-slider"

docs/src/pages/components/slider/VerticalAccessibleSlider.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,8 @@ import * as React from 'react';
22
import Box from '@material-ui/core/Box';
33
import Typography from '@material-ui/core/Typography';
44
import Slider from '@material-ui/core/Slider';
5-
import { makeStyles } from '@material-ui/core/styles';
6-
7-
const useStyles = makeStyles({
8-
forceWebkitVerticalOrientation: {
9-
'& input[type="range"]': {
10-
'-webkitAppearance': 'slider-vertical',
11-
},
12-
},
13-
});
145

156
export default function VerticalSlider() {
16-
const classes = useStyles();
17-
187
function preventHorizontalKeyboardNavigation(event: React.KeyboardEvent) {
198
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
209
event.preventDefault();
@@ -28,7 +17,11 @@ export default function VerticalSlider() {
2817
</Typography>
2918
<Box sx={{ height: 300 }}>
3019
<Slider
31-
className={classes.forceWebkitVerticalOrientation}
20+
sx={{
21+
'& input[type="range"]': {
22+
WebkitAppearance: 'slider-vertical',
23+
},
24+
}}
3225
orientation="vertical"
3326
defaultValue={30}
3427
aria-labelledby="vertical-accessible-slider"

0 commit comments

Comments
 (0)