componentjs / builder2.js

builder for component
50 stars 20 forks source link

compile locals with the module itself ? #27

Closed queckezz closed 10 years ago

queckezz commented 10 years ago

I'm really confused by how the builder compiles css. One problem that I always have is sharing mixins or variables etc. Let's say I want to have a style-vars component with my global color scheme in it and I want to reuse these variables in each of my components. As of right now, the builder runs every given plugin through every component but not together with the locals so variable sharing etc is not possible.

How can I solve this? I don't want to hard code the colors in components. I guess a module system for css is kind of overkill.

jonathanong commented 10 years ago

process your CSS on the final build, not as a plugin. i have two rework steps, one on a per-plugin basis, another that works on the entire build.

queckezz commented 10 years ago

Hm yeah I haven't thought about that. That would mean that every mixin and variable will be global but I guess that's not a huge problem. Thanks!

jonathanong commented 10 years ago

meh not a big deal as remote components shouldn't be using mixins and variables. i still think this is an anti-pattern though and am trying to stop doing this. need to stop using rework.extend() =_=