Skip to content

Commit

Permalink
refactor: Move naive themeConfig to app.config
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Jan 15, 2024
1 parent d6ac296 commit 2351b73
Show file tree
Hide file tree
Showing 4 changed files with 532 additions and 487 deletions.
36 changes: 36 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export default defineAppConfig({
naiveui: {
themeConfig: {
shared: {
common: {
fontFamily: 'Rubik',
borderRadius: '6px'
}
},

light: {
common: {
primaryColor: '#2563eb', // blue[600]
primaryColorHover: '#3b82f6', // blue[500]
primaryColorPressed: '#1d4ed8', // blue[700]
borderColor: '#d1d5db' // gray[300]
},
Card: {
borderColor: '#d1d5db' // gray[300]
}
},

dark: {
common: {
primaryColor: '#3b82f6', // .blue[500]
primaryColorHover: '#60a5fa', // blue[400]
primaryColorPressed: '#4b5563', // blue[600]
borderColor: '#1f2937' // gray[800]
},
Card: {
borderColor: '#1f2937' // gray[800]
}
}
}
}
})
42 changes: 2 additions & 40 deletions app.vue
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
<template>
<NaiveConfig :theme-config="themeConfig">
<NuxtLoadingIndicator :color="themeConfig.light?.common?.primaryColor" />
<NaiveConfig>
<NuxtLoadingIndicator color="#2563eb" :height="3" />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</NaiveConfig>
</template>
<script setup lang="ts">
import type { ThemeConfig } from '@bg-dev/nuxt-naiveui'
const themeConfig = ref<ThemeConfig>({
shared: {
common: {
fontFamily: 'Rubik',
borderRadius: '6px'
}
},
light: {
common: {
primaryColor: '#2563eb', // blue[600]
primaryColorHover: '#3b82f6', // blue[500]
primaryColorPressed: '#1d4ed8', // blue[700]
borderColor: '#d1d5db' // gray[300]
},
Card: {
borderColor: '#d1d5db' // gray[300]
}
},
dark: {
common: {
primaryColor: '#3b82f6', // .blue[500]
primaryColorHover: '#60a5fa', // blue[400]
primaryColorPressed: '#4b5563', // blue[600]
borderColor: '#1f2937' // gray[800]
},
Card: {
borderColor: '#1f2937' // gray[800]
}
}
})
</script>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@bg-dev/nuxt-auth": "2.3.7",
"@bg-dev/nuxt-naiveui": "1.8.1",
"@bg-dev/nuxt-naiveui": "1.9.0",
"@nuxt/devtools": "^1.0.6",
"@nuxtjs/eslint-config": "^12.0.0",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
Expand All @@ -27,7 +27,7 @@
"changelogen": "^0.5.5",
"eslint": "^8.56.0",
"nuxt": "^3.9.1",
"nuxt-s3": "1.1.1",
"nuxt-s3": "1.1.4-edge",
"nuxt-security": "^0.14.4"
},
"dependencies": {
Expand Down

1 comment on commit 2351b73

@vercel
Copy link

@vercel vercel bot commented on 2351b73 Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nuxt-starter – ./

nuxt-starter-becem-gharbi.vercel.app
nuxt-starter-git-main-becem-gharbi.vercel.app
nuxt-starter.bg.tn

Please sign in to comment.