From d8b64e30498a0134960d48230dbb478254c8b17e Mon Sep 17 00:00:00 2001 From: barsnes Date: Tue, 15 Oct 2024 08:16:07 +0200 Subject: [PATCH 1/4] chore(button): add `min-width` to SVG and images --- packages/css/button.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/css/button.css b/packages/css/button.css index abcc45436a..b614611b2c 100644 --- a/packages/css/button.css +++ b/packages/css/button.css @@ -29,6 +29,11 @@ text-align: inherit; text-decoration: none; + & svg, + & img { + min-width: 1em; + } + &:focus-visible { position: relative; /* Place focusring on top */ } From 6afb4e964c38d1b8c1af18af49f89cc897d823d1 Mon Sep 17 00:00:00 2001 From: Tobias Barsnes Date: Tue, 15 Oct 2024 08:23:54 +0200 Subject: [PATCH 2/4] Create mighty-buttons-yell.md --- .changeset/mighty-buttons-yell.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mighty-buttons-yell.md diff --git a/.changeset/mighty-buttons-yell.md b/.changeset/mighty-buttons-yell.md new file mode 100644 index 0000000000..0fa7f7b62d --- /dev/null +++ b/.changeset/mighty-buttons-yell.md @@ -0,0 +1,5 @@ +--- +"@digdir/designsystemet-css": patch +--- + +Button: Add `min-width: 1em` to SVG and images From ba224bb89f97d7dfc831ed7eb626b0ebbb119cd7 Mon Sep 17 00:00:00 2001 From: barsnes Date: Tue, 15 Oct 2024 09:20:22 +0200 Subject: [PATCH 3/4] shrink --- packages/css/button.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/css/button.css b/packages/css/button.css index b614611b2c..8aa49a1cbc 100644 --- a/packages/css/button.css +++ b/packages/css/button.css @@ -31,7 +31,7 @@ & svg, & img { - min-width: 1em; + flex-shrink: 0; } &:focus-visible { From 441a1b099c7e41dadaa4902aeef6488d9e5f99d7 Mon Sep 17 00:00:00 2001 From: Tobias Barsnes Date: Tue, 15 Oct 2024 09:25:55 +0200 Subject: [PATCH 4/4] Update .changeset/mighty-buttons-yell.md Co-authored-by: Michael Marszalek --- .changeset/mighty-buttons-yell.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/mighty-buttons-yell.md b/.changeset/mighty-buttons-yell.md index 0fa7f7b62d..2e57921df9 100644 --- a/.changeset/mighty-buttons-yell.md +++ b/.changeset/mighty-buttons-yell.md @@ -2,4 +2,4 @@ "@digdir/designsystemet-css": patch --- -Button: Add `min-width: 1em` to SVG and images +Button: Fix SVG and images shrinking in flex containers