Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #57 from yannickfh/divisions
Browse files Browse the repository at this point in the history
WIP | remove slash division
  • Loading branch information
martinbroos authored Sep 24, 2021
2 parents 1b68634 + d477a5a commit 4b43763
Show file tree
Hide file tree
Showing 7 changed files with 666 additions and 861 deletions.
4 changes: 3 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"mixin",
"warn",
"content",
"at-root"
"at-root",
"use",
"forward"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion layout/_container.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'sass:math';
@import '../settings/breakpoints';
@import '../settings/layout';

Expand All @@ -19,7 +20,7 @@
// Except for if the container is 0px and if the container is larger than the max-width set in the settings.
// Or when the container is fluid
@each $breakpoint-name, $container-width in $breakpoints {
@if ($container-width != 0px and ($container-width/1px) <= ($layout-container-max-width/1px)) { /* stylelint-disable-line */
@if ($container-width != 0px and (math.div($container-width,1px)) <= (math.div($layout-container-max-width, 1px))) { /* stylelint-disable-line */
@include mq($from: $breakpoint-name) {
.container:not(.container--fluid) {
max-width: $container-width;
Expand Down
3 changes: 2 additions & 1 deletion layout/_layout-offset.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@use 'sass:math';
@import '../settings/breakpoints';
@import '../settings/layout';

@mixin _make-offset($totalColumnCount) {
@for $i from 1 through $totalColumnCount {
&-#{$i} {
margin-left: percentage($i / $totalColumnCount);
margin-left: percentage(math.div($i, $totalColumnCount));
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions layout/_layout-sizing.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@use 'sass:math';
@import '../settings/breakpoints';
@import '../settings/layout';

@mixin _make-column($totalColumnCount) {
@for $i from 1 through $totalColumnCount {
&-#{$i} {
width: percentage($i / $totalColumnCount);
max-width: percentage($i / $totalColumnCount); // Needed for IE10+ and Firefox
width: percentage(math.div($i, $totalColumnCount));
max-width: percentage(math.div($i, $totalColumnCount)); // Needed for IE10+ and Firefox
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions layout/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'sass:math';
@import '../settings/breakpoints';
@import '../settings/layout';

Expand All @@ -8,8 +9,8 @@
// compensate gutters for each breakpoint
@each $breakpoint-name, $gutter-width in $layout-gutter-widths {
@include mq($from: $breakpoint-name) {
margin-left: -$gutter-width / 2;
margin-right: -$gutter-width / 2;
margin-left: math.div($gutter-width, 2) * -1;
margin-right: math.div($gutter-width, 2) * -1;
}
}
}
Expand All @@ -35,8 +36,8 @@
// set gutter width for each breakpoint
@each $breakpoint-name, $gutter-width in $layout-gutter-widths {
@include mq($from: $breakpoint-name) {
padding-left: $gutter-width / 2;
padding-right: $gutter-width / 2;
padding-left: math.div($gutter-width, 2);
padding-right: math.div($gutter-width, 2);
}
}

Expand Down
Loading

0 comments on commit 4b43763

Please sign in to comment.