Skip to content

Commit

Permalink
feat: provide vanilla HTML implementation for Body and Root component
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Feb 15, 2025
1 parent 729f698 commit f54840f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-cats-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/body-css": minor
---

Provide `.css` file for the `body` selector for styling vanilla HTML.
5 changes: 5 additions & 0 deletions .changeset/tasty-bees-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/root-css": minor
---

Provide `.css` file for the `:root` selector for styling vanilla HTML.
13 changes: 13 additions & 0 deletions components/body/src/html/_mixin.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
9 changes: 9 additions & 0 deletions components/body/src/html/index.scss
Original file line number Diff line number Diff line change
@@ -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;
23 changes: 23 additions & 0 deletions components/root/src/html/_mixin.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
9 changes: 9 additions & 0 deletions components/root/src/html/index.scss
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f54840f

Please sign in to comment.