Skip to content
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

Using a dynamically via-parent-operator-generated class #2934

Closed
singha-cz opened this issue Jul 25, 2016 · 3 comments
Closed

Using a dynamically via-parent-operator-generated class #2934

singha-cz opened this issue Jul 25, 2016 · 3 comments

Comments

@singha-cz
Copy link

Hi,
I'm getting the "Error: .weight-400 is undefined" message when trying to use a dynamicaly generated (via parent operator) class name.

Is there any way how to make this work?

.weight{
&-100 { font-weight: 100; }
&-200 { font-weight: 200; }
&-300 { font-weight: 300; }
&-400 { font-weight: 400; }
&-500 { font-weight: 500; }
&-600 { font-weight: 600; }
&-700 { font-weight: 700; }
}

h1{
.weight-400;
}

@Justineo
Copy link
Contributor

See #1399.

@seven-phases-max
Copy link
Member

Merging to #1399. Also regarding this particular example and considering #1399 (comment) and #2702 (comment) I'd just suggest to write it in opposite (first "normal" mixin then CSS class) e.g.:

.weight(@v) {
    font-weight: @v; 
}

.weight {
    .w(100);
    .w(200);
    .w(300);
    .w(400);
    .w(500);
    .w(600);
    .w(700);
    .w(800);
    .w(@v) {&-@{v} {.weight(@v)}}
}

h1 {
    .weight(400);
}

See also #2749.

@seven-phases-max
Copy link
Member

Merging to #1399.

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