Skip to content

Commit

Permalink
feat: adds remove odd cols var trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
zalog committed Mar 28, 2021
1 parent 8a4ca53 commit 0a2cdc3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ $ph-color: #ced4da !default;
$ph-border: 1px solid darken($ph-bg, 10%) !default;
$ph-border-radius: 2px !default;

$ph-cols: 12 !default;
$ph-cols-remove-odd: true !default;
$ph-gutter: 30px !default;
$ph-spacer: 15px !default;

Expand Down
27 changes: 11 additions & 16 deletions src/scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,18 @@
}
}

.ph-col-2 {
flex: 0 0 percentage(2 / 12);
}
.ph-col-4 {
flex: 0 0 percentage(4 / 12);
}
.ph-col-6 {
flex: 0 0 percentage(6 / 12);
}
.ph-col-8 {
flex: 0 0 percentage(8 / 12);
}
.ph-col-10 {
flex: 0 0 percentage(10 / 12);
@mixin ph-make-col($size, $columns) {
.ph-col-#{$size} {
flex: 0 0 percentage($size / $columns);
}
}
.ph-col-12 {
flex: 0 0 percentage(12 / 12);

@for $i from 1 through $ph-cols {
@if $ph-cols-remove-odd and $i % 2 == 0 {
@include ph-make-col($i, $ph-cols);
} @else if not $ph-cols-remove-odd {
@include ph-make-col($i, $ph-cols);
}
}

// TODO make this a `.ph-wrap` class for no padding, no background, no animation,
Expand Down
2 changes: 2 additions & 0 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ $ph-color: #ced4da !default;
$ph-border: 1px solid darken($ph-bg, 10%) !default;
$ph-border-radius: 2px !default;

$ph-cols: 12 !default;
$ph-cols-remove-odd: true !default;
$ph-gutter: 30px !default;
$ph-spacer: 15px !default;

Expand Down

0 comments on commit 0a2cdc3

Please sign in to comment.