gulp postcss cssnano does not combine the same selector when it is not next to it

379 Views Asked by At

Gulp in postcss with cssnano combine the same selector when the selector next to it but unfortunately it does not combine the selector when it is not next to it.

It works very well when selectors are next to it

.box {
    color: blue;
}
.box {
    font-weight: 700;
}

to

.box {
    color: blue;
    font-weight: 700;
}

unfortunately it doesn't do the job when it is not next it

.box {
    color: blue;
}
.love{
  color: red;
}
.box {
    font-weight: 700;
}
0

There are 0 best solutions below