Sha256: ebcd9e654d3dceca130ea8a5820a0387a30772b07700a07bc60175a311bef609

Contents?: true

Size: 831 Bytes

Versions: 5

Compression:

Stored size: 831 Bytes

Contents

// Sets up a element and its child elements with the flexbox properties needed
// to have the given number of columns with optional gutters or margins.
@mixin has-cards($columns, $margin: 0) {
  @include align-content(flex-start);
  @include align-items(stretch);
  @include display(flex);
  @include flex-direction(row);
  @include flex-wrap(wrap);
  @include justify-content(space-around);
  column-count: $columns; // Used as a reference for JavaScript functions
  padding: $margin 0 0 $margin;

  > * {
    @include flex(1 1 auto);
    margin: 0 $margin $margin 0;
    width: (1 / $columns) * 85%;

    &:empty {
      margin-bottom: 0;
      margin-top: 0;
      visibility: hidden;
    }
  }

  @media (max-width: $mobile-breakpoint) {
    > * {
      width: 100%;

      &:empty {
        display: none;
      }
    }
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
codelation_assets-0.3.5 app/assets/stylesheets/codelation/mixins/has_cards.scss
codelation_assets-0.3.4 app/assets/stylesheets/codelation/mixins/has_cards.scss
codelation_assets-0.3.3 app/assets/stylesheets/codelation/mixins/has_cards.scss
codelation_assets-0.3.2 app/assets/stylesheets/codelation/mixins/has_cards.scss
codelation_assets-0.3.0 app/assets/stylesheets/codelation/mixins/has_cards.scss