6

Best way to do theming with Vue?

Comments
  • 2
    How advanced are we talking about? Just color changes or full layout changes?

    For color changes just use CSS variables.
  • 1
    You can do use any css frameworks.
    Vue is independent of any theming.

    Currently I got two projects on vue
    With Bulma and Semantic UI.
  • 0
    @Codex404 @zotigapo Okay, correction. Themes that are switchable at runtime, with as little overhead as possible. Also, CSS variables aren't completely supported.
  • 1
    @ScriptCoded my bad.

    https://cli.vuejs.org/guide/...

    Do the themeing changes in App (main template)

    Havent done any theme switching on vue so far.
  • 1
    Easy. Use a dark theme.
  • 0
    @zotigapo Yeah, but that won't really solve it. I'll br using SCSS, but there's no way I can rebuild it at runtime.
  • 1
    @ScriptCoded any still supported browser has support for it. Internet explorer has an easy fallback.

    If you are specifically targeting IE please say so.
  • 0
    @Codex404 Primarily Firefox and Chrome, but in a few months we must be 100% IE capable. Though after a little Googling there seems to be some polyfills.
  • 1
    Does the theming also have to work on IE? Well sir than I wish you tons of luck with that nightmare. Leave while you still can.
  • 0
  • 1
    @ScriptCoded i think

    Create 2 separate theme files.
    Then create a theme custom plugin.
    And load the plugin and control the plugin from anywhere.
  • 0
    @zotigapo Yeah, or just using the store. But the problem is that compiling two separate files most likely would require some custom SCSS compile pipeline that I'm not entirely sure how to build.
Add Comment