Skip to content

Commit 64cccc5

Browse files
authored
fix(components): alert component icon position (#1881)
* fix(components): revert Alert icon translateY to 2px * fix(components): adjust dismiss button size and placement to better align with other elements * fix(components): tweaking the padding and dismiss sizing and position * chore(changeset): add empty changeset * fix(components): remove commented out CSS * fix(components): use a token for translateY of icon * chore: make changeset a patch instead of being empty * chore(stories): fix typo
1 parent 655be42 commit 64cccc5

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

.changeset/cyan-garlics-ask.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@launchpad-ui/components': patch
3+
---
4+
5+
Update Alert padding and icon position

packages/components/src/styles/Alert.module.css

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
.default,
5252
.inline {
53-
padding: var(--lp-spacing-400);
53+
padding: var(--lp-spacing-500);
5454
background-color: var(--alert-color-bg-neutral);
5555
border: 1px solid var(--alert-color-border-neutral);
5656
position: relative;
@@ -79,7 +79,7 @@
7979
&:has(.heading) {
8080
/* biome-ignore lint/style/noDescendingSpecificity: ignore */
8181
& .icon {
82-
transform: translateY(4px);
82+
transform: translateY(var(--lp-size-2));
8383
}
8484
}
8585

@@ -92,6 +92,7 @@
9292
.inline {
9393
align-items: center;
9494
gap: var(--lp-spacing-300);
95+
padding: var(--lp-spacing-400) var(--lp-spacing-500);
9596

9697
& .close {
9798
margin-left: var(--lp-spacing-300);
@@ -106,7 +107,7 @@
106107
/* Adjust padding so the alert maintains the same height if there's an inline action or close button. We have to hardcode the vertical values because of the way borders get calculated as a part of an element's dimensions. */
107108
&:has(.inlineAction),
108109
&:has(.close) {
109-
padding: 7px var(--lp-spacing-300) 7px var(--lp-spacing-400);
110+
padding: 7px var(--lp-spacing-300) 7px var(--lp-spacing-500);
110111
}
111112

112113
&:has(.inlineAction) {
@@ -138,6 +139,11 @@
138139
margin-top: var(--lp-spacing-500);
139140
}
140141

142+
.default .close {
143+
bottom: var(--lp-spacing-300);
144+
left: var(--lp-spacing-300);
145+
}
146+
141147
/* Sometimes we want to make text bold, but we need to make sure this maps to the correct font weight. */
142148
.content strong,
143149
.content b {

packages/components/stories/Alert.stories.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const InlineDefault: Story = {
5555
args: {
5656
children: (
5757
<Text>
58-
Flag a prerequisite of <strong>1 other flag</strong> in <strong>production</strong>
58+
Flag is a prerequisite of <strong>1 other flag</strong> in <strong>production</strong>
5959
</Text>
6060
),
6161
variant: 'inline',
@@ -103,11 +103,10 @@ export const InlineInfo: Story = {
103103
args: {
104104
children: (
105105
<Text>
106-
Flag a prerequisite of <strong>1 other flag</strong> in <strong>production</strong>
106+
Flag is a prerequisite of <strong>1 other flag</strong> in <strong>production</strong>
107107
</Text>
108108
),
109109
variant: 'inline',
110-
isDismissable: true,
111110
status: 'info',
112111
},
113112
};

0 commit comments

Comments
 (0)