Skip to content

Commit

Permalink
fix(tooltip): animation transform defined in tooltip instead of inher…
Browse files Browse the repository at this point in the history
…ited
  • Loading branch information
mdt2 committed Nov 7, 2023
1 parent 36e25dc commit 8ba3aaf
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions components/tooltip/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +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;
transform: translateY(calc(-1 * var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance))));
}
}

Expand All @@ -416,8 +415,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;
transform: translateY(var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance)));
}
}

Expand All @@ -430,8 +428,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;
transform: translateX(var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance)));
}
}

Expand All @@ -444,8 +441,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;
transform: translateX(calc(-1 * var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance))));
}
}

Expand All @@ -458,15 +454,13 @@ 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;
transform: translateX(calc(-1 * var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance))));
}

/* 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;
transform: translateX(var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance)));
}
}
}
Expand All @@ -480,15 +474,13 @@ 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;
transform: translateX(var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance)));
}

/* 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;
transform: translateX(calc(-1 * var(--mod-tooltip-animation-distance, var(--spectrum-tooltip-animation-distance))));
}
}
}
Expand Down

0 comments on commit 8ba3aaf

Please sign in to comment.