✍️ New Article: First Look at The Modern attr() I explored the new attr() capabilities and shared my thoughts about it. Happy reading! ishadeed.com/article/mode...
34 reposts132 likes
✍️ New Article: First Look at The Modern attr() I explored the new attr() capabilities and shared my thoughts about it. Happy reading! ishadeed.com/article/mode...
34 reposts132 likes
It seems you had the confusion I see a lot. Keyword values are not "string" but "custom-ident" so you can use the value auto (as well as other keyword) like below: [mx] { margin-inline: attr(mx type(<custom-ident>)); } codepen.io/t_afif/pen/p...
Or you can choose to allow `auto` explicitly (if that’s the only keyword you want to support): ``` margin-inline: attr(mx type(<length> | auto)); ``` Demo: codepen.io/bramus/pen/e...
I found a way to make it work: codepen.io/xeho91/pen/b... But I wonder if it would be possible to omit the necessity of defining attribute `bg-color="var(--red)"` and pass `--red` or `red` instead?