Skip to content

Commit

Permalink
fix: ext when processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Jul 5, 2019
1 parent c855304 commit e9a1037
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/css/layout/_grid.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@for $i from 1 to var(--grid-row-count) {
.container-row-$i {
height: calc(var(--grid-row-height) * $i * (1var(--grid-gutter-ext)));
height: calc(var(--grid-row-height) * $i)var(--grid-gutter-ext);

@for $k from 1 to var(--grid-row-count) {
@if ($k != var(--grid-row-count)) {
.row-offset-$k {
margin-top: calc((($i * var(--grid-row-height)) / var(--grid-row-count)) * $k * (1var(--grid-gutter-ext)));
margin-top: calc((($i * var(--grid-row-height)) / var(--grid-row-count)) * $k)var(--grid-gutter-ext);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/css/utils/helpers/_boxs.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
@each $position in top, bottom, left, right {
@for $step from var(--position-from) to var(--position-to) by var(--position-step) {
.box-$(position)-$(step) {
$(position): calc($(step) * (1var(--position-ext)));
$(position): calc($(step))var(--position-ext);
}
}
}

36 changes: 18 additions & 18 deletions src/css/utils/helpers/_offsets.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
@for $step from var(--offset-from) to var(--offset-to) by var(--offset-step) {
.offset-m-$(step) {
margin: calc($(step) * (1var(--offset-ext)));
margin: calc($(step))var(--offset-ext);
}
.offset-p-$(step) {
padding: calc($(step) * (1var(--offset-ext)));
padding: calc($(step))var(--offset-ext);
}
}

@each $position in v, h {
@for $step from var(--offset-from) to var(--offset-to) by var(--offset-step) {
.offset-m$(position)-$(step) {
@if ($position == 'v') {
margin-left: calc($(step) * (1var(--offset-ext)));
margin-right: calc($(step) * (1var(--offset-ext)));
margin-left: calc($(step))var(--offset-ext);
margin-right: calc($(step))var(--offset-ext);
}

@if ($position == 'h') {
margin-top: calc($(step) * (1var(--offset-ext)));
margin-bottom: calc($(step) * (1var(--offset-ext)));
margin-top: calc($(step))var(--offset-ext);
margin-bottom: calc($(step))var(--offset-ext);
}
}

.offset-p$(position)-$(step) {
@if ($position == 'v') {
padding-left: calc($(step) * (1var(--offset-ext)));
padding-right: calc($(step) * (1var(--offset-ext)));
padding-left: calc($(step))var(--offset-ext);
padding-right: calc($(step))var(--offset-ext);
}

@if ($position == 'h') {
padding-top: calc($(step) * (1var(--offset-ext)));
padding-bottom: calc($(step) * (1var(--offset-ext)));
padding-top: calc($(step))var(--offset-ext);
padding-bottom: calc($(step))var(--offset-ext);
}
}
}
Expand All @@ -39,36 +39,36 @@
@for $step from var(--offset-from) to var(--offset-to) by var(--offset-step) {
.offset-m$(position)-$(step) {
@if ($position == 't') {
margin-top: calc($(step) * (1var(--offset-ext)));
margin-top: calc($(step))var(--offset-ext);
}

@if ($position == 'b') {
margin-bottom: calc($(step) * (1var(--offset-ext)));
margin-bottom: calc($(step))var(--offset-ext);
}

@if ($position == 'l') {
margin-left: calc($(step) * (1var(--offset-ext)));
margin-left: calc($(step))var(--offset-ext);
}

@if ($position == 'r') {
margin-right: calc($(step) * (1var(--offset-ext)));
margin-right: calc($(step))var(--offset-ext);
}
}
.offset-p$(position)-$(step) {
@if ($position == 't') {
padding-top: calc($(step) * (1var(--offset-ext)));
padding-top: calc($(step))var(--offset-ext);
}

@if ($position == 'b') {
padding-bottom: calc($(step) * (1var(--offset-ext)));
padding-bottom: calc($(step))var(--offset-ext);
}

@if ($position == 'l') {
padding-left: calc($(step) * (1var(--offset-ext)));
padding-left: calc($(step))var(--offset-ext);
}

@if ($position == 'r') {
padding-right: calc($(step) * (1var(--offset-ext)));
padding-right: calc($(step))var(--offset-ext);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/css/utils/helpers/_space.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.space-xs { margin-bottom: calc(var(--space-gutter) / 4 * (1var(--space-gutter-ext))); }
.space-sm { margin-bottom: calc(var(--space-gutter) / 2 * (1var(--space-gutter-ext))); }
.space-md { margin-bottom: calc(var(--space-gutter) * (1var(--space-gutter-ext))); }
.space-lg { margin-bottom: calc(var(--space-gutter) * 2 * (1var(--space-gutter-ext))); }
.space-xs { margin-bottom: calc(var(--space-gutter) / 4)var(--space-gutter-ext); }
.space-sm { margin-bottom: calc(var(--space-gutter) / 2)var(--space-gutter-ext); }
.space-md { margin-bottom: var(--space-gutter)var(--space-gutter-ext); }
.space-lg { margin-bottom: calc(var(--space-gutter) * 2)var(--space-gutter-ext); }
.space-reset { margin-bottom: initial; }

0 comments on commit e9a1037

Please sign in to comment.