Skip to content

Commit

Permalink
Reduce gap between steps in SpacingSizesControl, add animation, remov…
Browse files Browse the repository at this point in the history
…e first/last marks (#63803)

Co-authored-by: jameskoster <[email protected]>
Co-authored-by: stokesman <[email protected]>
Co-authored-by: richtabor <[email protected]>
Co-authored-by: paaljoachim <[email protected]>
Co-authored-by: bgardner <[email protected]>
  • Loading branch information
6 people authored Aug 8, 2024
1 parent 5d408ce commit c48075b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,12 @@ export default function SpacingInputControl( {
name: size.name,
} ) );

const marks = spacingSizes.map( ( _newValue, index ) => ( {
value: index,
label: undefined,
} ) );
const marks = spacingSizes
.slice( 1, spacingSizes.length - 1 )
.map( ( _newValue, index ) => ( {
value: index + 1,
label: undefined,
} ) );

const sideLabel =
ALL_SIDES.includes( side ) && showSideInLabel ? LABELS[ side ] : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
margin-bottom: 0;
}

.is-marked {
.components-range-control__track {
transition: width ease 0.1s;
@include reduce-motion("transition");
}

.components-range-control__thumb-wrapper {
transition: left ease 0.1s;
@include reduce-motion("transition");
}
}

.spacing-sizes-control__range-control,
.spacing-sizes-control__custom-value-range {
height: 40px;
Expand All @@ -20,18 +32,16 @@
}

.components-range-control__mark {
transform: translateX(-50%);
height: $grid-unit-05;
width: 3px;
background-color: #fff;
width: math.div($grid-unit-05, 2);
background-color: $white;
z-index: 1;
top: -#{$grid-unit-05};
}

.components-range-control__marks {
margin-top: 17px;

:first-child {
display: none;
}
}

.components-range-control__thumb-wrapper {
Expand Down

0 comments on commit c48075b

Please sign in to comment.