Skip to content

Namespace interpolation #2728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeremieca opened this issue Nov 20, 2015 · 3 comments
Closed

Namespace interpolation #2728

jeremieca opened this issue Nov 20, 2015 · 3 comments

Comments

@jeremieca
Copy link

Hello,

Is it possible to use namespace interpolation in Less ?

 @color: "yellow";

 .example {
     #top-@color;                   // Use of #top-yellow namespace
     .inNamespaceMixin();
 }

Thanks !

@seven-phases-max
Copy link
Member

I've answered it at SO. (copying the answer just for reference):

Use parametric namespace instead (Notice namespaces and mixins are actually the same thing - i.e. the former is a purely logical abstraction).

@color: yellow;

 #top(yellow) {
     .square(@param) {
         width: @param;
         height: @param;
     }
 }

 .example {
     #top(@color); // use yellow #top namespace
     .square(10px);
 }

@seven-phases-max
Copy link
Member

As for the feature itself - see #1338 (also #2594 et al.).

@seven-phases-max
Copy link
Member

Merging to #1338.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@jeremieca @seven-phases-max and others