Hacker Times
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
brazukadev
6 months ago
|
parent
|
context
|
favorite
| on:
It is ok to say "CSS variables" instead of "custom...
I dont mind the var(--foo) but I wish I could do var(attr(foo)) to use a var defined in the attribute foo.
Latty
6 months ago
[–]
`attr()` is being updated to basically do that, the modern spec lets you specify a datatype and access any attribute (with some exceptions, you can't get URL types for security reasons), then use it generally.
E.g: aspect-ratio: attr(width px) / attr(height px);
silverwind
6 months ago
|
parent
[–]
Interestingly, the bug for this feature is already 17 years old (
https://bugzilla.mozilla.org/show_bug.cgi?id=435426
).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: