Created
April 9, 2019 14:32
-
-
Save tomhodgins/e7a1e755c89322768fb0903482ae77ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Valid CSS, polyfillable */ | |
.card-details { | |
transition: background-color .2s; | |
} | |
.list-card-details[--has='.member-avatar[title^="Tommy Hodgins"]'] { | |
background-color: rgb(200, 225, 255); | |
} | |
.list-card-details[--has='.member-avatar[title^="Dave Redfern"]'] { | |
background-color: rgb(200, 255, 225); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Valid CSS but unsupported */ | |
.card-details { | |
transition: background-color .2s; | |
} | |
.list-card-details:has(.member-avatar[title^="Tommy Hodgins"]) { | |
background-color: rgb(200, 225, 255); | |
} | |
.list-card-details:has(.member-avatar[title^="Dave Redfern"]) { | |
background-color: rgb(200, 255, 225); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
` | |
/* jsincss using a template string and a has() plugin */ | |
.card-details { | |
transition: background-color .2s; | |
} | |
${has('.list-card-details', '.member-avatar[title^="Tommy Hodgins"]', ` | |
background-color: rgb(200, 225, 255); | |
`)} | |
${has('.list-card-details', '.member-avatar[title^="Dave Redfern"]', ` | |
background-color: rgb(200, 255, 225); | |
`)} | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment