Closed viktoria-schwarz closed 2 years ago
What's the behavior? I don't think we need to be compatible with the pre-defiend theme-ui themes. Especially since our components may have other names.
I thought we have talked about this once, that we need to adjust the basetheme types. But I don't mind if you say it's not needed :)
Yes, sorry that was not what I meant.
I think we should think how we structure the theme first. There shouldn't be much of an incompatibility with the theme type from theme-ui.
What I meant is, our theme should not extend the theme-ui theme.
Okay but should we finally change anything in our theme then?
I think so? Didn't we want to make it more strict?
Where do we go on from here? Our BaseTheme
type allows any CSSiObjects to extend it. Where do we need to restrict the types?
It's not necessarily about restricting than hardening the type.
We could start with all the variant keys specified for the components.
E.g. "root" can have a "body" and "html" property that must be a CssObject. Same for "button", "select" and so on 😊
I also think that it would be good to get more structure in the theme. Our theme is already very similar to the theme-ui but we have too much "freedom" when creating the individual component variants. We currently have three themes, but I have noticed that it is difficult to adapt the b2b theme for other themes. I would generalize the structure.
I would keep the basic structure at the beginning of the theme. Then for each component that has a variant, there is an object starting with the component name. Sometimes we have inside the component meaningful variants like for example the button or the alert.
But there are also some components that have only one subvariant like default
or __default
. Here we should use "the same" default for all or for a subvariant directly the styles in componentName: { margin: ... }
How do you imagine this @sebald @viktoria-schwarz?
It's definitely something we should look into in the next cycle. I don't know if we should off load into this ticket but rather set expectations for what the improvements should achieve
My targets are:
What are your targets? I think we need a few points or a list to collect all todos. Or do we need a meeting to talk about our predictions to the new structure?
ToDo:
closed via #1563
Description
Our self-defined BaseTheme typings don't match the theme-ui/css interface of a Theme. This can lead to unwanted behavior.
We need to look through all the types and see if they match or if we need to adjust them.
Context
make our theme accessible to use with other pre-defined themes e.g. from theme-ui
Consequences
We need to change some of the types in the theme type and accordingly in the existing themes