79822865

Date: 2025-11-17 23:25:18
Score: 2
Natty:
Report link

9 and 5 months later I ran into the same problem and google took me here. However after checking the docs provided by @Harry I saw it is possible. I will copy and paste the example from MDN docs (with some code styling) here:

div[data-rotate] {
  width: fit-content;
  transform-origin: 50% 50%;
  rotate: attr(data-rotate deg, 1.5deg);
}
<div data-rotate="-3">I am rotated by -3 degrees</div>
<div data-rotate="2">And I by 2 degrees</div>
<div data-rotate>And so am I, using the fallback value of 1.5deg</div>

(Edit 5 minutes later): Here is the link MDN docs - attr

Reasons:
  • Blacklisted phrase (1): Here is the link
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Harry
  • Low reputation (1):
Posted by: Peter Aravin