It is possible to pass parameters for CSS in class name? For example:
.mrg-t-X { margin-top: Xpx; }
<span class="mrg-t-10">Test</span>
In this example X should be 10.
No it isn't. The closest we have to this is the attr() function, but that only works within the content property:
attr()
content
figure::before { content: attr(data-before) ', '; } figure::after { content: attr(data-after) '!'; }
<figure data-before="Hello" data-after="world"></figure>
2.1m questions
2.1m answers
60 comments
57.0k users