vuetify.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { createVuetify } from 'vuetify'
  2. import 'vuetify/styles'
  3. import { aliases, fa } from 'vuetify/iconsets/fa'
  4. import '@fortawesome/fontawesome-free/css/all.css'
  5. import { en } from 'vuetify/locale'
  6. import { defineNuxtPlugin } from '#app'
  7. interface Theme {
  8. dark: boolean,
  9. colors: {
  10. 'background': string,
  11. 'on-background': string,
  12. 'surface': string,
  13. 'on-surface': string,
  14. 'primary': string,
  15. 'on-primary': string,
  16. }
  17. }
  18. export const lightTheme: Theme = {
  19. dark: false,
  20. colors: {
  21. 'background': '#ffffff',
  22. 'on-background': '#333333',
  23. 'on-background--clickable': '#404040',
  24. 'surface': '#f9f9f9',
  25. 'on-surface': '#4d4d4d',
  26. 'primary': '#e6e6e6',
  27. 'on-primary': '#1a1a1a',
  28. 'on-primary--clickable': '#4d4d4d',
  29. }
  30. }
  31. export const darkTheme: Theme = {
  32. dark: true,
  33. colors: {
  34. 'background': '#1a1a1a',
  35. 'on-background': '#e6e6e6',
  36. 'on-background--clickable': '#e6e6e6',
  37. 'surface': '#262626',
  38. 'on-surface': '#ffffff',
  39. 'primary': '#13263a',
  40. 'on-primary': '#e6e6e6',
  41. 'on-primary-alt--clickable': '#ffffff',
  42. }
  43. }
  44. export default defineNuxtPlugin((nuxtApp) => {
  45. const vuetify = createVuetify({
  46. ssr: true,
  47. locale: {
  48. locale: 'en',
  49. messages: { en },
  50. },
  51. theme: {
  52. defaultTheme: 'dark',
  53. themes: {
  54. light: lightTheme,
  55. dark: darkTheme
  56. },
  57. },
  58. icons: {
  59. defaultSet: 'fa',
  60. aliases,
  61. sets: {
  62. fa,
  63. },
  64. },
  65. })
  66. nuxtApp.vueApp.use(vuetify)
  67. })