From 1c67d531d8fbf13f015ece85f85d64d7bd521a2f Mon Sep 17 00:00:00 2001 From: Tobias Barsnes Date: Thu, 19 Sep 2024 14:03:07 +0200 Subject: [PATCH] style(textarea): use new field-sizing: content (#2463) implementing as dicussed in meeting 2024.09.19 --- .changeset/clever-cobras-rescue.md | 5 +++++ packages/css/textarea.css | 1 + .../src/components/form/Textarea/Textarea.stories.tsx | 7 +++++++ 3 files changed, 13 insertions(+) create mode 100644 .changeset/clever-cobras-rescue.md diff --git a/.changeset/clever-cobras-rescue.md b/.changeset/clever-cobras-rescue.md new file mode 100644 index 0000000000..83fa3a1120 --- /dev/null +++ b/.changeset/clever-cobras-rescue.md @@ -0,0 +1,5 @@ +--- +"@digdir/designsystemet-css": patch +--- + +Textarea: Use `field-sizing: content` diff --git a/packages/css/textarea.css b/packages/css/textarea.css index 3232dcce35..4dd04d7235 100644 --- a/packages/css/textarea.css +++ b/packages/css/textarea.css @@ -39,6 +39,7 @@ resize: vertical; background: var(--ds-color-neutral-background-default); color: var(--ds-color-neutral-text-default); + field-sizing: content; } .ds-textarea--sm .ds-textarea__input { diff --git a/packages/react/src/components/form/Textarea/Textarea.stories.tsx b/packages/react/src/components/form/Textarea/Textarea.stories.tsx index 8de61496a3..736a23a581 100644 --- a/packages/react/src/components/form/Textarea/Textarea.stories.tsx +++ b/packages/react/src/components/form/Textarea/Textarea.stories.tsx @@ -10,6 +10,13 @@ type Story = StoryObj; export default { title: 'Komponenter/Textarea', component: Textarea, + decorators: [ + (Story: StoryFn) => ( +
+ +
+ ), + ], } as Meta; export const Preview: Story = {