mateuszkocz / 3l

Lots of Love for LESS
http://mateuszkocz.github.io/3l/
150 stars 22 forks source link

Less namespace #2

Closed interactivellama closed 11 years ago

interactivellama commented 12 years ago

Thanks for your work.

This is a rather simple request. Could you place everything in its own namespace, so there aren't "mixin collisions"? See http://lesscss.org/#-namespaces

For HTML5/CSS3 classes and IDs can start with numbers, so I think wrapping everything in #3l {} would be fine.

mateuszkocz commented 12 years ago

Hi,

Thanks for this suggestion. I've thought about using the namespace before, but I've found this won't be really practical for 2 reasons:

  1. Why would someone want to create his/her own mixins when 3L already provides a solution?
  2. Using namespaces means writing additional letters and no one likes to make additional effort.

But since you made this suggestion, I guess there's a reason for why you need this feature. I'll add it somehow in the next 3L update (in a few days). Meanwhile can I ask you to share the reason why do you need it? Every insight of how people use 3L is greatly appreciated!

interactivellama commented 12 years ago

The reason is that another Less collection may be in use. Let's say someone is importing parts of bootstrap, HelpLess, SematicGrid, 3L, etc. and there is another opacity() or transition() mixin. How does another developer know which one is being referred it?

When I add multiple Less mixin collections I don't want to worry about them 'colliding.'

mateuszkocz commented 11 years ago

Took me longer than expected to update the 3L but now this feature is included in version 1.4.0-beta. You can actually use it in previous version as well. It's as simple as using #3L {@import "3L"} in your .less file. Then you'll just have to use for example #3L > .gradient(grey,orange).

interactivellama commented 11 years ago

Thanks, I'll look into that best of both world's namespace solution.