Skip to content
Snippets Groups Projects
grid-item.scss 3.12 KiB
Newer Older
  • Learn to ignore specific revisions
  • Tuukka Turu's avatar
    Tuukka Turu committed
    :host {
      display: block;
    }
    
    .hy-grid-align__left {
      text-align: left;
    }
    
    .hy-grid-align__right {
      text-align: right;
    }
    
    .hy-grid-align__center {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
    }
    
    .hy-grid-justify {
      text-align: justify;
    }
    
    .hy-grid-hidden-sm {
      display: none;
    }
    
    // grid
    
    $width: 98%;
    $gutter: 2%;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
    
    $narrow: 30em; // 480px
    $medium: 48em; // 768px
    $wide: 60em; // 960px
    
    .hy-grid__col-1,
    .hy-grid__col-2,
    .hy-grid__col-3,
    .hy-grid__col-4,
    .hy-grid__col-5,
    .hy-grid__col-6,
    .hy-grid__col-7,
    .hy-grid__col-8,
    .hy-grid__col-9,
    .hy-grid__col-10,
    .hy-grid__col-11,
    .hy-grid__col-12 {
      width: $width;
    }
    
    .hy-grid__col-1-sm { width:($width / 12) - ($gutter * 11 / 12); }
    .hy-grid__col-2-sm { width: ($width / 6) - ($gutter * 10 / 12); }
    .hy-grid__col-3-sm { width: ($width / 4) - ($gutter * 9 / 12); }
    .hy-grid__col-4-sm { width: ($width / 3) - ($gutter * 8 / 12); }
    .hy-grid__col-5-sm { width: ($width / (12 / 5)) - ($gutter * 7 / 12); }
    .hy-grid__col-6-sm { width: ($width / 2) - ($gutter * 6 / 12); }
    .hy-grid__col-7-sm { width: ($width / (12 / 7)) - ($gutter * 5 / 12); }
    .hy-grid__col-8-sm { width: ($width / (12 / 8)) - ($gutter * 4 / 12); }
    .hy-grid__col-9-sm { width: ($width / (12 / 9)) - ($gutter * 3 / 12); }
    .hy-grid__col-10-sm { width: ($width / (12 / 10)) - ($gutter * 2 / 12); }
    .hy-grid__col-11-sm { width: ($width / (12 / 11)) - ($gutter * 1 / 12); }
    .hy-grid__col-12-sm { width: $width; }
    
    @media only screen and (min-width: $medium) {
      .hy-grid__col-1 { width:($width / 12) - ($gutter * 11 / 12); }
      .hy-grid__col-2 { width: ($width / 6) - ($gutter * 10 / 12); }
      .hy-grid__col-3 { width: ($width / 4) - ($gutter * 9 / 12); }
      .hy-grid__col-4 { width: ($width / 3) - ($gutter * 8 / 12); }
      .hy-grid__col-5 { width: ($width / (12 / 5)) - ($gutter * 7 / 12); }
      .hy-grid__col-6 { width: ($width / 2) - ($gutter * 6 / 12); }
      .hy-grid__col-7 { width: ($width / (12 / 7)) - ($gutter * 5 / 12); }
      .hy-grid__col-8 { width: ($width / (12 / 8)) - ($gutter * 4 / 12); }
      .hy-grid__col-9 { width: ($width / (12 / 9)) - ($gutter * 3 / 12); }
      .hy-grid__col-10 { width: ($width / (12 / 10)) - ($gutter * 2 / 12); }
      .hy-grid__col-11 { width: ($width / (12 / 11)) - ($gutter * 1 / 12); }
      .hy-grid__col-12 { width: $width; }
    
      .hidden-sm {
        display: block;
      }
    }
    
    @media only screen and (min-width: $wide) {
      .hy-grid__col-1-lg { width:($width / 12) - ($gutter * 11 / 12); }
      .hy-grid__col-2-lg { width: ($width / 6) - ($gutter * 10 / 12); }
      .hy-grid__col-3-lg { width: ($width / 4) - ($gutter * 9 / 12); }
      .hy-grid__col-4-lg { width: ($width / 3) - ($gutter * 8 / 12); }
      .hy-grid__col-5-lg { width: ($width / (12 / 5)) - ($gutter * 7 / 12); }
      .hy-grid__col-6-lg { width: ($width / 2) - ($gutter * 6 / 12); }
      .hy-grid__col-7-lg { width: ($width / (12 / 7)) - ($gutter * 5 / 12); }
      .hy-grid__col-8-lg { width: ($width / (12 / 8)) - ($gutter * 4 / 12); }
      .hy-grid__col-9-lg { width: ($width / (12 / 9)) - ($gutter * 3 / 12); }
      .hy-grid__col-10-lg { width: ($width / (12 / 10)) - ($gutter * 2 / 12); }
      .hy-grid__col-11-lg { width: ($width / (12 / 11)) - ($gutter * 1 / 12); }
      .hy-grid__col-12-lg { width: $width; }
    }