Skip to content

Commit

Permalink
feat(spacings): Added spacing classes
Browse files Browse the repository at this point in the history
  • Loading branch information
fragsalat committed Sep 19, 2017
1 parent 2fdbe99 commit c3a85aa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions atoms/_spacings.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$include-spacing-css: true !default;
$sizes: (
xxs: 0.25rem, // 4px
xs: 0.5rem, // 8px
s: 0.75rem, // 12px
m: 1rem, // 16px
l: 1.5rem, // 24px
xl: 2rem, // 32px
xxl: 3rem, // 48px
xxxl: 4rem // 64px
);

@if $include-spacing-css {
@each $size in map-keys($sizes) {
// Margin
.mb-#{$size} {
margin-bottom: map-get($sizes, $size);
}
.mt-#{$size} {
margin-top: map-get($sizes, $size);
}
.ml-#{$size} {
margin-left: map-get($sizes, $size);
}
.mr-#{$size} {
margin-right: map-get($sizes, $size);
}
// Padding
.pb-#{$size} {
padding-bottom: map-get($sizes, $size);
}
.pt-#{$size} {
padding-top: map-get($sizes, $size);
}
.pl-#{$size} {
padding-left: map-get($sizes, $size);
}
.pr-#{$size} {
padding-right: map-get($sizes, $size);
}
}
}
1 change: 1 addition & 0 deletions index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@import 'atoms/forms';
@import 'atoms/toggles';
@import 'atoms/typography';
@import 'atoms/spacings';

@import 'molecules/dropdown';
@import 'molecules/pagination';
Expand Down

0 comments on commit c3a85aa

Please sign in to comment.