Skip to content

Commit 160079c

Browse files
committed
fix slider style
1 parent d9bae1f commit 160079c

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

packages/actify/src/components/Sliders/Thumb.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ const Thumb = (props: ThumbProps) => {
4747
>
4848
<div className={styles['thumb']}>
4949
<VisuallyHidden>
50-
<input ref={inputRef} {...mergeProps(inputProps, focusProps)} />
50+
<input
51+
ref={inputRef}
52+
className={styles['input']}
53+
{...mergeProps(inputProps, focusProps)}
54+
/>
5155
</VisuallyHidden>
5256
{isFocusVisible && <FocusRing />}
5357
<Ripple id={inputProps.id} disabled={state.isDisabled} />

packages/actify/src/components/Sliders/slider.module.css

+17-2
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167

168168
.slider.horizontal .track {
169169
height: 40px;
170+
margin: 0 auto;
170171
width: calc(100% - var(--_state-layer-size));
171172
}
172173

@@ -223,10 +224,11 @@
223224

224225
.slider.horizontal .track:before,
225226
.slider.horizontal .track:after {
226-
height: var(--_active-track-height);
227-
width: 100%;
228227
top: 50%;
229228
transform: translateY(-50%);
229+
height: var(--_active-track-height);
230+
width: 100%;
231+
left: 0;
230232
}
231233

232234
.slider.vertical .track {
@@ -256,6 +258,19 @@
256258
background: var(--_handle-color);
257259
border-radius: var(--_handle-shape);
258260
}
261+
.input {
262+
opacity: 0;
263+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
264+
position: absolute;
265+
box-sizing: border-box;
266+
height: 100%;
267+
width: 100%;
268+
margin: 0px;
269+
background: rgba(0, 0, 0, 0);
270+
cursor: pointer;
271+
pointer-events: auto;
272+
appearance: none;
273+
}
259274

260275
.slider.horizontal .handle {
261276
top: 50%;

0 commit comments

Comments
 (0)