Hold the tile title still in edit mode, and thin crowded slider ticks
The grip's `-m-1 p-1` pair cancelled on three sides only: `.dui-frame-head` sets `margin-top: -0.5rem` unlayered in core.css, which beats a Tailwind utility, so the padding above went uncancelled and the title dropped 4px the moment the editor opened. The grip's geometry moves into core.css beside the head's own half step, where one declaration cancels all four sides. Slider tick labels were placed in percent with nothing measured, so five four-character labels crowded on a tile narrower than the default four columns. A ResizeObserver on the slider reports its width and every Nth label is kept, N a divisor of the interval count so the first and last stay.
This commit is contained in:
@@ -105,7 +105,7 @@ export function Switch(props: SwitchProps) {
|
||||
}
|
||||
|
||||
export function Slider(props: SliderProps) {
|
||||
const { fraction, inputProps, marks } = useSliderDrag(props)
|
||||
const { fraction, inputProps, marks, trackRef } = useSliderDrag(props)
|
||||
const orientation = props.orientation ?? "horizontal"
|
||||
return (
|
||||
<div
|
||||
@@ -114,6 +114,7 @@ export function Slider(props: SliderProps) {
|
||||
orientation === "horizontal" && "w-full",
|
||||
)}
|
||||
data-orientation={orientation}
|
||||
ref={trackRef}
|
||||
style={{ "--dui-fraction": fraction } as React.CSSProperties}
|
||||
>
|
||||
<div className="dui-slider-body">
|
||||
|
||||
Reference in New Issue
Block a user