JPeer264 / node-rcs-core

Rename css selectors across all files
MIT License
37 stars 7 forks source link

Replacing attribute-selectors in a smart way #36

Closed JPeer264 closed 6 years ago

JPeer264 commented 6 years ago

As mentioned in https://github.com/JPeer264/node-rcs-core/issues/33#issuecomment-384650054 it should be possible to prefix/suffix out the attribute selectors to achieve smaller selectors which are selectable by attribute selectors.

Example before:

.select-a-long-name, .select-another-name {
  margin-left: 10px;
}
.board > [class^=select-] {
  padding: 0;
}

After

.selecta, .selectb {
  ...
}
.a > [class^=select] {
  ...
}