Skip to content

Commit 5675e12

Browse files
authored
feat!: add modern SASS compiler support (#255)
* feat!: add modern SASS compiler support * chore: add pwa dev dependencies * chore: cleanup vite configuration * chore: use settings.scss * chore: update types * chore: update compatibility matrix * chore: include no ssr page * chore: use vite virtual convention * chore: include DPR in docs (not exposed) * chore: include modern sass compiler page * chore: don't configure `legacy` compiler, let vite use the default * chore: update sass page * chore: . * chore: include vuetify link
1 parent dcdae4b commit 5675e12

31 files changed

Lines changed: 2687 additions & 1971 deletions

‎date-io-playground/nuxt.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export default defineNuxtConfig({
2+
compatibilityDate: '2024-08-15',
23
// ssr: false,
34
sourcemap: true,
45
imports: {

‎date-io-playground/package.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
"@types/moment": "^2.13.0",
2424
"@types/moment-hijri": "^2.1.0",
2525
"@types/moment-jalaali": "^0.7.6",
26-
"@unocss/nuxt": "^0.61.3",
26+
"@unocss/nuxt": "^0.62.1",
2727
"date-fns": "^2.30.0",
2828
"date-fns-jalali": "^2.19.0-2",
2929
"dayjs": "^1.11.10",
3030
"luxon": "^3.4.3",
3131
"moment": "^2.29.4",
3232
"moment-hijri": "^2.1.2",
3333
"moment-jalaali": "0.9.2",
34-
"nuxt": "^3.12.3",
35-
"sass": "^1.63.6",
36-
"typescript": "^5.4.3",
37-
"vue-tsc": "^2.0.26",
34+
"nuxt": "^3.12.4",
35+
"sass": "^1.77.8",
36+
"typescript": "^5.5.4",
37+
"vue-tsc": "^2.0.29",
3838
"vuetify-nuxt-module": "workspace:*"
3939
}
4040
}

‎docs/.vitepress/config.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ export default withPwa(defineConfig({
190190
}, {
191191
text: 'Date Support',
192192
link: '/guide/date',
193+
}, {
194+
text: 'SASS Modern Compiler',
195+
link: '/guide/sass-modern-compiler',
193196
}, {
194197
text: 'FAQ',
195198
link: '/guide/faq',

‎docs/guide/compatibility-matrix.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
| <0.13.0 | ^3.6.5 | ^3.5.1 | ^8.0.0 |
77
| >=0.13.0 | ^3.9.0 | ^3.5.1 | ^8.0.0 |
88
| >0.15.0 | >=3.9.0 | ^3.6.12 | ^8.0.0 |
9+
| >=0.17.0 | >=3.9.0 | ^3.7.0 | ^8.0.0 |

‎docs/guide/sass-modern-compiler.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SASS Modern Compiler
2+
3+
From version `0.17.0`, this module will configure Nuxt to use the new SASS modern compiler (`modern-compiler`). You don't need to change anything in your configuration to use it:
4+
- update `vite` version to `v5.4.0` or higher (if you're using Nuxt `3.12.4` or higher, you don't need to update `vite`)
5+
- replace your `sass` dependency with `sass-embedded`
6+
7+
If the `sass-embedded` dependency is not installed, the module will configure the `modern` compiler for you. In case you get errors, enable the `disableModernSassCompiler` option in the module configuration to fall back to the `legacy` compiler.
8+
9+
Check [Build Performance](https://vuetifyjs.com/en/features/sass-variables/#build-performance) in Vuetify docs for more details.

‎docs/guide/server-side-rendering.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The module includes support for the following [HTTP Client hints](https://develo
1111
- [Sec-CH-Prefers-Reduced-Motion](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion)
1212
- [Sec-CH-Viewport-Width](https://wicg.github.io/responsive-image-client-hints/#sec-ch-viewport-width)
1313
- [Sec-CH-Viewport-Height](https://wicg.github.io/responsive-image-client-hints/#sec-ch-viewport-height)
14+
- [Sec-CH-DPR](https://wicg.github.io/responsive-image-client-hints/#sec-ch-dpr)
1415

1516
::: warning
1617
The [HTTP Client hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints) headers listed above are still in draft, and only Chromium based browsers support them: Chrome, Edge, Chromium and Opera.
@@ -98,7 +99,7 @@ Check [SSR HTTP Client hints](#ssr-http-client-hints) for more details.
9899
## SSR HTTP Client hints
99100

100101
You can enable SSR **HTTP Client hints** using the `ssrClientHints` module option:
101-
- `viewportSize`: enable `Sec-CH-Viewport-Width` and `Sec-CH-Viewport-Height` headers (defaults to `false`)?
102+
- `viewportSize`: enable `Sec-CH-Viewport-Width`, `Sec-CH-Viewport-Height` and `Sec-CH-DPR` headers (defaults to `false`)?
102103
- `prefersColorScheme`: enable `Sec-CH-Prefers-Color-Scheme` header (defaults to `false`)? Check [Sec-CH-Prefers-Color-Scheme](#sec-ch-prefers-color-scheme) for more details
103104
- `prefersReducedMotion`: `Sec-CH-Prefers-Reduced-Motion` header (defaults to `false`)?
104105

‎docs/package.json‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
"vue": "^3.4.21"
1515
},
1616
"devDependencies": {
17-
"@iconify-json/carbon": "^1.1.27",
17+
"@iconify-json/carbon": "^1.1.37",
1818
"@types/node": "^20.6.0",
19-
"@vite-pwa/assets-generator": "^0.2.2",
20-
"@vite-pwa/vitepress": "^0.3.1",
21-
"sitemap": "^7.1.1",
22-
"unocss": "^0.58.0",
23-
"vitepress": "^1.0.1"
19+
"@vite-pwa/assets-generator": "^0.2.4",
20+
"@vite-pwa/vitepress": "^0.5.0",
21+
"sitemap": "^8.0.0",
22+
"unocss": "^0.62.1",
23+
"vite-plugin-pwa": "^0.20.1",
24+
"vitepress": "^1.3.2",
25+
"workbox-window": "^7.1.0"
2426
}
2527
}

‎modern-sass-compiler/app.vue‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<NuxtLayout>
3+
<NuxtPage />
4+
</NuxtLayout>
5+
</template>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@use 'vuetify/settings' with (
2+
$button-font-weight: 700,
3+
);
Lines changed: 27 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)