Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is CSS attribute selector partial matching implemented? i.e semantic styling approaches

Discussion in 'UI Toolkit' started by Macro, May 1, 2020.

  1. Macro

    Macro

    Joined:
    Jul 24, 2012
    Posts:
    53
    So in the web world its common place to have something like

    [name$="-action-button"]
    {
    width: 200px;
    font-size: 14px;
    -unity-font-weight: bold;
    }

    Which would mean anything which ends in `action-button` (i.e `name="do-something-action-button"`) would get the styles applied, I have tried the above code with specifically `Button` and `*` tag targets and it doesnt error but doesn't seem to propagate those styles to anything that should match.

    I am just using "ends with" but there is starts with `^` and contains `*` as well as some others:
    https://www.w3schools.com/cssref/sel_attr_end.asp