gss / parser

Constraint Cascading Style Sheets compiler
MIT License
48 stars 6 forks source link

Issues with variables and basic math #19

Closed paulyoung closed 10 years ago

paulyoung commented 10 years ago

First issue is that in the following scenario, [large-message-width] is 480, but [large-message-height] is 0:

[message-height] == 230;
[message-width] == 240;

[large-message-height] == [message-height] * 2;
[large-message-width] == [message-width] * 2;

Second issue is that the following:

[message-height] == 230;
[message-width] == 240;

[message-scale] == 2;
[large-message-height] == [message-height] * [message-scale];
[large-message-width] == [message-width] * [message-scale];

causes the error:

Uncaught Error: Uncaught (c.NonExpression) The resulting expression would be non (http://localhost:8000/bower_components/gss/dist/worker.js:16) gss.js:22167
Uncaught (c.NonExpression) The resulting expression would be non worker.js:16
d4tocchini commented 10 years ago

First issue should be working... That's strange, can you point to isolated example where this isn't working?

Second issue doesn't work b/c it's non-linear, unfortunately can't multiply or divide by two variables b/c Cassowary can only handle linear relationships.

paulyoung commented 10 years ago

First issue - tried but couldn't reproduce in isolation. In my situation, adding !require to [message-height] makes [large-message-height] work as expected.

Second issue - totally forgot. Used to using Sass where I can do that sort of thing.