Add support for library themes
Description
The pull request adds support for registering library themes, similar to static assets.
Themes are now registered and validated within scenic from Scenic.Themes.
Motivation and Context
Before the theme module was on Scenic.Primitive.Style.Theme, which felt like it would only be used in the context of primitives/components. However, it was imported everywhere that theme validation was needed, and had all the themes directly on that module. This means Scenic would not be able to validate custom themes that were not a map.
Also, there were times when scenic would pass around :dark, :light atoms, you had to know this ahead of time and know to validate or get the preset via Scenic.Primitive.Style.Theme. With all themes now registered through a single module, you can now fetch presets and validate any theme from Scenic.Themes.
Types of changes
- [ ] Bug fix (a non-breaking change which fixes an issue)
- [x] New feature (a non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)
Todos
- [x] implement custom themes
- [x] implement custom validation
- [x] implement extendable color palette
Added a way to add additional keys to be validated for custom themes.
With these changes we can now validate once during compile. We shouldn't need to validate in the viewport anymore. Is my thinking here correct?
Love the Palettte module. lets do a call so you can walk me through the rest. Is a bit much to wrap my head around.
Okay, made the changes you requested. Moved the functions with logic out of the macro, and it will now fallback to Scenic.Themes as a default if no themes config is set.