melohagan / budibase-component-number-counter-input

A number input with incremental steps, adapted from svelteuidev
1 stars 0 forks source link

Themeing #1

Closed poirazis closed 1 year ago

poirazis commented 1 year ago

Hey @melohagan and thanks for the nice component ! Wanted to report that it doesnt seem to be following the selected theme though Screenshot 2023-06-28 at 6 19 55 PM

melohagan commented 1 year ago

Good catch, cheers!

I'll take a look if I happen to get chance :)

melohagan commented 1 year ago

Hey @poirazis

I've had a bit of a look at this one, and I think the best I can do at the moment is determine if the theme is dark and set the SvelteUIProvider colorScheme to "dark". I believe I'll need this to be implemented though: https://github.com/Budibase/budibase/issues/11409

Although you probably know better than me if there's a way in a custom component to get the theme?

Played around with a few things in the SvelteUI docs but wasn't having much luck.

poirazis commented 1 year ago

Hey @melohagan currently , i lookup which theme is active by looking at the classes of the "spectrum-root" DIV !

Screenshot 2023-08-16 at 3 04 27 PM
melohagan commented 1 year ago

Cheers @poirazis ! It might be a little hacky to read the DOM tree like that, but could be worth it as a quick fix.

poirazis commented 1 year ago

I would suggest each screen has a Theme property ( to be able to override the application wide setting per screen ) and that property should be exposed as a binding to conditionally react depending on which Theme is active.

But for the time being, i didnt find another way to quickly grab the active theme