I just wanted to write down my thoughts about a possibly-naive but simple approach we could theoretically take to support PF4/PF5/Next component styles existing on the same page.
To be clear: I have not learned much about CSS layers or CSS modules, so this may be better achieved with something fancier. However, this would work without any browser compatibility concerns.
Proposal:
- We release a transitional compatibility-version of PF4 that is identical to the last PF4 version except for the addition of
.pf-v-4
version classes on every component/layout style rule.- This is technically a breaking change for core CSS/HTML consumers, but React consumers could simply upgrade the packages and not have to change their usage at all (component APIs would remain identical, the rendered DOM would match the new CSS).
- If we are adhering to proper BEM classes for descenant elements of a component/layout, we should only need to apply this special class to the top of each component/layout unless we need to suppo