Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what about dark theme support? #35

Closed
lospringliu opened this issue Mar 1, 2023 · 19 comments
Closed

what about dark theme support? #35

lospringliu opened this issue Mar 1, 2023 · 19 comments

Comments

@lospringliu
Copy link

current rendering does not seem to fit dark mode well.

What about make some global update to make it work with something like https://anu-vue.netlify.app/guide/features/theme.html ?
this does not require to set configurations on a lot of places

@lospringliu
Copy link
Author

light them
image

@lospringliu
Copy link
Author

dark theme
image

@lospringliu
Copy link
Author

not a real issue as the configuration will show the same effect by default for both dark and regular theme. It would be good to make it responds to common dark theme though

@davay42
Copy link
Member

davay42 commented Mar 2, 2023

Yeah, this feature is very needed, but I postponed it not to waste too much time on refining the visual part, focusing on the db and build system. We can sprinkle some "dark-..." classes everywhere to have the dark mode feature, but may be there's another way. I'm thinking of implementing some kind of theming. May be you have any ideas how to do that? 😄

@davay42
Copy link
Member

davay42 commented Mar 2, 2023

Actually Anu seems to be a nice case! It uses the UnoCSS plugin system, which seems to be perfect for GunVue too. Need to explore this more. May be even integrate Anu as an underlying suitcase of basic components.

@lospringliu
Copy link
Author

Anu has dark theme support by default and do not need to add dark- classes everywhere, but likely will not have your ideal visual expectations

@lospringliu
Copy link
Author

I played half day with anu, it feels to be a good ui library, perhaps you can think of integrating it to gun-vue

@davay42
Copy link
Member

davay42 commented Mar 3, 2023

Yeah! I'm just exploring it's docs and source to find ways to integrate into the components package. And still make them customizable. If you have a clue how to do it - please share )

@davay42
Copy link
Member

davay42 commented Mar 3, 2023

Man, I just can't make it work with my current layered setup... How to manage styles not to be in need to build the components each time I need to check them in the app.

@lospringliu
Copy link
Author

current version is a bit old (0.12.0), they have edge builds let me see if I can make it to work with your repo

@lospringliu
Copy link
Author

I found need some options like below, it seems to be very flexible

      <ASelect optionsWrapperClasses="z-500"/>
      <AInput type="number" input-wrapper-classes="px-0" />

@davay42
Copy link
Member

davay42 commented Mar 4, 2023

Seems doable! Like so we need a prop of classes for each wrapper in a component. And so the initial classes can be stored in props default. But idk how UnoCSS handles that. Will see 👀

@lospringliu
Copy link
Author

markdown with light/dark

   // https://github.com/antfu/vite-plugin-vue-markdown
    // Don't need this? Try vitesse-lite: https://github.com/antfu/vitesse-lite
    Markdown({
      wrapperClasses: 'prose prose-sm m-auto text-left',
      headEnabled: true,
      markdownItSetup(md) {
        // https://prismjs.com/
        md.use(Shiki, {
          theme: {
            light: 'vitesse-light',
            dark: 'vitesse-dark',
          },
        })
        md.use(LinkAttributes, {
          matcher: (link: string) => /^https?:\/\//.test(link),
          attrs: {
            target: '_blank',
            rel: 'noopener',
          },
        }) 
      },
    }),

@lospringliu
Copy link
Author

I found it easy to work with anu by default if you do not set background color, or if you set a neutral color like gray

@lospringliu
Copy link
Author

lospringliu commented Mar 6, 2023

your gun-avatar seems to support dark, is it convenient to update useBackgroud to honor?

dark mode variable can get from @vueuse

@lospringliu
Copy link
Author

#37

@davay42
Copy link
Member

davay42 commented Mar 7, 2023

Good point! Yet in my experience it's better to have one isDark instance established somewhere and imported from all the places. I'll test your solution too.

@lospringliu
Copy link
Author

lospringliu commented Mar 7, 2023

yes, expose from your ui or styles composable is better

@davay42
Copy link
Member

davay42 commented Mar 8, 2023

@lospringliu I've got you covered! Full dark mode support has landed with v.0.14.2!

@davay42 davay42 closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants