Including attribute in complex selector

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
mdpais-c
Propeller Head
Posts: 20
Joined: Wed May 13, 2020 11:56 am

Including attribute in complex selector

Post by mdpais-c »

I need to include an attribute in a complex selector in my stylesheet but can't figure out how to do this in Flare. I know that CSS supports this by including the attribute and value within [], and I've tried including the same in the stylesheet using the internal text editor but I've had no luck. The styles are simply not applied to the selectors with the attribute declared.

Has anyone had any luck with using attributes in complex selectors in Flare?
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Including attribute in complex selector

Post by NorthEast »

Yes, I use them - some examples:

Add icons to links to PDF files:
a[href*=".pdf"]:after { }

Add icons to links in a relationships proxy:
div[class^="MCRelationshipsProxy"] > p[class*="Item"]:before { }

Style any tag that is a named toggler target:
[data-mc-target-name] { }


Do you want to give an example of what you've tried or are trying to do?
mdpais-c
Propeller Head
Posts: 20
Joined: Wed May 13, 2020 11:56 am

Re: Including attribute in complex selector

Post by mdpais-c »

Dave Lee wrote: Style any tag that is a named toggler target:
[data-mc-target-name] { }
Brilliant. I have a bunch of h3 headings in my project, some of which toggle the div below them. I wanted to change the left margin for the divs that are toggled and had tried h3 + div[target] which didn't work. data-mc-target-name worked though. Thank you.
Post Reply