feat: Expose CSS variables for theming the SwitchField component#765
feat: Expose CSS variables for theming the SwitchField component#765frankieyan merged 3 commits intomainfrom
SwitchField component#765Conversation
bdd4ad2 to
225ae36
Compare
225ae36 to
ba080ba
Compare
There was a problem hiding this comment.
Looks like a great direction to take.
One thing/question that comes to mind: have you intentionally thought about the naming convention of CSS variables? In particular, I'm worried about the fact that we either name them after a CSS property (e.g. --reactist-bg-…) or after a component (--reactist-switch-…).
What happens if the first word that comes after --reactist-… ever becomes ambiguous? Not that I see any possibility of that happening soon or ever, but still. I wanted to know what you think about this.
Another question I have: how are you going to deal with releasing this? This is technically a breaking change, is it? Especially if you're planning to create more breaking changes in the short term, do you plan to accumulate them? If so, will you accumulate them on main? Perhaps a next branch would be best. Unless you plan to release them as you go.
|
Thanks @gnapse, great questions!
I'd say this is technically not a breaking change, because we're setting the variables we had previously used as default values, ie. I don't have anymore changes planned in the short term 👍
I had not thought about this, but when I discussed with Paul (ref), we want to bring the product library variables here into Reactist as a mid-term goal, so variables like |
Ah yes. Good point. Indeed, under that consideration it is really not a breaking change.
Well, in a way it will have to stay. The |
Good point, we may be able to map them to the product library's background colours and see if that fulfills all of our use cases, but something to look into later in more detail! |
Short description
Instead of relying on shared custom properties like
--reactist-bg-defaultto theme theSwitchField, this explicitly lists variables we can use:PR Checklist
npm run validateand made sure no errors / warnings were shownCHANGELOG.mdpackage.jsonandpackage-lock.json(npm --no-git-tag-version version <major|minor|patch>) refnpm run build-all)Versioning
Minor