Namespacing of CSS classes created by packages?


Somewhat related to @mark_hahn’s topic about making one’s own package’s decorators stand out amongst a potential sea of other decorators, I was thinking about the eventual future when Atom has a bunch of packages that modify the UI one way or the other and how packages may end up having conflicting CSS class names. This isn’t a fully formed thought yet, but I think we should come up with a system of namespacing a package’s CSS classes so that:

  1. The foo package’s bar class can be individually styled if that is what the user wishes
  2. All packages’ bar classes can be styled together if that is what the user wishes

And then we should probably publish it as a best practice for package authors to follow.

What does everyone think?


Sounds great but we need more details.

I really like the standard that package names are full words separated by hyphens. Where did that standard come from?


This is tricky. Modern css relies heavily on Less indents and therefore often, it’s sufficient to put a class on a parented object etc. Most of the times this would result in unioned properties if they collide. For example maybe packages can cross communicate with shared dom elements. Technically they do, with built in ones today.

All that said I choose to prefix with my package name :stuck_out_tongue: