Coder Social home page Coder Social logo

Comments (5)

xori avatar xori commented on September 13, 2024 1
@for @i from 1 to $max-columns {
  .col-t-@i { width: calc(@i / $max-columns * 100%); }
}

IMO I think you could get away with making it a variable that simple-var doesn't recognize. I also think that it would make semantic sense as the variable @i is specific to this code block.

Now you can run this after simple-vars but before calc and you're golden.

Update:
for anyone who happens upon this with google like I did, I forked this repo to enable the above syntax. I just needed it to just-workβ„’
@antyakushev maybe you'd consider a modified pull request to allow both the $i syntax or the @i syntax

from postcss-for.

antyakushev avatar antyakushev commented on September 13, 2024 1

@xori I assumed that postcss-custom-properties, which is css future syntax, can be used for this.
For now I'll mention both of the ways in the ReadMe to make googling easier.

from postcss-for.

antyakushev avatar antyakushev commented on September 13, 2024

That's how PostCSS works. Postcss-for cannot be used after postcss-simple-vars since it will replace loop's $i. And being put before, postcss-for won't know the value variable stands for.

from postcss-for.

antyakushev avatar antyakushev commented on September 13, 2024

Have any ideas on solving this, without ruining postcss's modularity?

from postcss-for.

tunnckoCore avatar tunnckoCore commented on September 13, 2024

since it will replace loop's $i

that's the idea, but hmm..
you have right, maybe it make more sense for foreach loop for collections.

from postcss-for.

Related Issues (18)

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.