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

Responsive gutter classes #16

Open
colourgarden opened this issue Mar 10, 2016 · 6 comments
Open

Responsive gutter classes #16

colourgarden opened this issue Mar 10, 2016 · 6 comments

Comments

@colourgarden
Copy link
Owner

In response to a tweet - would anyone find responsive gutter classes like .grid--small--portable useful?

Currently, Avalanche has .grid--small etc where the gutter width can be modified for a grid but maybe there is a need for these to be controlled at a breakpoint level as well?

To achieve this, add a new Sass map to settings for the required gutters:

$av-gutters:  (
  "tiny":   0.25,
  "small":  0.5,
  "large":  2,
  "huge":   4
);

Then loop through these and the breakpoints to create the responsive breakpoint gutter classes:

@each $alias, $query in $av-breakpoints{
  @media #{$query}{
    @each $gutter-alias, $multiplier in $av-gutters{
      .#{$av-namespace}--#{$gutter-alias}--#{$alias}{
        margin-left: -($av-gutter * $multiplier);

        > .#{$av-namespace}__cell{
          padding-left: ($av-gutter * $multiplier);
        }
      }
    }
  }
}
@igaman
Copy link

igaman commented Mar 17, 2016

yes, thanks a lot, we implement your avalanche grid system in your framework:
http://sandbox.devbea.fr/bff_avalanche/html/05-grid-avalanche.php

Merci

@colourgarden
Copy link
Owner Author

@igaman Hi. There's authentication on the link you sent so I can't access.

@GesJeremie
Copy link

GesJeremie commented Jun 21, 2017

I currently need it. I would like to be able to set/unset a grid--right depending the breakpoint. I think it would make sense to include that in the core of Avalanche ⚡️

@GesJeremie
Copy link

Something like that:

@if $av-enable-grid-center {

    @each $alias, $query in $av-breakpoints {
        @media #{$query} {

            .#{avCreateBlockClassName('center')}-at-#{$alias} {
                text-align: center;

                > .#{avCreateElementClassName()} {
                    text-align: left;
                }
            }

        }
    }
}

@if $av-enable-grid-right {

    @each $alias, $query in $av-breakpoints {
        @media #{$query} {

            .#{avCreateBlockClassName('right')}-at-#{$alias} {
              text-align: right;

              > .#{avCreateElementClassName()} {
                text-align: left;
              }
            }

        }
    }

}

@colourgarden colourgarden reopened this Jun 26, 2017
@colourgarden
Copy link
Owner Author

Hi @GesJeremie. Could you submit a PR for this? Seems like a good option.

@colourgarden
Copy link
Owner Author

#33

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