diff --git a/components/AutoGrid.css b/components/AutoGrid.css index 8a51413..645ba9e 100644 --- a/components/AutoGrid.css +++ b/components/AutoGrid.css @@ -1,5 +1,5 @@ -.components__auto_grid { - display: grid; - gap: var(--_gap); - margin-block: var(--_gap); -} \ No newline at end of file +:scope { + display: grid; + gap: var(--_gap); + margin-block: var(--_gap); +} diff --git a/components/AutoGrid.tsx b/components/AutoGrid.tsx index a4eddd9..bc26b2f 100644 --- a/components/AutoGrid.tsx +++ b/components/AutoGrid.tsx @@ -1,7 +1,10 @@ import { ComponentChildren, JSX } from 'preact' +import { getStyleScope, useSmartStylesheet } from ':plugins/SmartStylesheet.tsx' type Units = 'rem' | '%' | 'px' +const scope = getStyleScope(AutoGrid) + export function AutoGrid( { columnWidth, children, style }: { columnWidth: `${number}${Units}` @@ -9,9 +12,11 @@ export function AutoGrid( style?: JSX.CSSProperties }, ) { + useSmartStylesheet(import.meta, { scope }) + return (

{title}

diff --git a/components/CohabitInfoTable.tsx b/components/CohabitInfoTable.tsx index 9aba60e..e4ec886 100644 --- a/components/CohabitInfoTable.tsx +++ b/components/CohabitInfoTable.tsx @@ -1,3 +1,5 @@ +import { useSmartStylesheet } from ':plugins/SmartStylesheet.tsx' + export function CohabitInfoTable() { return (
@@ -8,6 +10,8 @@ export function CohabitInfoTable() { } export function TechnoshopInfoTable() { + useSmartStylesheet(import.meta) + return (
@@ -76,6 +80,8 @@ export function TechnoshopInfoTable() { } export function FablabInfoTable() { + useSmartStylesheet(import.meta) + return (
diff --git a/components/Footer.css b/components/Footer.css index 0c191d0..aa187a8 100644 --- a/components/Footer.css +++ b/components/Footer.css @@ -1,9 +1,9 @@ -footer { +:scope { height: fit-content; background-color: var(--_translucent); } -footer div { +:scope div { max-width: var(--_wide-screen); width: 100%; padding: var(--_gap); @@ -14,13 +14,13 @@ footer div { } @media (width < 800px) { - footer div { + :scope div { flex-wrap: wrap; text-align: center; } } -.footer__badges { +.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--_gap-half); @@ -28,7 +28,7 @@ footer div { padding-left: 0; } -.footer__badges__item { +.badges__item { text-decoration: none; background-color: var(--_translucent); color: var(--_font-color); diff --git a/components/Footer.tsx b/components/Footer.tsx index a61ccc4..bd4e1d9 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,6 +1,12 @@ +import { getStyleScope, useSmartStylesheet } from ':plugins/SmartStylesheet.tsx' + +const scope = getStyleScope(Footer) + export function Footer() { + useSmartStylesheet(import.meta, { scope }) + return ( -