Git Product home page Git Product logo

Comments (4)

somegooser avatar somegooser commented on July 17, 2024 1

I know it is not the way but cant you change the "each" function with oldschool way?

@iterations: 100;

// helper class, will never show up in resulting css
// will be called as long the index is above 0
.loopingClass (@index) when (@index > 0) {

    // create the actual css selector, example will result in
    // .myclass_30, .myclass_28, .... , .myclass_1
    (~".span@{index}") {
        // your resulting css
        width: percentage((@index - 1) *0.01);
    }

    // next iteration
    .loopingClass(@index - 1);
}

// "call" the loopingClass the first time with highest value
.loopingClass (@iterations);

from less.php.

friendscottn avatar friendscottn commented on July 17, 2024

Did you find a workaround? Same issue here.

from less.php.

knospe- avatar knospe- commented on July 17, 2024

No yet, unfortunately.

from less.php.

Krinkle avatar Krinkle commented on July 17, 2024

Minimal test case:

// https://github.com/FortAwesome/Font-Awesome/blob/6.4.2/less/_variables.less
@fa-css-prefix          : fa;
@fa-size-scale-sm       : 14;
@fa-size-scale-lg       : 20;
@fa-size-scale-xl       : 24;
.fa-sizes() {
  sm                    : @fa-size-scale-sm;
  lg                    : @fa-size-scale-lg;
  xl                    : @fa-size-scale-xl;
}

// https://github.com/FortAwesome/Font-Awesome/blob/6.4.2/less/_mixins.less
.fa-size(@font-size) {
  line-height: (1 / @font-size) * 1em;
}

each(.fa-sizes(), {
  .@{fa-css-prefix}-@{key} {
    .fa-size(@value);
  }
});

http://ecomfe.github.io/est/fiddle/#version=3.6.0&autoprefix=false&est=false&autorun=false

On Less.js 3.6.0:

Syntax error: Function 'each' is undefined
Line 17: each(.fa-sizes(), {

On Less.js 3.7.0:

.fa-sm {
  line-height: 0.07142857em;
}
.fa-lg {
  line-height: 0.05em;
}
.fa-xl {
  line-height: 0.04166667em;
}

from less.php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.