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

Trouble with variables in CSS3 calc() statement #1002

Closed
CodingFu opened this issue Nov 6, 2013 · 2 comments
Closed

Trouble with variables in CSS3 calc() statement #1002

CodingFu opened this issue Nov 6, 2013 · 2 comments

Comments

@CodingFu
Copy link

CodingFu commented Nov 6, 2013

Please consider the following SCSS code

$sidebar-width: 300px;
.main {
  width: calc(100% - $sidebar-width);
}

that compiles into the following incorrect CSS...

.main {
  width: calc(100% - $sidebar-width);
}

whereas the expected result is:

.main {
  width: calc(100% - 300px);
}

$ sass --version
Sass 3.2.12 (Media Mark)
@10xLaCroixDrinker
Copy link

You need to escape the variable within your parens

.main {
  width: calc(100% - #{$sidebar-width});
}

That should return your expected result.

@CodingFu
Copy link
Author

CodingFu commented Nov 7, 2013

Thanks a lot

@nex3 nex3 closed this as completed Dec 6, 2013
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

3 participants