diff --git a/src/components/range/range.styles.ts b/src/components/range/range.styles.ts index 9257888db..801346b78 100644 --- a/src/components/range/range.styles.ts +++ b/src/components/range/range.styles.ts @@ -6,7 +6,7 @@ export default css` --thumb-gap: calc(var(--thumb-size) * 0.125); --thumb-shadow: initial; --thumb-size: calc(1rem * var(--wa-form-control-value-line-height)); - --tooltip-offset: var(--wa-tooltip-arrow-size); + --tooltip-offset: calc(var(--wa-tooltip-arrow-size) * 1.375); --track-color-active: var(--wa-color-neutral-fill-normal); --track-color-inactive: var(--wa-color-neutral-fill-normal); --track-active-offset: 0%; @@ -179,8 +179,7 @@ export default css` /* Tooltip on top */ .range--tooltip-top .range__tooltip { - /*top: calc(-1 * var(--thumb-size) - (var(--wa-tooltip-arrow-size) * 1.5) - var(--tooltip-offset));*/ - top: calc(-1 * (var(--thumb-size) * 0.5) - var(--tooltip-offset)); + bottom: calc(50% + (var(--thumb-size) / 2) + var(--tooltip-offset)); } .range--tooltip-top .range__tooltip:after { @@ -192,7 +191,7 @@ export default css` /* Tooltip on bottom */ .range--tooltip-bottom .range__tooltip { - bottom: calc(-1 * var(--thumb-size) - var(--tooltip-offset)); + top: calc(50% + (var(--thumb-size) / 2) + var(--tooltip-offset)); } .range--tooltip-bottom .range__tooltip:after { diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 018238622..e851b5e63 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -44,7 +44,7 @@ import type { CSSResultGroup } from 'lit'; * @cssproperty --thumb-gap - The visual gap between the edges of the thumb and the track. * @cssproperty --thumb-shadow - The shadow effects around the edges of the thumb. * @cssproperty --thumb-size - The size of the thumb. - * @cssproperty --tooltip-offset - The vertical distance the tooltip is offset from the track. + * @cssproperty --tooltip-offset - The vertical distance the tooltip is offset from the thumb. * @cssproperty --track-color-active - The color of the portion of the track that represents the current value. * @cssproperty --track-color-inactive - The of the portion of the track that represents the remaining value. * @cssproperty --track-height - The height of the track.