Including attribute in complex selector

This forum is for all Flare issues related to styles, stylesheets and XML.

Including attribute in complex selector

Postby mdpais-c on Wed Mar 24, 2021 10:33 am

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?
mdpais-c
Jr. Propeller Head
 
Posts: 9
Joined: Wed May 13, 2020 11:56 am

Re: Including attribute in complex selector

Postby Dave Lee on Wed Mar 24, 2021 12:36 pm

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?
Dave Lee
Master Propellus Maximus
 
Posts: 5959
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Including attribute in complex selector

Postby mdpais-c on Fri Mar 26, 2021 8:27 am

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.
mdpais-c
Jr. Propeller Head
 
Posts: 9
Joined: Wed May 13, 2020 11:56 am


Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 8 guests