elements: refactor wccss for dark mode #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
elements: refactor WCCSS preprocesser to handle dark mode better
What
Re-writes the structures and functions inside WCCSS to a more modern, class-oriented system. Too many details were getting lost in the noise, and the idea that these were “abstractions” that I needed to ignore just wasn’t cutting it. Re-writting the Patternfly reader so that it was clear what was happening at each step (pulling in the content, then traversing it to determine the
:rootCSS values) made the next step much easier.Dark mode analysis has been added: the
html[theme="dark"]selector is automatically detected if present in a component’s ReactCSS variant, and ported correctly to a web-component oriented format.ak-button’s CSS has been re-activated as a pure WCCSS product, and it works correctly.
ak-tooltip was too heavily customized; it’s effectively our own code now, so it will remain “overridden.” (Also, it was misspelled “overriden,” which I have corrected.)
Why
Because the burden of hand-maintaining component with dark mode was become onerous, and this will accelerate the production of new components with dark mode attached.