Skip to content

Commit

Permalink
feat: minor housekeeping of theme
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed Mar 18, 2023
1 parent 023dd07 commit 8b6e67b
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 12 deletions.
19 changes: 14 additions & 5 deletions config/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import type { NuxtConfig } from 'nuxt/schema';
import { head } from './head';

const app: NuxtConfig['app'] = {
head,
};

const css: NuxtConfig['css'] = [
'maplibre-gl/dist/maplibre-gl.css',
'v-mapbox/dist/v-mapbox.css',
'~/assets/css/global.css',
'~/assets/css/fonts.css',
];

const nitro: NuxtConfig['nitro'] = {
preset: 'netlify-builder',
};

const plugins: NuxtConfig['plugins'] = [
'~/plugins/v-mapbox.ts',
'~/plugins/v-click-outside.ts',
Expand All @@ -27,12 +35,13 @@ const runtimeConfig: NuxtConfig['runtimeConfig'] = {
appVersion: process.env.npm_package_version,
},
};
const app: NuxtConfig['app'] = {
baseURL: '/',
head,
};

const ssr: NuxtConfig['ssr'] = false;

const typescript: NuxtConfig['typescript'] = {
strict: true,
shim: false,
};

export { modules } from './modules';
export { app, css, plugins, runtimeConfig, ssr };
export { app, css, nitro, plugins, runtimeConfig, ssr, typescript };
5 changes: 3 additions & 2 deletions config/modules/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type { NuxtConfig } from 'nuxt/schema';
import { plausible } from './plausible';
import { windicss } from './windicss';

const modules: NuxtConfig['modules'] = [
// https://pinia.esm.dev/ssr/nuxt.html#nuxt-js
'@pinia/nuxt',
// https://windicss.org/guide/
'nuxt-windicss',
// https://vueuse.org/guide/#nuxt
'@vueuse/nuxt',
// https://windicss.org/guide/
['nuxt-windicss', windicss],
// https://github.com/nuxt-modules/plausible#setup
['@nuxtjs/plausible', plausible],
];
Expand Down
11 changes: 11 additions & 0 deletions config/modules/windicss.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const windicss = {
analyze: {
analysis: {
interpretUtilities: false,
},
server: {
port: 8080,
open: false,
},
},
};
14 changes: 13 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import { app, css, modules, ssr, runtimeConfig } from './config';
import {
app,
css,
modules,
nitro,
plugins,
runtimeConfig,
ssr,
typescript,
} from './config';

export default defineNuxtConfig({
app,
css,
ssr,
modules,
nitro,
plugins,
runtimeConfig,
typescript,
});
27 changes: 23 additions & 4 deletions windi.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
import colors from 'windicss/colors';
import { defineConfig } from 'windicss/helpers';
import defaultTheme from 'windicss/defaultTheme';

const extract = {
include: ['**/*.{vue,html,jsx,tsx}'],
include: ['**/*.{vue,html,jsx,tsx,md}'],
exclude: ['node_modules', '.git'],
};

const theme = {
extend: {
colors: {
...colors,
gray: colors.slate,
gray: colors.stone,
transparent: 'transparent',
},
fontFamily: {
sans: ['Inter var', ...require('windicss/defaultTheme').fontFamily.sans],
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
},
typography: {
DEFAULT: {
css: {
pre: {
backgroundColor: colors.stone[200],
},
},
},
DARK: {
css: {
pre: {
backgroundColor: colors.stone[800],
},
},
},
},
},
};

const plugins = [
require('windicss/plugin/filters'),
require('windicss/plugin/forms'),
Expand All @@ -28,7 +46,8 @@ const plugins = [
require('@windicss/plugin-animations'),
require('windicss/plugin/typography')({
dark: true,
modifiers: ['DEFAULT', 'sm', 'lg', 'red'],
rtl: true,
className: 'prose',
}),
];

Expand Down

0 comments on commit 8b6e67b

Please sign in to comment.