How do I set two (or more) css parameters at once?

1

I wonder if it's possible, in a scenario where the two values are the same. I would do this to advance writing.

For example, pass HEIGHT and WIDTH together: height, width: 50px;

I tried to do this, but it did not work ... Someone?

    
asked by anonymous 30.12.2016 / 00:53

1 answer

3

The maximum you can do is to store the value in a variable:

div {
  --size: 30px;
  width: var(--size);
  height: var(--size);
  background: #333;
}
<div></div>

More about variables in CSS .

Support .

More features will require a preprocessor.

    
30.12.2016 / 01:09