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

Reduce number of spacing rules #23208

Merged
merged 2 commits into from
Aug 11, 2017
Merged
Changes from 1 commit
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
36 changes: 22 additions & 14 deletions scss/utilities/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,42 @@
@each $size, $length in $spacers {

.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
.#{$abbrev}t#{$infix}-#{$size} { #{$prop}-top: $length !important; }
.#{$abbrev}r#{$infix}-#{$size} { #{$prop}-right: $length !important; }
.#{$abbrev}b#{$infix}-#{$size} { #{$prop}-bottom: $length !important; }
.#{$abbrev}l#{$infix}-#{$size} { #{$prop}-left: $length !important; }
.#{$abbrev}t#{$infix}-#{$size},
.#{$abbrev}y#{$infix}-#{$size} {
#{$prop}-top: $length !important;
}
.#{$abbrev}r#{$infix}-#{$size},
.#{$abbrev}x#{$infix}-#{$size} {
#{$prop}-right: $length !important;
#{$prop}-left: $length !important;
#{$prop}-right: $length !important;
}
.#{$abbrev}b#{$infix}-#{$size},
.#{$abbrev}y#{$infix}-#{$size} {
#{$prop}-top: $length !important;
#{$prop}-bottom: $length !important;
}
.#{$abbrev}l#{$infix}-#{$size},
.#{$abbrev}x#{$infix}-#{$size} {
#{$prop}-left: $length !important;
}
}
}

// Some special margin utils
.m#{$infix}-auto { margin: auto !important; }
.mt#{$infix}-auto { margin-top: auto !important; }
.mr#{$infix}-auto { margin-right: auto !important; }
.mb#{$infix}-auto { margin-bottom: auto !important; }
.ml#{$infix}-auto { margin-left: auto !important; }
.mt#{$infix}-auto,
.my#{$infix}-auto {
margin-top: auto !important;
}
.mr#{$infix}-auto,
.mx#{$infix}-auto {
margin-right: auto !important;
margin-left: auto !important;
margin-right: auto !important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the spaces after : that don't make sense to have like here and the other places you edited?

}
.mb#{$infix}-auto,
.my#{$infix}-auto {
margin-top: auto !important;
margin-bottom: auto !important;
}
.ml#{$infix}-auto,
.mx#{$infix}-auto {
margin-left: auto !important;
}
}
}