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

Nested mixin changing important 2421 #2427

Merged
merged 2 commits into from
Feb 1, 2015

Conversation

SomMeri
Copy link
Member

@SomMeri SomMeri commented Feb 1, 2015

Fixing makeImportant on mixins and rulesets: #2421

  • Rulesets makeImportant must create a new ruleset.
  • Mixin-definition makeImportant must create a new mixin definition. It must not convert mixin into ruleset.

Why eval failed: mixin-definition inherited makeImportant function from ruleset. As makeImportant cascaded to nested objects, every nested mixin was converted into ruleset and lost all parameters, conditions, etc.

So, nested set-width(@aaa) in following code:

.size(@aaa) {
  .set-width(@aaa) {
    width: @aaa; 
  }
  .set-width(@aaa);
}
.when-calling-nested-with-param-issue-2394 {
  .size(10px) !important;
}

was transformed into:

.when-calling-nested-with-param-issue-2394 {
  .set-width {
    width: @aaa; //fails on undefined variable
  }
  .set-width(10px);
}

which failed on undefined variable.

jurcovicovam added 2 commits February 1, 2015 15:32
1.) Rulesets `makeImportant` must create a new ruleset.
2.) Mixin-definition `makeImportant` must create a new mixin definition.
It must NOT convert mixin into ruleset.
lukeapage added a commit that referenced this pull request Feb 1, 2015
…-2421

Nested mixin changing important 2421
@lukeapage lukeapage merged commit 4f60ab1 into less:master Feb 1, 2015
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

Successfully merging this pull request may close these issues.

2 participants