adding spacing

release/0.2
Björn 3 years ago
parent dcdbde0946
commit 332c8c7cd0

2888
dist/plain-ui.css vendored

File diff suppressed because it is too large Load Diff

@ -1,3 +1,11 @@
/**
*
*
*
*
*
*/
@each $name, $color in $plain-ui__colors { @each $name, $color in $plain-ui__colors {
.text-color-#{$name} { .text-color-#{$name} {
color: var(#{$color}); color: var(#{$color});

@ -5,14 +5,6 @@
* *
*/ */
@mixin plain-ui__helpers__core()
{
/**
* borders
*
*
*/
.border { .border {
border: $plain-ui__border !important; border: $plain-ui__border !important;
} }
@ -121,14 +113,6 @@
} }
} }
/**
* colors
*
*
*/
/** /**
* floating * floating
* *
@ -211,4 +195,3 @@
.object-fit-cover { .object-fit-cover {
object-fit: cover; object-fit: cover;
} }
}

@ -5,8 +5,8 @@ $plain-ui__spacing-direction: (
'right' 'right'
) !default; ) !default;
$plain-ui__helpers__spacing-gap: 0.25 !default; $plain-ui__spacing-gap: 0.25 !default;
$plain-ui__helpers__spacing-steps: 10 !default; $plain-ui__spacing-steps: 10 !default;
/** /**
* *
@ -19,24 +19,64 @@ $plain-ui__helpers__spacing-steps: 10 !default;
} }
} }
@each $direction in $plain-ui__spacing-direction { @each $direction in $plain-ui__spacing-direction
{
@include spacing('m', 'margin', $direction, 0, 0); @include spacing('m', 'margin', $direction, 0, 0);
@include spacing('m', 'margin', $direction, 1, 1px); @include spacing('m', 'margin', $direction, 1, 1px);
@for $i from 2 through $plain-ui__helpers__spacing-steps { @for $i from 2 through $plain-ui__spacing-steps {
$value: $plain-ui__helpers__spacing-gap * factor($i - 1) * 1rem; $value: $plain-ui__spacing-gap * factor($i - 1) * 1rem;
@include spacing('m', 'margin', $direction, $i, $value); @include spacing('m', 'margin', $direction, $i, $value);
@include plain-ui__media-xs() {
@include spacing('m', 'margin', $direction, 'xs-' + $i, $value);
} }
@include plain-ui__media-sm() {
@include spacing('m', 'margin', $direction, 'sm-' + $i, $value);
}
@include plain-ui__media-md() {
@include spacing('m', 'margin', $direction, 'md-' + $i, $value);
} }
@each $direction in $plain-ui__spacing-direction { @include plain-ui__media-lg() {
@include spacing('m', 'margin', $direction, 'lg-' + $i, $value);
}
@include plain-ui__media-xlg() {
@include spacing('m', 'margin', $direction, 'xlg-' + $i, $value);
}
}
}
@each $direction in $plain-ui__spacing-direction
{
@include spacing('p', 'padding', $direction, 0, 0); @include spacing('p', 'padding', $direction, 0, 0);
@include spacing('p', 'padding', $direction, 1, 1px); @include spacing('p', 'padding', $direction, 1, 1px);
@for $i from 0 through $plain-ui__helpers__spacing-steps { @for $i from 0 through $plain-ui__spacing-steps {
$value: $plain-ui__helpers__spacing-gap * factor($i - 1) * 1rem; $value: $plain-ui__spacing-gap * factor($i - 1) * 1rem;
@include spacing('p', 'padding', $direction, $i, $value); @include spacing('p', 'padding', $direction, $i, $value);
@include plain-ui__media-xs() {
@include spacing('p', 'padding', $direction, 'xs-' + $i, $value);
}
@include plain-ui__media-sm() {
@include spacing('p', 'padding', $direction, 'sm-' + $i, $value);
}
@include plain-ui__media-md() {
@include spacing('p', 'padding', $direction, 'md-' + $i, $value);
}
@include plain-ui__media-lg() {
@include spacing('p', 'padding', $direction, 'lg-' + $i, $value);
}
@include plain-ui__media-xlg() {
@include spacing('p', 'padding', $direction, 'xlg-' + $i, $value);
}
} }
} }

@ -23,17 +23,18 @@ $plain-ui__masonry_sizes: (
$plain-ui__masonry_height: 200px !default; $plain-ui__masonry_height: 200px !default;
$plain-ui__masonry_height--sm: 300px !default; $plain-ui__masonry_height--sm: 300px !default;
$plain-ui__masonry_gap: 15px !default;
$plain-ui__masonry_gap-offset: 10px !default;
.masonry { .masonry {
display: flex; display: flex;
width: 100%; width: 100%;
flex-flow: row wrap; flex-flow: row wrap;
gap: $plain-ui__masonry_gap;
&__item { &__item {
width: 100%; width: 100%;
height: $plain-ui__masonry_height; height: $plain-ui__masonry_height;
padding-left: 1px;
padding-bottom: 1px;
@include plain-ui__media-sm() { @include plain-ui__media-sm() {
height: $plain-ui__masonry_height--sm; height: $plain-ui__masonry_height--sm;
@ -41,7 +42,7 @@ $plain-ui__masonry_height--sm: 300px !default;
// add width from data // add width from data
@each $index, $size in $plain-ui__masonry_sizes { @each $index, $size in $plain-ui__masonry_sizes {
&:nth-child(4n+#{$index}) { &:nth-child(4n+#{$index}) {
width: #{$size}; width: calc(#{$size} - #{$plain-ui__masonry_gap-offset});
} }
} }
} }

@ -31,8 +31,6 @@
'helpers/spacing', 'helpers/spacing',
'helpers/colors'; 'helpers/colors';
@include plain-ui__helpers__core();
@include plain-ui__component__media(); @include plain-ui__component__media();
@include plain-ui__component__table(); @include plain-ui__component__table();
@include plain-ui__component__slider(); @include plain-ui__component__slider();

Loading…
Cancel
Save