Alejandro Mery
Alejandro Mery
Explore posts from servers
NNuxt
Created by Alejandro Mery on 9/20/2024 in #❓・help
@nuxt/fonts + tailwindcss - use only local cache
disabling local fallbacks solved it.
--- a/web/client/nuxt.config.ts
+++ b/web/client/nuxt.config.ts
@@ -43,6 +43,9 @@ export default defineNuxtConfig({
assets: {
prefix: '/_fonts',
},
+ experimental: {
+ disableLocalFallbacks: true,
+ },
},

routeRules: {
--- a/web/client/nuxt.config.ts
+++ b/web/client/nuxt.config.ts
@@ -43,6 +43,9 @@ export default defineNuxtConfig({
assets: {
prefix: '/_fonts',
},
+ experimental: {
+ disableLocalFallbacks: true,
+ },
},

routeRules: {
2 replies
NNuxt
Created by Alejandro Mery on 5/6/2024 in #❓・help
create stricter type
so, the answer is declaring the object using satisfies
--- a/packages/theme-builder/src/colors-data.ts
+++ b/packages/theme-builder/src/colors-data.ts
@@ -108,7 +108,7 @@ export const contentAccentToneDelta = MaterialDynamicColors.contentAccentToneDel

// DynamicScheme
//
-export const standardDynamicSchemes: Record<string, standardDynamicSchemeFactory> = {
+export const standardDynamicSchemes = {
content: (primary, isDark = false, contrastLevel = 0) => new SchemeContent(hct(primary), isDark, contrastLevel),
expressive: (primary, isDark = false, contrastLevel = 0) => new SchemeExpressive(hct(primary), isDark, contrastLevel),
fidelity: (primary, isDark = false, contrastLevel = 0) => new SchemeFidelity(hct(primary), isDark, contrastLevel),
@@ -116,8 +116,6 @@ export const standardDynamicSchemes: Record<string, standardDynamicSchemeFactory
neutral: (primary, isDark = false, contrastLevel = 0) => new SchemeNeutral(hct(primary), isDark, contrastLevel),
tonalSpot: (primary, isDark = false, contrastLevel = 0) => new SchemeTonalSpot(hct(primary), isDark, contrastLevel),
vibrant: (primary, isDark = false, contrastLevel = 0) => new SchemeVibrant(hct(primary), isDark, contrastLevel),
-};
+} satisfies Record<string, standardDynamicSchemeFactory>;

-export type standardDynamicSchemeKey =
- 'content' | 'expressive' | 'fidelity' |
- 'monochrome' | 'neutral' | 'tonalSpot' | 'vibrant';
+export type standardDynamicSchemeKey = keyof typeof standardDynamicSchemes;
--- a/packages/theme-builder/src/colors-data.ts
+++ b/packages/theme-builder/src/colors-data.ts
@@ -108,7 +108,7 @@ export const contentAccentToneDelta = MaterialDynamicColors.contentAccentToneDel

// DynamicScheme
//
-export const standardDynamicSchemes: Record<string, standardDynamicSchemeFactory> = {
+export const standardDynamicSchemes = {
content: (primary, isDark = false, contrastLevel = 0) => new SchemeContent(hct(primary), isDark, contrastLevel),
expressive: (primary, isDark = false, contrastLevel = 0) => new SchemeExpressive(hct(primary), isDark, contrastLevel),
fidelity: (primary, isDark = false, contrastLevel = 0) => new SchemeFidelity(hct(primary), isDark, contrastLevel),
@@ -116,8 +116,6 @@ export const standardDynamicSchemes: Record<string, standardDynamicSchemeFactory
neutral: (primary, isDark = false, contrastLevel = 0) => new SchemeNeutral(hct(primary), isDark, contrastLevel),
tonalSpot: (primary, isDark = false, contrastLevel = 0) => new SchemeTonalSpot(hct(primary), isDark, contrastLevel),
vibrant: (primary, isDark = false, contrastLevel = 0) => new SchemeVibrant(hct(primary), isDark, contrastLevel),
-};
+} satisfies Record<string, standardDynamicSchemeFactory>;

-export type standardDynamicSchemeKey =
- 'content' | 'expressive' | 'fidelity' |
- 'monochrome' | 'neutral' | 'tonalSpot' | 'vibrant';
+export type standardDynamicSchemeKey = keyof typeof standardDynamicSchemes;
27 replies
NNuxt
Created by Alejandro Mery on 5/6/2024 in #❓・help
create stricter type
I never thought that as a factor to get Nitro
27 replies