Is there a way to dynamically change CSS?
I am trying to set the class=sheet padding-top: 28mm;
when the size of $anArray is less than 30. If the array has more than 30 elements then apply padding-top: 28 * 2 mm;
. Finally, if the array exceeds 60, use padding-top: 28 * 3 mm;
Do I really need to create:
.sheet2 {
padding-top: 56mm;
}
.sheet3 {
padding-top: 84mm;
}
And change the class selector using JavaScript?
I want to find a more efficient method. :(
<section class="sheet">
{{ $anArray }}
if(anArray)
another.css
.sheet {
box-sizing: border-box;
page-break-after: always;
padding-top: 28mm;
}