sqlpage / SQLPage

Fast SQL-only data application builder. Automatically build a UI on top of SQL queries.
https://sql.datapage.app
MIT License
1.57k stars 89 forks source link

Add "sidebar-theme" in Shell Top-level parameters #540

Closed Ajotah98 closed 1 month ago

Ajotah98 commented 1 month ago

Hi,

Currently, the documentation of shell component only states about sidebar: image

But when the sidebar component was created, we have included a "sidebar-theme" for letting people have "both" theme websites:

image

I guess the card with the info should be something like:

sidebar-theme (Boolean, optional)

When used with the "sidebar" propery, it enables the dark theme only on the sidebar.

lovasoa commented 1 month ago

Oh, I missed that! Could we use the global theme by default, make this accept the same values as the theme parameter (instead of being a boolean), and use an underscore in the name?

For the documentation, can you please open a pull request?

lovasoa commented 1 month ago

I'm open to a new pr to add a separate, documented, sidebar_theme, which falls back to the main theme when not specified :)

Ajotah98 commented 1 month ago

Mmmm, I didn't put the sidebar-theme to fallback into the main theme! Instead, what I wanted is the possibility to have the sidebar in dark theme and the rest of the app in light theme.

Before the change, the behaviour was: if not sidebar-theme -> sidebar light, app light if theme (global) -> sidebar dark, also app dark if sidebar-theme (but not theme = dark) -> sidebar dark, app light

What do you think about?

lovasoa commented 1 month ago

Ok, that's okay for me. But let's name it sidebar_theme (snake case), and have people set it to "dark", not any truthy value. Can you make a PR with the changes to the code and the docs?