Skip to content

Commit

Permalink
Button, ButtonLink: Ensure inner label is full width (#1671)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltaranto authored Dec 18, 2024
1 parent da61412 commit f91ac70
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .changeset/four-cups-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'braid-design-system': patch
---

---
updated:
- Button
- ButtonLink
---

**Button, ButtonLink:** Ensure inner label is full width

Ensuring the inner label element is full width to maintain backwards compatibility with previous block layout.
Original file line number Diff line number Diff line change
Expand Up @@ -518,5 +518,34 @@ export const screenshots: ComponentScreenshot = {
</Stack>
),
},
{
label:
'Ensure inner label element is full width (red dots should touch horizontal edges)',
Example: () => (
<Button>
<Box position="absolute" left={0}>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
height={24}
width={24}
>
<circle cx="12" cy="12" r="10" fill="red" />
</svg>
</Box>
<Box position="absolute" right={0}>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
height={24}
width={24}
>
<circle cx="12" cy="12" r="10" fill="red" />
</svg>
</Box>
Label
</Button>
),
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ export const ButtonText = ({
position="relative"
display="flex"
justifyContent="center"
flexGrow={1}
flexWrap="wrap"
overflow="hidden"
pointerEvents="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,5 +325,34 @@ export const screenshots: ComponentScreenshot = {
</Stack>
),
},
{
label:
'Ensure inner label element is full width (red dots should touch horizontal edges)',
Example: () => (
<ButtonLink href="#">
<Box position="absolute" left={0}>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
height={24}
width={24}
>
<circle cx="12" cy="12" r="10" fill="red" />
</svg>
</Box>
<Box position="absolute" right={0}>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
height={24}
width={24}
>
<circle cx="12" cy="12" r="10" fill="red" />
</svg>
</Box>
Label
</ButtonLink>
),
},
],
};

0 comments on commit f91ac70

Please sign in to comment.