mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
docs: fix leaky body styles for framed content
This commit is contained in:
parent
170d9993f4
commit
9956cd5e8a
1 changed files with 10 additions and 1 deletions
|
@ -1,11 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
document.body.classList.add("framed");
|
||||||
|
return () => {
|
||||||
|
document.body.classList.remove("framed");
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// TODO: [refactor] parse search parameters more reliably
|
// TODO: [refactor] parse search parameters more reliably
|
||||||
$: currentTheme = window.location.search.split("?theme=")[1];
|
$: currentTheme = window.location.search.split("?theme=")[1];
|
||||||
$: document.documentElement.setAttribute("theme", currentTheme);
|
$: document.documentElement.setAttribute("theme", currentTheme);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
:global(body) {
|
:global(body.framed) {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: var(--cds-spacing-06) var(--cds-spacing-05);
|
padding: var(--cds-spacing-06) var(--cds-spacing-05);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue