Skip to content

Composite styles #101

@gpeairs

Description

@gpeairs

Copying Hugh's description from the pre-release tracker:

Presently the mechanism for applying a composite style is through repeated call to styled: styled(styled(ent, sty_lower), sty_upper), which results in StyledEntity that has a StyledEntity for it's ent field.

There are a few difficulties with this:

  1. It isn't possible to store such a combination upfront to apply to multiple entities, this clashes with the design of StyleDict.
  2. When applying compositions of styles such as Optional(Rounded()) and Optional(MeshSized()), the resolution of to_primitives can result in ambiguous combinations. The options in this scenario are additive, if the Rounded is active, the primitive changes, and if the MeshSized is present then meshgrading and meshsize change.

It would be ideal to allow something like sty = Rounded() ∘ MeshSized() to construct such styles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions