Skip to content

Commit

Permalink
Fix style of Tooltip arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
sabigara committed May 15, 2023
1 parent d71aa94 commit 53614db
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-meals-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@camome/core": minor
---

Fix style of Tooltip arrow
14 changes: 8 additions & 6 deletions packages/core/src/components/Tooltip/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
bottom: 100%;

&:before {
// `locals.$arrowSize * 2 * -1` works on Chrome but not Safari
bottom: calc(locals.$arrowSize * 1.9 * -1);
bottom: calc(locals.$arrowSize * 2 * -1 + 1px);
left: 50%;
translate: calc(locals.$arrowSize * -1);
border-top: locals.$arrowSize solid var(--cmm-Tooltip-bg);
Expand All @@ -76,8 +75,9 @@
left: 100%;

&:before {
// `locals.$arrowSize * 2 * -1` works on Chrome but not Safari
left: calc(locals.$arrowSize * 1.9 * -1);
top: 50%;
left: calc(locals.$arrowSize * 2 * -1 + 1px);
translate: 0 -50%;
border-right: locals.$arrowSize solid var(--cmm-Tooltip-bg);
}
}
Expand All @@ -88,7 +88,7 @@
top: 100%;

&:before {
top: calc(locals.$arrowSize * 1.9 * -1);
top: calc(locals.$arrowSize * 2 * -1 + 1px);
left: 50%;
translate: calc(locals.$arrowSize * -1);
border-bottom: locals.$arrowSize solid var(--cmm-Tooltip-bg);
Expand All @@ -101,7 +101,9 @@
right: 100%;

&:before {
right: calc(locals.$arrowSize * 1.9 * -1);
top: 50%;
right: calc(locals.$arrowSize * 2 * -1 + 1px);
translate: 0 -50%;
border-left: locals.$arrowSize solid var(--cmm-Tooltip-bg);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Tooltip/variables.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$arrowSize_name: --cmm-Tooltip-arrow-size;
$arrowSize: var($arrowSize_name, 0.3rem);
$arrowSize: var($arrowSize_name, 6px);
$offset_name: --cmm-Tooltip-offset;
$offset: var($offset_name, 0.2rem);
2 changes: 1 addition & 1 deletion packages/core/src/components/Tooltip/variables.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentCssVariables } from "../../types";

const variables = {
arrowSize: "0.3rem",
arrowSize: "6px",
offset: "0.2rem",
} as const satisfies ComponentCssVariables;

Expand Down

1 comment on commit 53614db

@vercel
Copy link

@vercel vercel bot commented on 53614db May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.