These are chat archives for jescalan/roots

25th
Nov 2014
Matt Rossi
@mordecai174
Nov 25 2014 02:19

so @jenius on a clean roots install, i did the following:

in master.styl

@import _variables
@import '/contact-us/index'

in _variables.styl I have my spacing-block = 20px

in contact-us/index.styl

@import '_partial-filename.styl'

then in _partial-filename.styl I have spacing-block * 5 for padding on the body just to test and it fails

Error: /Users/mrossimojo/Desktop/dev/testvar/assets/css/contact-us/_partial-filename.styl:2
1| body

2| padding: spacing-block * 5
3|

cannot perform spacing-block * 5
at "body" (/Users/mrossimojo/Desktop/dev/testvar/assets/css/contact-us/_partial-filename.styl:174)

gives me this

compiling...

------------ ERROR ------------

Error: /Users/mrossimojo/Desktop/dev/newtestvar/assets/css/sub/_partial.styl:2
1| body

2| padding: spacing-block * 5
3|

cannot perform spacing-block * 5
at "body" (/Users/mrossimojo/Desktop/dev/newtestvar/assets/css/sub/_partial.styl:174)

at Ident.Node.operate (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/nodes/node.js:189:13)
at Ident.operate (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/nodes/ident.js:127:33)
at Evaluator.visitBinOp (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:437:28)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitExpression (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:500:26)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitExpression (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:500:26)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitProperty (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:536:22)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitBlock (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:563:39)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitGroup (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:182:22)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitBlock (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:563:39)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitImport (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:732:18)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.visitRoot (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:550:27)
at Evaluator.Visitor.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/index.js:28:40)
at Evaluator.visit (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:93:18)
at Evaluator.evaluate (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/visitor/evaluator.js:168:15)
at Renderer.render (/usr/local/lib/node_modules/roots/node_modules/stylus/lib/renderer.js:79:26)
at Transformer.exports.styl.exports.stylus.Transformer.async [as _renderAsync] (/usr/local/lib/node_modules/roots/node_modules/transformers/lib/transformers.js:435:12)
at /usr/local/lib/node_modules/roots/node_modules/transformers/lib/shared.js:110:12
at new Pr
Jeff Escalante
@jescalan
Nov 25 2014 15:35
did you try importing variables into index
i feel like you're pretty close to working it out here, did you just stop after that?
Matt Rossi
@mordecai174
Nov 25 2014 15:47
No I didn't try that, but I assume that would work, but probably not the best way to solve this, right? Then I'll have it referenced many times based on as many partials I have.
I assumed the variables would be available since they were included before the other includes
And just using the variable works but when multiplication is introduced it doesn't work
Jeff Escalante
@jescalan
Nov 25 2014 17:35
it seems like a stylus issue then
i might try filing this in stylus and seeing what they suggest
especially since you have now isolated it down to just stylus files
Matt Rossi
@mordecai174
Nov 25 2014 18:10
Ok I have an open issue. I'm going to update it with some more info. Is this a bad way to organize files though? This works fine in sass. It's nice to be able to move bigger blocks of styles or quickly scope sections by a class
Matt Rossi
@mordecai174
Nov 25 2014 19:30
issue closed. feel like a moron hah, needed an underscore on the index partial
thanks for the help though jeff
Jeff Escalante
@jescalan
Nov 25 2014 21:37
hah there we go
sorry i didnt notice that before!
Matt Rossi
@mordecai174
Nov 25 2014 23:54
Sam finally saw it and was like uhhh close the issue pal