diff --git a/examples/snowpack/astro/components/Hero.astro b/examples/snowpack/astro/components/Hero.astro index 8b287c197..441f30f12 100644 --- a/examples/snowpack/astro/components/Hero.astro +++ b/examples/snowpack/astro/components/Hero.astro @@ -1,5 +1,6 @@
diff --git a/examples/snowpack/astro/components/Menu.astro b/examples/snowpack/astro/components/Menu.astro index f96961aed..120a8af86 100644 --- a/examples/snowpack/astro/components/Menu.astro +++ b/examples/snowpack/astro/components/Menu.astro @@ -120,11 +120,11 @@
  • - Plugin Catalog + Plugin Catalog
  • - Community & News + Community & News
  • diff --git a/examples/snowpack/astro/components/Nav.astro b/examples/snowpack/astro/components/Nav.astro index 31ef33e3d..3582bd0a0 100644 --- a/examples/snowpack/astro/components/Nav.astro +++ b/examples/snowpack/astro/components/Nav.astro @@ -63,6 +63,7 @@ export let version: string = '3.1.2'; .logo { display: flex; + align-items: center; grid-area: logo; justify-content: center; padding: 0.5rem; @@ -76,6 +77,22 @@ export let version: string = '3.1.2'; } } + .logo-icon { + display: block; + width: 1em; + height: 1em; + margin-right: 0.25em; + margin-bottom: 0.15rem; + fill: currentColor; + } + + .logo-type { + font-weight: 700; + font-family: $heading; + letter-spacing: -0.03em; + padding-top: 0.2rem; + } + .mobile-open { display: flex; grid-area: mobile; @@ -233,8 +250,8 @@ export let version: string = '3.1.2'; -
    • - @@ -149,4 +150,4 @@ let description = 'Snowpack is a lightning-fast frontend build tool, designed fo - \ No newline at end of file + diff --git a/examples/snowpack/public/css/_globals.scss b/examples/snowpack/public/css/_globals.scss index 960ff591c..2843a427a 100644 --- a/examples/snowpack/public/css/_globals.scss +++ b/examples/snowpack/public/css/_globals.scss @@ -19,9 +19,6 @@ p { line-height: 1.25; } -.header-logo, -.header-snowpack, -.header-snowpack-subtitle, .pretty-font, .version-number { font-weight: 600; diff --git a/examples/snowpack/public/css/app.scss b/examples/snowpack/public/css/app.scss index 55baa62b5..c8aec8837 100644 --- a/examples/snowpack/public/css/app.scss +++ b/examples/snowpack/public/css/app.scss @@ -15,7 +15,6 @@ @use './components/card-grid'; @use './components/container'; @use './components/icon'; -@use './components/logo'; @use './components/old'; @use './components/view'; diff --git a/examples/snowpack/public/css/components/_logo.scss b/examples/snowpack/public/css/components/_logo.scss deleted file mode 100644 index 92e139fd4..000000000 --- a/examples/snowpack/public/css/components/_logo.scss +++ /dev/null @@ -1,29 +0,0 @@ -@use '../var' as *; - -/** - * Snowpack Logo - * That iconic mountain you know and love - */ - -.snow-logo { - display: inline-flex; - align-items: center; - - // ----------- - // Components - // ----------- - - &-icon { - display: block; - width: 1em; - height: 1em; - margin-right: 0.25em; - fill: currentColor; - } - - &-type { - font-weight: 700; - font-family: $heading; - letter-spacing: -0.03em; - } -} diff --git a/src/compiler/optimize/styles.ts b/src/compiler/optimize/styles.ts index 691300067..824f53096 100644 --- a/src/compiler/optimize/styles.ts +++ b/src/compiler/optimize/styles.ts @@ -126,6 +126,22 @@ export default function ({ filename, fileID }: { filename: string; fileID: strin html: { Element: { enter(node) { + if (node.name === 'style') { + // Same as ast.css (below) + const code = Array.isArray(node.children) ? node.children.map(({ data }: any) => data).join('\n') : ''; + if (!code) return; + const langAttr = (node.attributes || []).find(({ name }: any) => name === 'lang'); + styleNodes.push(node); + styleTransformPromises.push( + transformStyle(code, { + type: (langAttr && langAttr.value[0] && langAttr.value[0].data) || undefined, + filename, + fileID, + }) + ); + return; + } + // Find the root node to inject the