R
R
riddlr2018-10-03 14:11:44
css
riddlr, 2018-10-03 14:11:44

Is it possible to make an object with variables?

Is it possible to use something like this

$border = {
  sm: 30px,
  md: 50px
}

And than
border-radius: $border-sm

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-10-03
@riddlr

It is possible, but when using a property in an object, a colon is required, otherwise there will be an error

border-radius $border.sm // err
border-radius: $border.sm // good

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question