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 working grid-* with fixed cols #29

Open
ixrock opened this issue Oct 11, 2016 · 8 comments
Open

Incorrect working grid-* with fixed cols #29

ixrock opened this issue Oct 11, 2016 · 8 comments

Comments

@ixrock
Copy link

ixrock commented Oct 11, 2016

Expectation: .grid-6 > .col-2 = 2/6 = 1/3 = 100% / 3
Reality: .grid-6 > .col-2 = 2/12 = 1/6
It seems like only one 12-columns grid supported?

@bryanwillis
Copy link

bryanwillis commented Oct 12, 2016

.grid-6 gives you a "grid" where all nested .col are 1/6 width.

grid-5 would split up the col into 5ths so technically this isn't just a 12-column grid since you can make odd columns. Your expectation would be pretty cool though if I understanding it correctly.

@ixrock
Copy link
Author

ixrock commented Oct 12, 2016

@bryanwillis .grid-6 by the name means 6-columns grid, right?
If so.. .col-2 should take 1/3 of all possible space in the grid.

screenshot 2016-10-13 01 09 25

@bryanwillis
Copy link

@ixrock Yea that's what I thought you meant. Seems like a great idea.

I forked your gist and added an explanation of how it currently works if you want to look at that to make sure we're on the same page here.

http://codepen.io/bootstrapped/pen/KgZvyW?editors=1100

I'm wondering if there's a reason it doesn't work like this or if maybe no thought to do that.
Looking at Can I Use it looks like this wouldn't work in Internet Explorer, but I don't have a Windows PC so I can't test it out.

We should also check that it doesn't affect nested "grid col-*"

@bryanwillis
Copy link

Tested it with grid col and nested elements and it seems to be working.

http://codepen.io/bootstrapped/pen/KgZvyW?editors=1100

@bryanwillis
Copy link

bryanwillis commented Oct 14, 2016

I think another problem is overly complex naming conventions. This issue obviously shows that there is confusion with the current functionality. But also the suggested implementation can quickly get complicated as well.

Take this example.

<div class="grid-6">
    <div class="col-2 grid">
        <div class="col-6">
        How should this work?
        </div>
    <div class="col-6 grid">
        <div class="col-2"></div>
        <div class="col-8 grid">
            <div class="col-6"></div>
            <div class="col-6"></div>
            <div class="col-4"></div>
            <div class="col-4"></div>
            <div class="col-4"> </div>
        </div>
    </div>
</div>

The nested column wouldn't work as expected based on @ixrock example.

We could try changing:

.grid-6 .col-2 {
flex-basis: calc(100% / 6 * 2);
}

to:

.grid-6 > .col-2 {
flex-basis: calc(100% / 6 * 2);
}

I haven't tested it though. My guess is that it's still going to be complicated. For example grid can be used so many ways currently.

<div class="grid-6">
    <div class="col-2">
       <div class="col-8 grid">
          <div class="col-4">
            <div class="grid">
            </div>
          </div>
    </div>
    <div class="col-2 grid">
       <div class="col-8">
          <div class="col-4">
            <div class="grid-3">
            </div>
          </div>
    ......

Obviously this example is overkill, and probably wouldn't actually be used, but it's just to show that adding even more logic to the already complex nature of grid could make things even more complicated to understand than it already is.

@centrual
Copy link

centrual commented Mar 30, 2017

https://vgy.me/rWpEYG.png
Version: 2.2.5

@dannyuk1982
Copy link

I am getting this too - even if the grid is set to i.e. grid-10 or grid 5, it always treats it as a 12 column grid

for this a col-1 in a grid-5, this should be 20%, but the CSS later overrides it:

screen shot 2017-07-26 at 13 03 27

@dannyuk1982
Copy link

Putting a load of !important at the end of the relevant lines in gridlex-vars.scss lines 48 - 107 seems to fix this, but could be breaking something else, I haven't tested thoroughly

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

4 participants