Skip to content

Custom selector-based styling #1786

Description

@BigWingBeat

I'm making an app with Xilem, which includes some custom styling of interactive widgets, but this seems very limited at the moment. Xilem has some built-in styling that uses PropertyStacks to change the styling of widgets in response to state changes, but as for custom styling, from what I can tell, you can only apply custom styling globally, by setting a custom DefaultProperties.

I want to apply custom styling to only certain widgets, and I can see a few possible paths to this:

  1. Allow setting custom classes on specific widgets. You could then filter for these classes in the selectors in the global DefaultProperties.
  2. Allow directly setting PropertyStacks on specific widgets.
  3. Add special-case methods to the widget types for each individual custom styling use-case.

Another thing to note is that one of the things I want to do is style a container FlexRow based on the state of a child TextInput. This is a bit different than styling a widget just based on its own state, so I'm not sure how easily the above options could be generalized to this use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions