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

Incompatible units with scssphp #107

Closed
jrmyio opened this issue Jun 13, 2013 · 4 comments
Closed

Incompatible units with scssphp #107

jrmyio opened this issue Jun 13, 2013 · 4 comments

Comments

@jrmyio
Copy link

jrmyio commented Jun 13, 2013

When using the scssphp filter i get the following error when dumping the MopaBootstrapBundle.

[Exception]
Incompatible units: "%" and "in".: failed at *margin-left: $fluidGridGutte
rWidth - (.5 / $gridRowWidth * 100px * 1%); vendor/
mopa/bootstrap-bundle/Mopa/Bundle/BootstrapBundle/Resources/public/sass/../
../bootstrap-sass/lib/_mixins.scss on line 621

@MattiJarvinen-BA
Copy link

Could you provide link to the _mixins.scss file?

@MattiJarvinen-BA
Copy link

http://sass-lang.com/try.html

$gridRowWidth: 20px;

.foo
{
width: (2.5 / $gridRowWidth * 100px * 1% );
}

gives

.foo {
  width: 12.5%; }

Internal calculation should be:

2.5/20px = 0,125 1/px;

0,125 1/px * 100px = 12,5

12,5 * 1% = 12.5%

@robocoder
Copy link
Collaborator

Ok, looks like we have multiple issues here. I'm going to revert b116089 in the meantime.

Example 1:

$gridColumns:             12 !default;
$gridColumnWidth:         60px !default;
$gridGutterWidth:         20px !default;
$gridRowWidth:            ($gridColumns * $gridColumnWidth) + ($gridGutterWidth * ($gridColumns - 1)) !default;

$fluidGridGutterWidth:    percentage($gridGutterWidth/$gridRowWidth) !default;

div {
*margin-left: $fluidGridGutterWidth - (.5 / $gridRowWidth * 100px * 1%);
}

ruby sass:

div {
  *margin-left: 2.07447%; }

scssphp (v0.0.7):

div {
  *margin-left: 2.12765%; }

Example 2:

$gridRowWidth: 20px;

.foo
{
width: (2.5 / $gridRowWidth * 100px * 1% );
}

ruby sass:

.foo {
  width: 12.5%; }

scssphp:

.foo {
  width: 0.13021px; }

@robocoder
Copy link
Collaborator

note to self: abstractions merged into master; wip branch needs to be rebased

robocoder added a commit that referenced this issue Nov 11, 2015
robocoder added a commit that referenced this issue Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants