diff --git a/.changeset/fuzzy-cats-cough.md b/.changeset/fuzzy-cats-cough.md new file mode 100644 index 0000000000..46ba350393 --- /dev/null +++ b/.changeset/fuzzy-cats-cough.md @@ -0,0 +1,5 @@ +--- +"@utrecht/body-css": minor +--- + +Provide `.css` file for the `body` selector for styling vanilla HTML. diff --git a/.changeset/tasty-bees-marry.md b/.changeset/tasty-bees-marry.md new file mode 100644 index 0000000000..046f5fa01d --- /dev/null +++ b/.changeset/tasty-bees-marry.md @@ -0,0 +1,5 @@ +--- +"@utrecht/root-css": minor +--- + +Provide `.css` file for the `:root` selector for styling vanilla HTML. diff --git a/components/body/src/html/_mixin.scss b/components/body/src/html/_mixin.scss new file mode 100644 index 0000000000..3658cd9ee6 --- /dev/null +++ b/components/body/src/html/_mixin.scss @@ -0,0 +1,13 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +@import "../mixin"; + +@mixin utrecht-html-body { + body { + @include utrecht-body; + } +} diff --git a/components/body/src/html/index.scss b/components/body/src/html/index.scss new file mode 100644 index 0000000000..efd8e7b85a --- /dev/null +++ b/components/body/src/html/index.scss @@ -0,0 +1,9 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +@import "./mixin"; + +@include utrecht-html-body; diff --git a/components/root/src/html/_mixin.scss b/components/root/src/html/_mixin.scss new file mode 100644 index 0000000000..2dd4c40c4c --- /dev/null +++ b/components/root/src/html/_mixin.scss @@ -0,0 +1,23 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +@import "../mixin"; + +@mixin utrecht-html-html { + html { + @include utrecht-root; + } +} + +/** + * Match `:root` instead of `html`, to avoid styling when a template + * accidentally renders an extraneous `html` element inside the `body`. + */ +@mixin utrecht-html-root { + :root { + @include utrecht-root; + } +} diff --git a/components/root/src/html/index.scss b/components/root/src/html/index.scss new file mode 100644 index 0000000000..49345da2d2 --- /dev/null +++ b/components/root/src/html/index.scss @@ -0,0 +1,9 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +@import "./mixin"; + +@include utrecht-html-root;