Skip to content

Commit 257925c

Browse files
committed
fix(tooltip): bg color in dark theme
1 parent b16b5df commit 257925c

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

docs/components/demos/tooltip/DemoTooltipBasic.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Hover Over Me
66
</ABtn>
77
<ABtn>
8+
<!-- ℹ️ You can also customize `--a-tooltip-bg-c` CSS var for changing tooltip background -->
89
<ATooltip class="[&_.a-tooltip]-bg-danger">
910
<span class="a-tooltip-text">
1011
<i class="i-bx-shield-x me-1" />

docs/guide/components/tooltip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Use `ATooltip` component's `text` prop to show passed text in tooltip.
1212
You can also use `default` slot to render custom content.
1313

1414
:::code DemoTooltipBasic
15-
<<< @/components/demos/tooltip/DemoTooltipBasic.vue{3,8-13}
15+
<<< @/components/demos/tooltip/DemoTooltipBasic.vue{3,9-14}
1616
:::
1717

1818
::::

packages/preset-theme-default/src/scss/index.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ $body-color: hsla(var(--a-base-c), 0.68);
6161
As this will be always on light background we will keep it static and choose color from light scheme
6262
*/
6363
--a-switch-icon-color: hsla(0, 10%, 20%, 0.68);
64+
65+
--a-tooltip-bg-c: 0,0%,8%;
6466
// #endregion all-css-vars
6567

6668
// !SECTION
@@ -77,6 +79,9 @@ $body-color: hsla(var(--a-base-c), 0.68);
7779

7880
// 👉 Switch
7981
--a-switch-default-color: 0, 0%, 16%;
82+
83+
// 👉 Tooltip
84+
--a-tooltip-bg-c: 0,0%,25%;
8085

8186
// !SECTION
8287
}

packages/preset-theme-default/src/shortcuts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const shortcuts: Exclude<Preset['shortcuts'], undefined | StaticShortcutMap> = [
164164

165165
// 👉 Tooltip
166166
'a-tooltip-wrapper': 'z-[54]',
167-
'a-tooltip': 'bg-[hsl(0,0%,8%)] em:px-2 em:py-1 em:rounded-lg',
167+
'a-tooltip': 'bg-[hsl(var(--a-tooltip-bg-c))] em:px-2 em:py-1 em:rounded-lg',
168168
'a-tooltip-text': 'em:text-sm text-white text-center',
169169

170170
// !SECTION Components

0 commit comments

Comments
 (0)