Sha256: 55098d9aee3da9bd73cf3605d71464abc2fbd9c9ce631e0c45e7453721c2af5b

Contents?: true

Size: 1.55 KB

Versions: 399

Compression:

Stored size: 1.55 KB

Contents

// Flexible grid
@function flex-grid($columns, $container-columns: $fg-max-columns) {
  $width: $columns * $fg-column + ($columns - 1) * $fg-gutter;
  $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
  @return percentage($width / $container-width);
}

// Flexible gutter
@function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) {
  $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
  @return percentage($gutter / $container-width);
}

// The $fg-column, $fg-gutter and $fg-max-columns variables must be defined in your base stylesheet to properly use the flex-grid function.
// This function takes the fluid grid equation (target / context = result) and uses columns to help define each.
//
// The calculation presumes that your column structure will be missing the last gutter:
//
//   -- column -- gutter -- column -- gutter -- column
//
//  $fg-column: 60px;             // Column Width
//  $fg-gutter: 25px;             // Gutter Width
//  $fg-max-columns: 12;          // Total Columns For Main Container
//
//  div {
//    width: flex-grid(4);        // returns (315px / 995px) = 31.65829%;
//    margin-left: flex-gutter(); // returns (25px / 995px) = 2.51256%;
//
//    p {
//      width: flex-grid(2, 4);  // returns (145px / 315px) = 46.031746%;
//      float: left;
//      margin: flex-gutter(4);  // returns (25px / 315px) = 7.936508%;
//    }
//
//    blockquote {
//      float: left;
//      width: flex-grid(2, 4); // returns (145px / 315px) = 46.031746%;
//    }
//  }

Version data entries

399 entries across 388 versions & 16 rubygems

Version Path
card-mod-bootstrap-0.18.1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.18.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.17.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.16.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.6 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.5 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.4 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.3 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.1.2 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.2.pre1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.1.1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
card-mod-bootstrap-0.15.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/functions/_flex-grid.scss
portfolio-jekyll-theme-2.0.0 _sass/1-tools/bourbon/functions/_flex-grid.scss
daiblogs-0.2.1 _sass/bourbon/functions/_flex-grid.scss
daiblogs-0.2.0 _sass/bourbon/functions/_flex-grid.scss
daiblogs-0.1.5 _sass/bourbon/functions/_flex-grid.scss
daiblogs-0.1.4 _sass/bourbon/functions/_flex-grid.scss
daiblogs-0.1.2 assets/_sass/bourbon/functions/_flex-grid.scss
daiblogs-0.1.1 assets/_sass/bourbon/functions/_flex-grid.scss