Support multiple pseudo states simultaneously #9789
Labels
Content-Length: 231401 | pFad | https://github.com/NativeScript/NativeScript/issues/9789
32Fetched URL: https://github.com/NativeScript/NativeScript/issues/9789
Alternative Proxies:
Is your feature request related to a problem? Please describe.
Update: Looks like there are methods to manipulate pseudoStates already:
addPseudoClass
deletePseudoClass
These might be enough to cover the use-case, though a helper API to make it easier to switch would be welcome.
NativeScript supports pseudo selectors to style views based on their state. For example
However it does not support multiple pseudo states simultaneously. A good example where this would be useful is a Switch/Checkbox view:
The above css should set the background color of the switch when it is both checked and disabled.
Describe the solution you'd like
A new API to handle multiple pseudo states simultaneously.
Right now we have the
View._goToVisualState(state: string);
method.We could handle visual states in an array, or for performance reasons a flag system would work too.
The api is open for debate.
A key missing piece is support for custom PseudoState values - the API would need to consider those to be complete.
Describe alternatives you've considered
We can handle the different states with simple classes, however a pseudo based solution would be ideal.
Anything else?
This would be a killer feature for using TailwindCSS where different states can be targeted inline:
Please accept these terms
The text was updated successfully, but these errors were encountered: