Anyone able to make non-terrible themes?!

Well, I've been updating and trying to get a basic theme api setup in 
[Fidgetty](https://github.com/elcritch/fidgetty). I'm mostly going for the most 
basic widget/theme support roughly following common idioms found in web based 
ones like Bootstrap, Bulma CSS, Material Design.

I also fixed some bugs with orgBox'es which make it easier to do fancy 
constraints using `Em` and `Vh` calculated units.

Useful points:

  * Theme support has been moved completely out of my Fidget fork into Fidgetty.
  * See 
[fidgetty/theming.nim](https://github.com/elcritch/fidgetty/blob/main/src/fidgetty/theming.nim).
  * Theme support is broken up into a global ThemePalette and per 
widget-customizable Palette and Theme objects.
  * Global stacks are used for Palette and Theme objects.



Ideally customizing an individual widget's theme would look something like:
    
    
    Checkbox:
        value: self.myCheck
        text: fmt"Click {self.myCheck}"
        withSubTheme:
          theme.highlight = themePalette.warning
          theme.foreground = themePalette.warning.lighten(0.2)
          theme.text = themePalette.textDark
    
    
    Run

Though currently I haven't implemented `withSubTheme`, but you can do 
[this](https://github.com/elcritch/fidgetty/blob/06cb36b0ad96b1bdf417948a1658adf8f9ef63ba/tests/testDemo.nim#L72).
 See the image below for the resulting (yellow) checkbox.

You can run `nim c -r -d:release -d:demoBulmaTheme tests/testDemo.nim` to see 
the result.

Reply via email to