Skip to content

Commit d2c28c3

Browse files
fix: resolve icon-only button tooltip/label regression (#7253)
* refactor(button): consolidate shared styles * fix(tooltip): remove broken button specific styles from global mixin * fix(button): hide tooltips on disabled icon only button Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 05649fb commit d2c28c3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

packages/components/src/components/button/_button.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,18 @@
150150
&:focus svg {
151151
fill: currentColor;
152152
}
153-
}
154153

155-
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--btn--ghost:focus svg {
156-
fill: $icon-01;
154+
&.#{$prefix}--btn--disabled.#{$prefix}--tooltip--a11y::before,
155+
&.#{$prefix}--btn--disabled.#{$prefix}--tooltip--a11y::after,
156+
&.#{$prefix}--btn--disabled .#{$prefix}--assistive-text {
157+
margin: -1px;
158+
overflow: hidden;
159+
opacity: 0;
160+
clip: rect(0, 0, 0, 0);
161+
}
157162
}
158163

164+
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--btn--ghost:focus svg,
159165
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--btn--ghost:hover svg {
160166
fill: $icon-01;
161167
}

packages/components/src/globals/scss/_tooltip.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,6 @@
202202
opacity: 0;
203203
animation: none;
204204
}
205-
206-
&.#{$prefix}--btn--disabled.#{$prefix}--tooltip--a11y::before,
207-
&.#{$prefix}--btn--disabled.#{$prefix}--tooltip--a11y::after,
208-
&.#{$prefix}--btn--disabled .#{$prefix}--assistive-text {
209-
display: none;
210-
}
211205
}
212206

213207
// Tooltip

0 commit comments

Comments
 (0)