Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed calls to span mixins when grid layout supported #242

Open
wants to merge 1 commit into
base: 1.x.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions stylesheets/singularitygs/_css-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,40 +102,42 @@
@mixin css-grid-span($Span, $Location: false) {
$grid: find-grid();

@if type-of($grid) == 'number' or length($grid) == 1 {
// If we have a symmetric grid _and_ no location, Float Span makes most sense
@if $Location == false {
@include float-span($Span, $Location);
}
// If we have an symmetric grid _and_ a location, Isolation Span makes most sense
@else {
@include isolation-span($Span, $Location);
}
}
@else if type-of($grid) == 'list' or length($grid) > 1 {
$calc: false;
@each $column in $grid {
@if not unitless($column) {
$calc: true;
@supports not(display: grid) {
@if type-of($grid) == 'number' or length($grid) == 1 {
// If we have a symmetric grid _and_ no location, Float Span makes most sense
@if $Location == false {
@include float-span($Span, $Location);
}
// If we have an symmetric grid _and_ a location, Isolation Span makes most sense
@else {
@include isolation-span($Span, $Location);
}
}
@else if type-of($grid) == 'list' or length($grid) > 1 {
$calc: false;
@each $column in $grid {
@if not unitless($column) {
$calc: true;
}
}

// If we have an asymmetric grid _and_ it includes united numbers, needs to be Calc
@if ($calc) {
@include calc-span($Span, $Location);
}
// If we have an asymmetric grid _and_ it doesn't include united numbers, Islotion's better
@else {
@include isolation-span($Span, $Location);
// If we have an asymmetric grid _and_ it includes united numbers, needs to be Calc
@if ($calc) {
@include calc-span($Span, $Location);
}
// If we have an asymmetric grid _and_ it doesn't include united numbers, Islotion's better
@else {
@include isolation-span($Span, $Location);
}
}
}

@supports (display: grid) {
@if $Location {
grid-columns: $Location / span $Span;
grid-column: $Location / span $Span;
}
@else {
grid-columns: span $Span;
grid-column: span $Span;
}
}
}