Hello!
Context
With @MichaelHamann we had a discussion on a pull request at XWIKI-23080: Make LESS customizations impact CSS properties by Sereza7 · Pull Request #4037 · xwiki/xwiki-platform · GitHub and I think it’d be interesting to make more people in the community aware of it so we can reach a meaningful consensus.
Subject
AFAIK, there are two ways to provide values for CSS variables:
- A hard coded default
- Retrieve the value from an older system of values (LESS variables or Flamingo colorthemes)
The first option (1.) is currently implemented. (2.) is already implemented for flamingo colorthemes. The point of XWIKI-23080: Make LESS customizations impact CSS properties by Sereza7 · Pull Request #4037 · xwiki/xwiki-platform · GitHub is to implement (2.) for LESS variables (more generic than just the few ones that have a UI in flamingo colorthemes).
We want to implement (2.) in order to make sure that whatever the customizations on LESS variables are, those customizations will also impact the value of CSS variables.
Implementing (2.) also means that in most cases, most of the hard-coded value implemented in (1.) will be overridden.
Is it still important to keep (1.)?
Main CON: Since (1.) is hard coded, it comes with a maintainability challenge. Making sure the CSS defaults hard-coded in (1.) stay the same as their equivalent in LESS is an additional constraint when updating styles on XWiki standard.
Main PRO: (1.) makes sure the CSS variable system stays somewhat functional even if the LESS variable system is down. This is a safety handle and a way to avoid correlating too much our new CSS system with the LESS variables.
Sidenote: The impact on performance of adding 50-100 CSS variable declarations to LESS is negligible.
Opinion
I think the PROS outweight the CONS and we should keep (1.). I detailed my points on the PR, feel free to go and check it out if you want more info about this discussion
Conclusion
Do you think we should keep hard-coding values for CSS variables that can retrieve a value from their LESS equivalent? Is there any PRO or CON we didn’t think of when debating this subject so far? Is there a third way to provide values for CSS variables that we somehow missed?
Thank you for your interest in this topic!
I’m looking forward to your participation in the brainstorming
Lucas C.
1 post - 1 participant