diff options
Diffstat (limited to 'src/layouts/_container.scss')
| -rw-r--r-- | src/layouts/_container.scss | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/layouts/_container.scss b/src/layouts/_container.scss new file mode 100644 index 0000000..efe5203 --- /dev/null +++ b/src/layouts/_container.scss | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | @use 'iro-sass/src/index' as iro; | ||
| 2 | @use 'include-media/dist/include-media' as media; | ||
| 3 | |||
| 4 | @include iro.props-namespace('container') { | ||
| 5 | @include iro.props-store(( | ||
| 6 | --dims: ( | ||
| 7 | --content-width: iro.fn-px-to-rem(700px), | ||
| 8 | --sm-content-width: iro.fn-px-to-rem(360px), | ||
| 9 | --padding-x: 3rem, | ||
| 10 | --padding-y: 3rem, | ||
| 11 | --in-page-spacing-y: iro.props-get(--dims --spacing --y --xl, $global: true), | ||
| 12 | ) | ||
| 13 | )); | ||
| 14 | |||
| 15 | @include iro.bem-layout(iro.props-namespace()) { | ||
| 16 | overflow: hidden; | ||
| 17 | |||
| 18 | @include iro.bem-elem('inner') { | ||
| 19 | margin-top: calc(-1 * iro.props-get(--dims --spacing --y --xl, $global: true)); | ||
| 20 | margin-bottom: calc(-1 * iro.props-get(--dims --spacing --y --xl, $global: true)); | ||
| 21 | |||
| 22 | &::before, | ||
| 23 | &::after { | ||
| 24 | content: ''; | ||
| 25 | display: block; | ||
| 26 | width: 0; | ||
| 27 | height: 0; | ||
| 28 | } | ||
| 29 | |||
| 30 | &::before { | ||
| 31 | margin-bottom: iro.props-get(--dims --spacing --y --xl, $global: true); | ||
| 32 | } | ||
| 33 | |||
| 34 | &::after { | ||
| 35 | margin-top: iro.props-get(--dims --spacing --y --xl, $global: true); | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | @include iro.bem-modifier('pad-x') { | ||
| 40 | padding-right: iro.props-get(--dims --padding-x); | ||
| 41 | padding-left: iro.props-get(--dims --padding-x); | ||
| 42 | } | ||
| 43 | |||
| 44 | @include iro.bem-modifier('pad-y') { | ||
| 45 | padding-top: iro.props-get(--dims --padding-y); | ||
| 46 | padding-bottom: iro.props-get(--dims --padding-y); | ||
| 47 | } | ||
| 48 | |||
| 49 | @include iro.bem-modifier('narrow') { | ||
| 50 | max-width: iro.props-get(--dims --content-width); | ||
| 51 | margin-right: auto; | ||
| 52 | margin-left: auto; | ||
| 53 | |||
| 54 | @each $breakpoint in map-keys(media.$breakpoints) { | ||
| 55 | @include media.media('<=#{$breakpoint}') { | ||
| 56 | @include iro.bem-suffix('#{$breakpoint}-down') { | ||
| 57 | max-width: iro.props-get(--dims --content-width); | ||
| 58 | margin-right: auto; | ||
| 59 | margin-left: auto; | ||
| 60 | } | ||
| 61 | } | ||
| 62 | } | ||
| 63 | } | ||
| 64 | |||
| 65 | @include iro.bem-modifier('sm-narrow') { | ||
| 66 | max-width: iro.props-get(--dims --sm-content-width); | ||
| 67 | margin-right: auto; | ||
| 68 | margin-left: auto; | ||
| 69 | |||
| 70 | @each $breakpoint in map-keys(media.$breakpoints) { | ||
| 71 | @include media.media('<=#{$breakpoint}') { | ||
| 72 | @include iro.bem-suffix('#{$breakpoint}-down') { | ||
| 73 | max-width: iro.props-get(--dims --sm-content-width); | ||
| 74 | margin-right: auto; | ||
| 75 | margin-left: auto; | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
| 79 | } | ||
| 80 | |||
| 81 | @include iro.bem-modifier('themed') { | ||
| 82 | background-color: iro.props-get(--colors --bg, $global: true); | ||
| 83 | color: iro.props-get(--colors --fg, $global: true); | ||
| 84 | } | ||
| 85 | |||
| 86 | @include iro.bem-modifier('in-page') { | ||
| 87 | margin-top: iro.props-get(--dims --in-page-spacing-y); | ||
| 88 | margin-bottom: iro.props-get(--dims --in-page-spacing-y); | ||
| 89 | } | ||
| 90 | } | ||
| 91 | } | ||
