Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect calculation #658

Closed
qasimalyas opened this issue May 7, 2012 · 2 comments
Closed

Incorrect calculation #658

qasimalyas opened this issue May 7, 2012 · 2 comments

Comments

@qasimalyas
Copy link

I'm coming across a weird issue where stylus isn't returning the correct result for a simple calculation.

I have three variables of which I subtract two values and divide the remainder by two. The expected result would be a 191px but im getting 382px/2; which isn't right at all.

I've replicated the issue in an isolated test case: http://dl.dropbox.com/u/120890/test.zip and as a comparison I replicated the same code in SCSS and it returns the correct value http://jsfiddle.net/wV2bP/1/.

I could be doing something very wrong but this is a very simple arithmetic which I expected to work without any problems. If i'm doing something wrong then please let me know.

@tj
Copy link
Contributor

tj commented May 7, 2012

css uses / for some prop values so you have to wrap with parens when used in a property to disambiguate, for example:

font: 14px/1.5;

vs

font: (14px/1.5);

@qasimalyas
Copy link
Author

Ok that works. Thanks for quick response TJ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants