Comments (5)
@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.
@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.
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.
Have any ideas on solving this, without ruining postcss's modularity?
from postcss-for.
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)
- Simplier intervals HOT 3
- support negative numbers HOT 2
- Compiling Same styles classes together HOT 1
- Regression in 2.1.0 HOT 1
- cacl() function invalid in for loop HOT 3
- Feature Request: Support for...in loop HOT 2
- nth-of-type(($i)n) and $(i+1) not work well
- By keyword
- loop-error occurs (Module build failed: Undefined variable $i) HOT 4
- Compatibility with PostCSS 8 HOT 1
- Not calculating i+1
- margin align css output
- Compatibility with tailwind HOT 1
- Support for :root variables? HOT 2
- Example doesn't work HOT 1
- support for nested loops? HOT 2
- Usage of removeSelf causes deprecation warnings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-for.