- From: Sebastian Zartner via GitHub <sysbot+gh@w3.org>
- Date: Fri, 01 Jan 2021 18:43:32 +0000
- To: public-css-archive@w3.org
If I unterstand your proposal correctly, then the [`attr()` function](https://drafts.csswg.org/css-values-4/#attr-notation) might already cover your use case.
It keeps the selectors untouched but references the values defined in element attributes.
Here are some examples:
```css
.selector {
opacity: attr(data-opacity number); /* numeric value */
font-size: attr(data-font-size length); /* length value */
background-color: attr(data-bgcolor color, white); /* color value with white as fallback */
background-image: url(attr(data-bgimage url)); /* url value */
}
```
Though note that this function is still under discussion due to [security concerns](https://github.com/w3c/csswg-drafts/issues/5092) among other things.
Happy New Year! 🥳 🍾
Sebastian
--
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5824#issuecomment-753364311 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 1 January 2021 18:43:35 UTC