KSPR
KSPR

Reputation: 2375

Adding the "%" to a variable

I want to write this mixin:

@mixin top_a($sep-a: 2.5) {
padding-top: $sep-a + %;}

But unfortunately this throws in an error. How do I add the percentage to the value correctly?

Upvotes: 3

Views: 132

Answers (1)

Hauleth
Hauleth

Reputation: 23586

Why not simply multiply by 1%?

padding-top: $sep-a * 1%;

Upvotes: 4

Related Questions