RadValentin / postcss-prefix-selector

Prefix all CSS rules with a selector
MIT License
165 stars 16 forks source link

Add new options includeFiles #87

Closed MaximusFT closed 3 years ago

MaximusFT commented 3 years ago

I hope all my changes will be clear. Add tests for all new cases. All test is green image

Feel free to write in any question.

PS: for me important to use an updated version in my project )

MaximusFT commented 3 years ago

These changes can help to close #77 issue.

RadValentin commented 3 years ago

I'm not sure I understand how bethSymbol is supposed to be used. To get this result .hello+.a, which is the same as .hello + .a you could just set the existing prefix param to: prefix: '.hello +'. AFAIK CSS doesn't care if there are spaces or not.

For gluing the prefix to the selector (.hello.a), the transform param can be used:

transform(prefix, selector, prefixedSelector) {
  return prefix + selector;
}

Since both the cases you presented are already covered by existing functionality then I'd avoid adding more params to the plugin.

RadValentin commented 3 years ago

These changes can help to close #77 issue.

That issue was referring to prefixing only certain selectors, not certain files so sadly it will remain open :(

MaximusFT commented 3 years ago

These changes can help to close #77 issue.

That issue was referring to prefixing only certain selectors, not certain files so sadly it will remain open :(

Yes, you right... I didn't pay enough attention

MaximusFT commented 3 years ago

Update PR. Leave new tests and solve them as you propose.

MaximusFT commented 3 years ago

@RadValentin Thanks for the review. Update PR

RadValentin commented 3 years ago

Looks good to me! 👍 Thanks for contributing, I'll release a new version of the plugin today.