theming.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Modify the current theme color according to the optional 'theme' parameter passed in the current query
  3. * @param context
  4. */
  5. export default function (context) {
  6. if (context.query.theme) {
  7. switch (context.query.theme) {
  8. case 'blue':
  9. context.$vuetify.theme.themes.light.primary = '#0aa5ec'
  10. break
  11. case 'green':
  12. context.$vuetify.theme.themes.light.primary = '#04a04c'
  13. break
  14. case 'grey':
  15. context.$vuetify.theme.themes.light.primary = '#8c8c8c'
  16. break
  17. case 'light-blue':
  18. // already the default one
  19. break
  20. case 'light-red':
  21. context.$vuetify.theme.themes.light.primary = '#dd453f'
  22. break
  23. case 'orange':
  24. context.$vuetify.theme.themes.light.primary = '#e4611b'
  25. break
  26. case 'purple':
  27. context.$vuetify.theme.themes.light.primary = '#a5377e'
  28. break
  29. case 'red':
  30. context.$vuetify.theme.themes.light.primary = '#df0009'
  31. break
  32. default:
  33. // eslint-disable-next-line no-console
  34. console.error('invalid theme: ' + context.query.theme)
  35. }
  36. }
  37. }