R
R
rtfm mftr2016-04-10 12:46:24
css
rtfm mftr, 2016-04-10 12:46:24

Removal of common properties or abbreviated notation?

Which option is better? In the first case, not an abbreviated notation is obtained, three rules instead of one, in the second, the repetition of the same values
​​1.

.btn-social
    border: 1px solid red
    background-repeat: no-repeat
    background-position: center
.btn-social--fb
    background-image: url(...)
.btn-social--twitter
    background-image: url(...)

2.
.btn-social
    border: 1px solid red
.btn-social--fb
    background: url(...) no-repeat center
.btn-social--twitter
    background: url(...) no-repeat center

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-04-10
@rtfmmftr

I prefer the first option. Code is easier to read and easier to maintain when properties are grouped.
Of course, you should not adhere to this rule until you foam at the mouth either: proceed from the context of the specific task and do it in the most logical way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question