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

Column alignment issue #54

Closed
ryanduffy opened this issue Oct 18, 2012 · 21 comments
Closed

Column alignment issue #54

ryanduffy opened this issue Oct 18, 2012 · 21 comments
Labels

Comments

@ryanduffy
Copy link

I'm experiencing a weird column alignment issue on a very simple 12 column grid.

.grid {
@include grid-objects(a, 12, 2%, $selector: ".");
}

a3-6 and a6-9 are aligned further to the right than they should be. they go off the proposed grid, because the margin-left calculation appears to be off.

@scottkellum
Copy link
Member

Can you let us know what browser you are running? Also be sure you are running the latest version of Singularity. We have had similar reports in the past and concluded they are browser rounding bugs. When I have time I will try to isolate this some more and try to find what is at fault.

@ryanduffy
Copy link
Author

Sure Scott. I've tested it in Chrome 22.0.1229.94 and Safari 6.0.1 so far. I have Singularity 1.3.6 installed.

Let me know if you need any other info.

@Snugug
Copy link
Member

Snugug commented Oct 18, 2012

You have Singularity 1.3.6 installed? Can you double check that for us by running gem list from your command line and copying the singularitygs line for us? I ask you to double check because the current version of Singularity is 0.0.15.1

@ryanduffy
Copy link
Author

Sorry my mistake (i'm a little inexperienced with this), I was using gem --version singularity, but I now see that's not right. Here's my gem list...

actionpack (3.2.8)
activemodel (3.2.8)
activesupport (3.2.8)
breakpoint (1.3)
builder (3.0.4)
chunky_png (1.2.5)
compass (0.12.2, 0.12.1)
compass-susy-plugin (0.9)
erubis (2.7.0)
fssm (0.2.9)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (1.0.19)
json (1.7.5)
modular-scale (1.0.2, 0.0.5)
multi_json (1.3.6)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
redis (2.2.2)
redis-native_hash (0.2.2)
rubygems-update (1.8.24)
sass (3.2.1, 3.2.0.alpha.277, 3.2.0.alpha.244, 3.1.19)
sassy-math (1.2)
singularitygs (0.0.15.1)
sprockets (2.1.3)
thor (0.16.0)
tilt (1.3.3)

@Snugug
Copy link
Member

Snugug commented Oct 18, 2012

Awesome, not a problem. You are on the most recent version of Singularity; good.

@micahgodbolt
Copy link
Contributor

Funny, I just came across this as well. It must have something to do with the grid-object's calculation of gutter. If you remove the gutter from the grid object...

@include grid-objects(a, 12, $selector: ".");

then the columns lay out consistently (though it appears to default to around a 5% gutter).

@Snugug
Copy link
Member

Snugug commented Oct 18, 2012

I think this may be related to the fact I haven't looked at the grid objects since doing all of the multi-grid, new layout stuff. I think there's an issue in the backlog to make sure this works, which it sounds as if it doesn't work quite right.

The default gutter, BTW, is .25 which may work out to about 5%, depending on how you set up your total grid.

@ryanduffy
Copy link
Author

ok this helps, at least for the time being. thanks micah & snugug.

@micahgodbolt
Copy link
Contributor

Yeah @Snugug - i tracked it a bit further. The grid-span mixin doesn't work properly when you pass a gutter to it. This happens in grid-objects as well as when written manually

  @include grid-span(1, 2, $gutter-span:2%);

@Snugug
Copy link
Member

Snugug commented Oct 18, 2012

Interesting, however it should be noted that gutters cannot be written in percentages, they need to be unit less numbers.

On Thursday, October 18, 2012 at 1:42 PM, Micah Godbolt wrote:

Yeah @Snugug (https://github.com/Snugug) - i tracked it a bit further. The grid-span mixin doesn't work properly when you pass a gutter to it. This happens in grid-objects as well as when written manually
@include grid-span(1, 2, $gutter-span:2%);


Reply to this email directly or view it on GitHub (https://github.com/scottkellum/Singularity/issues/54#issuecomment-9573666).

@micahgodbolt
Copy link
Contributor

Oh, not writing gutter in % certainly changes things :) I see that passing a gutter of .25 (as you said, the default value), gives the same result as passing nothing. So that part is confirmed.

When you pass anything other than .25 it appears that the left margin updates properly, but the width of the span doesn't change.

Yup, simple 4 column grid, each column is ~21% no matter the gutter size.

@Snugug
Copy link
Member

Snugug commented Oct 18, 2012

Hmm, now that's interesting; I thought I had thought I had that working. Take a look at the, admittedly, somewhat spaghetti code that exists in gutter-span to try and debug.

@micahgodbolt
Copy link
Contributor

Yeah, i tracked it down to the column-span function so far. It appears that the gutter value isn't even being passed in to get the width value.

@Snugug
Copy link
Member

Snugug commented Oct 18, 2012

Haha, um, whoops?

@micahgodbolt
Copy link
Contributor

BOOM! Done.

@micahgodbolt
Copy link
Contributor

want me to push this fix up seperately?

@Snugug
Copy link
Member

Snugug commented Oct 18, 2012

You can either pass it as a hotfix, or pass it w/the rest of your work and they'll all get merged together. Totally up to you.

@micahgodbolt
Copy link
Contributor

i'll push that up hotfix. The other change is going to require some documentation updates. People will need to rewrite their classes in the new format when extending.

@micahgodbolt
Copy link
Contributor

Oh man...I get to remember how to 'stash' :)

@micahgodbolt
Copy link
Contributor

oh nevermind. i haven't added the files to a branch yet. easy peazy.

@micahgodbolt
Copy link
Contributor

Sorry everyone for the comment spam. This has been fixed and pushed to Master.

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

No branches or pull requests

4 participants