Jump to content
  • Apply multiple styles to one element


    typhoon
    Assigned User teodord
    CategoryFeature request
    PriorityHigh
    ReproducibilityNot Attempted
    ResolutionFixed
    SeverityMinor
    StatusClosed

    Hi,

     

    it would be great to have the ability to apply multiple styles to one element.

    Example use case is the following:

    in styles template file we defined styles for object foreground colors, styles for object borders and styles for object font sizes. All these predefined styles can be combined in various ways.

    Right now we have to define all the possible combinations in styles template file, which is time consuming and in case, for example, some foreground color needs to be changed, then we have to walk through all combinations, where this color was applied.

     

    P.S.

    In case of conflicts between some style properties advantage would have property defined in first style from the list of styles.



    User Feedback

    Recommended Comments

    Hi,

     

    I guess we could try solving this, but it would not be the element who would have the possibility to reference more than one style, but rather style definitions would have the possibility to have more than one parent, something similar to the consolidation of conditional styles.

     

    Thanks,

    Teodor

    Link to comment
    Share on other sites

    Hi Teodor,

     

    it of course will improve maintenance (for example, style element can be defined in one place and can be referenced in multiple places; in case of change update in only one place will be required), but we still will require to create as many "leaf" style definitions as the different combinations can be/are required.

     

    Regards,

    ty

    Link to comment
    Share on other sites

    Hi,

     

    I'm making this tracker related to #5088, which is about dynamic style properties.

     

    I think using expressions for style properties eliminates the need to manage a great number of style definitions.

     

    Thanks,

    Teodor

    Link to comment
    Share on other sites

    Hi,

     

    For upcoming JR 4.8.0, we have introduced the notion of pluggable style provider for elements.

    This does not exactly matches your request to have conditional style definitions working from external style templates, but at least could solve your problem, even if in a slightly different way.

     

    You could implement a custom StyleProvider interface and associate it with your elements. This style provider could read information from external style definitions or other custom made locations or config files.

     

    Thanks,

    Teodor

    Link to comment
    Share on other sites


×
×
  • Create New...