Skip to content
Merged
Changes from 2 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
9 changes: 7 additions & 2 deletions docs/data/material/customization/color/ColorTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ function ColorTool() {
);
};

const COLOR_WIDTH = 156;
const SLIDER_WIDTH_CALC = 'calc(100% - 80px)';

const colorPicker = (intent) => {
const intentInput = state[`${intent}Input`];
const intentShade = state[`${intent}Shade`];
Expand All @@ -229,15 +232,17 @@ function ColorTool() {
<Box sx={{ display: 'flex', alignItems: 'center', mt: 2, mb: 2 }}>
<Typography id={`${intent}ShadeSliderLabel`}>Shade:</Typography>
<Slider
sx={{ width: 'calc(100% - 80px)', ml: 3, mr: 3 }}
sx={{ width: SLIDER_WIDTH_CALC, ml: 3, mr: 3 }}
value={intentShade}
min={0}
max={13}
step={1}
onChange={handleChangeShade(intent)}
aria-labelledby={`${intent}ShadeSliderLabel`}
/>
<Typography>{shades[intentShade]}</Typography>
<div style={{ width: `${COLOR_WIDTH}px` }}>
<Typography>{shades[intentShade]}</Typography>
</div>
</Box>
<Box sx={{ width: 192 }}>
{hues.map((hue) => {
Expand Down