Skip to content

Commit

Permalink
fix(tooltip): custom animation distance overrides overlay value
Browse files Browse the repository at this point in the history
  • Loading branch information
mdt2 committed Nov 6, 2023
1 parent ed24ed4 commit 36e25dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/tooltip/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ governing permissions and limitations under the License.
}

&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--open;
}

Expand Down Expand Up @@ -399,6 +400,7 @@ governing permissions and limitations under the License.

/* tooltip animates upward ⬆ */
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--top--open;
}
}
Expand All @@ -414,6 +416,7 @@ governing permissions and limitations under the License.

/* Tooltip animates downward ⬇ */
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--bottom--open;
}
}
Expand All @@ -427,6 +430,7 @@ governing permissions and limitations under the License.

/* Tooltip animates to right ⮕ */
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--right--open;
}
}
Expand All @@ -440,6 +444,7 @@ governing permissions and limitations under the License.

/* Tooltip animates to left ⬅ */
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--left--open;
}
}
Expand All @@ -453,12 +458,14 @@ governing permissions and limitations under the License.

/* LTR read, tooltip animates towards left ⬅ */
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--left--open;
}

/* RTL read, tooltip animates towards right ⮕ */
[dir="rtl"] & {
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--right--open;
}
}
Expand All @@ -473,12 +480,14 @@ governing permissions and limitations under the License.

/* LTR read, tooltip animates towards right ⮕ */
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--right--open;
}

/* RTL read, tooltip animates towards left ⬅ */
[dir="rtl"] & {
&.is-open {
--spectrum-overlay-animation-distance: var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance));
@inherit: %spectrum-overlay--left--open;
}
}
Expand Down

0 comments on commit 36e25dc

Please sign in to comment.