Skip to content

This PostCSS plugin safely converts CSS selector names to camelCase, without affecting pseudo selectors and attributes.

License

Notifications You must be signed in to change notification settings

idolgoff/postcss-safe-camel-case

 
 

Repository files navigation

postcss-safe-camel-case

This PostCSS plugin safely converts CSS selector names to camelCase, without affecting pseudo selectors and attributes. Turns .block__element--modifier :not(:first-child) into .blockElementModifier :not(:first-child).

Warnings

Removing - and _ characters from CSS class names may cause naming conflicts:

.my-class -> .myClass
.my_class -> .myClass

Why?

While both styles are valid and can be used interchangeably, camelCase selectors are more commonly used in JavaScript and other programming languages. This is because camelCase is easier to read and more consistent with the naming conventions used in those languages. It is mainly built for CSS Modules.

About

This PostCSS plugin safely converts CSS selector names to camelCase, without affecting pseudo selectors and attributes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%