Sha256: deae9e0fe6d39b96c4658d197b8613208e4668cde60380c29fa6cc9d83638d92

Contents?: true

Size: 1.58 KB

Versions: 18

Compression:

Stored size: 1.58 KB

Contents

@import "../tokens/screen_sizes";

@function str_replace($string, $search, $replace: '') {
  $index: str_index($string, $search);
  @if $index {
    @return str_slice($string, 1, $index - 1) + $replace + str_replace(str_slice($string, $index + str_length($search)), $search, $replace);
  }
  @return $string;
}

@mixin layout_settings($size, $side, $color, $selector) {
  $parent_name: str_replace($selector, '.', '');
  $name: ".layout";
  display: grid;

  &.full {
    min-height: 100vh;
  }
  @if $side == 'left' {
    grid-template-areas: "#{$parent_name}_sidebar #{$parent_name}_body";
    grid-template-columns: $size auto;
  } @else {
    grid-template-areas: "#{$parent_name}_body #{$parent_name}_sidebar";
    grid-template-columns: auto $size;
  }

  > #{$name}_body {
    grid-area: #{$parent_name}_body;
    min-width: 0;
  }
  > #{$name}_sidebar {
    grid-area: #{$parent_name}_sidebar;
    @if $side == 'left' {
      border-width: 0 1px 0 0;
      border-style: solid;
      @if $color == 'dark' {
        background: $bg_dark;
        border-color: $border_dark;
      } @else if $color == 'transparent' {
        border-color: transparent;
      } @else {
        background: $white;
        border-color: $border_light;
      }
    }
    @if $side == 'right' {
      border-width: 0 0 0 1px;
      border-style: solid;
      @if $color == 'dark' {
        background: $bg_dark;
        border-color: $border_dark;
      } @else if $color == 'transparent' {
        border-color: transparent;
      } @else {
        background: $white;
        border-color: $border_light;
      }
    }
  }
}

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
playbook_ui-2.9.9 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.8 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.7 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.6 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.5 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.4 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.3 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.2 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.1 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.9.0 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.9 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.8 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.7 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.6 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.5 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.4 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.3 app/pb_kits/playbook/pb_layout/_layout_mixin.scss
playbook_ui-2.8.1 app/pb_kits/playbook/pb_layout/_layout_mixin.scss