From d75ffad0cb29df0d2ea5af7eab62de51d6745fc4 Mon Sep 17 00:00:00 2001 From: Eirik Backer Date: Fri, 8 Nov 2024 11:51:51 +0100 Subject: [PATCH] fix: move default background to body element (#2754) - Moves default background to `` element instead of `:root` to align with best practice and avoid conflicts when setting both background on body and :root - Fixes minor sizing issue on stories with custom css --- .changeset/fifty-hornets-hang.md | 5 +++++ apps/storybook/story-utils/customStylesDecorator.tsx | 1 + packages/css/base/base.css | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 .changeset/fifty-hornets-hang.md diff --git a/.changeset/fifty-hornets-hang.md b/.changeset/fifty-hornets-hang.md new file mode 100644 index 0000000000..368ba7a03b --- /dev/null +++ b/.changeset/fifty-hornets-hang.md @@ -0,0 +1,5 @@ +--- +"@digdir/designsystemet-css": patch +--- + +CSS: Move default background-color to `` element diff --git a/apps/storybook/story-utils/customStylesDecorator.tsx b/apps/storybook/story-utils/customStylesDecorator.tsx index fb9f9fdda3..64b9479835 100644 --- a/apps/storybook/story-utils/customStylesDecorator.tsx +++ b/apps/storybook/story-utils/customStylesDecorator.tsx @@ -41,6 +41,7 @@ export const customStylesDecorator: Decorator = (Story, ctx) => {
(not :root) to align with best practice */ +body, +[data-ds-color-mode] { color: var(--ds-color-neutral-text-default); background-color: var(--ds-color-neutral-background-default); }