Question

I am using lessphp (latest from git)

Is it possible to call a mixin from another mixin in the same "namespace"?

Here is a short sample of code which produces no output (but should give a border to h1)

#test {
    .mix() {
        border: 1px solid #000000;
    }

    .mix2() {
        .mix();
    }
}

h1 {
    #test > .mix2();
}
Was it helpful?

Solution

I got it to work by adding this:

#test {
    .mix() {
        border: 1px solid #000000;
    }

    .mix2() {
        #test .mix();
    }
}

h1 {
    #test > .mix2();
}

OTHER TIPS

Try:

#test {
  ...
  .mix2() {
    .mix;
  }
}
h1 {
  #test > .mix2;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top