diff --git a/examples/package.json b/examples/package.json index 96c88ed..c40e104 100644 --- a/examples/package.json +++ b/examples/package.json @@ -39,16 +39,16 @@ "threads": "git+ssh://git@github.com/beefchimi/threads.git#v1.0.0-beta8" }, "devDependencies": { - "autoprefixer": "^8.1.0", + "autoprefixer": "^8.2.0", "babel-core": "^6.26.0", "babel-loader": "^7.1.4", "babel-preset-shopify": "^16.3.0", "browser-sync": "^2.23.6", "cssnano": "^3.10.0", "cssnano-preset-advanced": "^4.0.0-rc.2", - "eslint": "^4.19.0", + "eslint": "^4.19.1", "eslint-plugin-prettier": "^2.6.0", - "eslint-plugin-shopify": "^19.0.0", + "eslint-plugin-shopify": "^20.0.0", "gulp": "gulpjs/gulp#v4.0.0-alpha.3", "gulp-cli": "^2.0.1", "gulp-data": "^1.3.1", @@ -63,7 +63,7 @@ "prettier-stylelint": "^0.4.2", "stylelint": "^9.1.3", "stylelint-config-shopify": "^5.0.0", - "webpack": "^4.1.1", + "webpack": "^4.2.0", "webpack-bundle-analyzer": "^2.11.1" } } diff --git a/examples/src/components/Block/Block.scss b/examples/src/components/Block/Block.scss index e56b0e5..08cfa5e 100644 --- a/examples/src/components/Block/Block.scss +++ b/examples/src/components/Block/Block.scss @@ -22,13 +22,14 @@ .BlockContent { @include flex-center; position: relative; - min-height: columns(); + min-height: rows(2, true); height: 100%; color: white; background-color: get-color(coal, dark); border: get-border(thin) solid get-color(coal, dark); @media screen and (min-width: get-breakpoint(tablet)) { + min-height: rows(2); border-width: get-border(); } diff --git a/examples/src/components/GridOverlay/GridOverlay.scss b/examples/src/components/GridOverlay/GridOverlay.scss new file mode 100644 index 0000000..4f872d9 --- /dev/null +++ b/examples/src/components/GridOverlay/GridOverlay.scss @@ -0,0 +1,77 @@ +//// +/// Components +/// Grid Overlay +//// + +@import 'utils/shared/functions'; +@import 'utils/shared/layout'; +@import 'components/Main/props'; + +$grid-overlay-baseline: 0.1rem; + +.GridOverlay { + --columns: 4; + --repeating-width: calc(100% / var(--columns)); + --gutter-size: get-layout-length(gutter, mobile); + --column-width: calc((100% / var(--columns)) - var(--gutter-size)); + --baseline-stop: calc(var(--gutter-size) - #{$grid-overlay-baseline}); + --row-height: calc(#{rows(1, true)} + var(--gutter-size)); + --bg-width: calc(100% + var(--gutter-size)); + --bg-baseline: repeating-linear-gradient( + to bottom, + get-color(purple), + get-color(purple) $grid-overlay-baseline, + transparent $grid-overlay-baseline, + transparent var(--baseline-stop), + get-color(purple) var(--baseline-stop), + get-color(purple) var(--gutter-size), + transparent var(--gutter-size), + transparent var(--row-height) + ); + --bg-columns: repeating-linear-gradient( + to right, + get-color(purple, light), + get-color(purple, light) var(--column-width), + transparent var(--column-width), + transparent var(--repeating-width) + ); + + @media screen and (min-width: get-breakpoint(tablet)) { + --columns: 6; + --gutter-size: get-layout-length(gutter); + --row-height: calc(#{rows()} + var(--gutter-size)); + } + + @media screen and (min-width: get-breakpoint(desktop)) { + --columns: 8; + } + + // positioned parent will be `body` + @include centered-width(get-layout-length(main-interior)); + z-index: 1; + position: fixed; + top: 0; + bottom: 0; + left: get-spacing(tight); + right: get-spacing(tight); + min-height: 100vh; + background-image: var(--bg-baseline), var(--bg-columns); + background-size: var(--bg-width) 100%; + background-position: 0 calc(-1 * var(--gutter-size)); + mix-blend-mode: multiply; + opacity: 0.8; + pointer-events: none; + + @media screen and (min-width: get-breakpoint()) { + left: $main-padding-left-tablet; + } + + @media screen and (min-width: get-breakpoint(desktop)) { + right: get-spacing(fattest); + left: $main-padding-left-desktop; + } +} + +.GridOverlay--isHidden { + display: none; +} diff --git a/examples/src/components/Main/Main.scss b/examples/src/components/Main/Main.scss index 3ceea32..5a2c123 100644 --- a/examples/src/components/Main/Main.scss +++ b/examples/src/components/Main/Main.scss @@ -3,7 +3,9 @@ /// Main //// +@import 'utils/shared/layout'; @import 'components/MobileNav/props'; +@import 'props'; .Main { padding: $mobile-nav-padding-top get-spacing(tight) get-spacing(looser); @@ -13,7 +15,7 @@ @media screen and (min-width: get-breakpoint()) { padding-top: get-spacing(looser); - padding-left: get-layout-length(sidebar) + get-spacing(tight); + padding-left: $main-padding-left-tablet; } @media screen and (min-width: get-breakpoint(desktop)) { @@ -21,7 +23,7 @@ get-spacing(fat) get-spacing(fattest) get-spacing(fat) - (get-layout-length(sidebar) + get-spacing(fattest)); + $main-padding-left-desktop; } } diff --git a/examples/src/components/Main/props.scss b/examples/src/components/Main/props.scss new file mode 100644 index 0000000..22578f2 --- /dev/null +++ b/examples/src/components/Main/props.scss @@ -0,0 +1,7 @@ +//// +/// Components +/// Main props +//// + +$main-padding-left-tablet: get-layout-length(sidebar) + get-spacing(tight); +$main-padding-left-desktop: get-layout-length(sidebar) + get-spacing(fattest); diff --git a/examples/src/components/PageHeader/PageHeader.scss b/examples/src/components/PageHeader/PageHeader.scss index 7aded7a..0caa391 100644 --- a/examples/src/components/PageHeader/PageHeader.scss +++ b/examples/src/components/PageHeader/PageHeader.scss @@ -3,6 +3,8 @@ /// PageHeader //// +@import 'utils/shared/layout'; + .PageHeader { @include centered-width(get-layout-length(page-header)); margin-bottom: get-spacing(loose); diff --git a/examples/src/components/StackedList/StackedList.scss b/examples/src/components/StackedList/StackedList.scss index ce03d55..f5ab67e 100644 --- a/examples/src/components/StackedList/StackedList.scss +++ b/examples/src/components/StackedList/StackedList.scss @@ -14,12 +14,16 @@ @include stripes-bg; position: relative; color: get-color(coal, dark); - box-shadow: inset 0 0 0 get-border() currentColor; + box-shadow: inset 0 0 0 get-border(thin) currentColor; // `draggable-container-parent--capacity` changes the `color` on `StackedListWrapper`... // This is supposed to "trickle" down and cause all children to transition color as well... // Problem is, sometimes these transitions seem to collide and we don't get syncronised timing... // Sadly, there is no way to target `box-shadow`'s color without the use of currentColor. // transition: color get-duration(fast) get-easing(); + + @media screen and (min-width: get-breakpoint(tablet)) { + box-shadow: inset 0 0 0 get-border() currentColor; + } } .StackedListHeader, @@ -34,13 +38,14 @@ } .StackedListHeader { - padding: - stacked-list-header(padding-top) - (get-spacing(tighter) + 0.8rem) - stacked-list-header(padding-bottom); + padding: stacked-list-header(padding); background-color: currentColor; transition: color get-duration(fast) get-easing(); + @media screen and (min-width: get-breakpoint(tablet)) { + padding: stacked-list-header(padding, tablet); + } + p { margin-top: 0.2em; font-size: get-type-scale(paragraph); @@ -58,7 +63,11 @@ .StackedList { position: relative; - margin-top: -(get-border()); + margin-top: -(get-border(thin)); + + @media screen and (min-width: get-breakpoint(tablet)) { + margin-top: -(get-border()); + } &::before { @include visible(false); @@ -90,7 +99,11 @@ cursor: get-cursor(); &:nth-child(1n+2) { - margin-top: -(get-border()); + margin-top: -(get-border(thin)); + + @media screen and (min-width: get-breakpoint(tablet)) { + margin-top: -(get-border()); + } } .draggable--original:first-child + & { @@ -105,12 +118,16 @@ padding: get-spacing(tighter); color: currentColor; background-color: get-color(ash, light); - border: get-border() solid currentColor; + border: get-border(thin) solid currentColor; transition: color get-duration(fast) get-easing(), background-color get-duration(fast) get-easing(), transform get-duration() get-easing(bungie); + @media screen and (min-width: get-breakpoint(tablet)) { + border-width: get-border(); + } + .Heading { flex: 1 1 auto; } @@ -126,16 +143,23 @@ &::before { content: ''; position: absolute; - top: -(get-border()); - right: -(get-border()); - left: -(get-border()); + top: -(get-border(thin)); + right: -(get-border(thin)); + left: -(get-border(thin)); display: block; - height: get-border(); + height: get-border(thin); background-color: currentColor; opacity: 0; transition: color get-duration(fast) get-easing(), opacity get-duration(fast) get-easing(); + + @media screen and (min-width: get-breakpoint(tablet)) { + top: -(get-border()); + right: -(get-border()); + left: -(get-border()); + height: get-border(); + } } } diff --git a/examples/src/components/StackedList/props.scss b/examples/src/components/StackedList/props.scss index a97079e..45bc2e7 100644 --- a/examples/src/components/StackedList/props.scss +++ b/examples/src/components/StackedList/props.scss @@ -4,11 +4,9 @@ //// $stacked-list-header: ( - padding-top: ( - base: get-spacing(tighter) + (get-border() / 2), - ), - padding-bottom: ( - base: get-spacing(tighter) + get-border(), + padding: ( + base: get-spacing(tighter) + get-border(thin), + tablet: get-spacing(tighter) + get-border(), ), ); @@ -16,6 +14,8 @@ $stacked-list-header: ( @return threads-value-get($stacked-list-header, $group, $variant); } +// using static values instead of `rows()` +// will consider switching later when I have more time $stacked-list-item: ( base: ( base: 7.2rem, @@ -37,8 +37,8 @@ $stacked-list-item: ( /// /// Mixins -@mixin stacked-list-scroll-height($size: stacked-list-item(), $rows: 6) { - height: ($size * $rows) - (get-border() * ($rows - 1)); +@mixin stacked-list-scroll-height($size: stacked-list-item(), $rows: 6, $border-width: thin) { + height: ($size * $rows) - (get-border($border-width) * ($rows - 1)); } @mixin scroll-indicator($vertical: true) { @@ -54,11 +54,19 @@ $stacked-list-item: ( right: 0; bottom: 0; left: 0; - height: get-border(); + height: get-border(thin); } @else { top: 0; right: 0; bottom: 0; - width: get-border(); + width: get-border(thin); + } + + @media screen and (min-width: get-breakpoint(tablet)) { + @if $vertical { + height: get-border(); + } @else { + width: get-border(); + } } } diff --git a/examples/src/components/StackedList/variants.scss b/examples/src/components/StackedList/variants.scss index aff0791..d9a5047 100644 --- a/examples/src/components/StackedList/variants.scss +++ b/examples/src/components/StackedList/variants.scss @@ -55,7 +55,7 @@ @media screen and (min-width: get-breakpoint(desktop)) { @include stacked-list-scroll-height( - stacked-list-item(medium, desktop), 3 + stacked-list-item(medium, desktop), 3, base ); } } @@ -67,7 +67,7 @@ @media screen and (min-width: get-breakpoint(desktop)) { @include stacked-list-scroll-height( - stacked-list-item(large, desktop), 3 + stacked-list-item(large, desktop), 3, base ); } } @@ -79,7 +79,7 @@ @media screen and (min-width: get-breakpoint(desktop)) { @include stacked-list-scroll-height( - stacked-list-item(base, desktop), 7 + stacked-list-item(base, desktop), 7, base ); } @@ -92,7 +92,7 @@ @media screen and (min-width: get-breakpoint(desktop)) { @include stacked-list-scroll-height( - stacked-list-item(medium, desktop), 3 + stacked-list-item(medium, desktop), 3, base ); } } @@ -104,7 +104,7 @@ @media screen and (min-width: get-breakpoint(desktop)) { @include stacked-list-scroll-height( - stacked-list-item(large, desktop), 3 + stacked-list-item(large, desktop), 3, base ); } } @@ -148,8 +148,12 @@ display: flex; flex: 1 1 auto; margin-top: 0; - margin-left: -(get-border()); + margin-left: -(get-border(thin)); overflow-x: scroll; + + @media screen and (min-width: get-breakpoint(tablet)) { + margin-left: -(get-border()); + } } .StackedListItem { @@ -158,7 +162,11 @@ &:nth-child(1n+2) { margin-top: 0; - margin-left: -(get-border()); + margin-left: -(get-border(thin)); + + @media screen and (min-width: get-breakpoint(tablet)) { + margin-left: -(get-border()); + } } @media screen and (min-width: get-breakpoint(tablet)) { @@ -177,12 +185,19 @@ text-align: center; &::before { - top: -(get-border()); + top: -(get-border(thin)); right: auto; - bottom: -(get-border()); - left: -(get-border()); - width: get-border(); + bottom: -(get-border(thin)); + left: -(get-border(thin)); + width: get-border(thin); height: auto; + + @media screen and (min-width: get-breakpoint(tablet)) { + top: -(get-border()); + bottom: -(get-border()); + left: -(get-border()); + width: get-border(); + } } } diff --git a/examples/src/content/Droppable/UniqueDropzone/UniqueDropzone.scss b/examples/src/content/Droppable/UniqueDropzone/UniqueDropzone.scss index 505f03c..e523833 100644 --- a/examples/src/content/Droppable/UniqueDropzone/UniqueDropzone.scss +++ b/examples/src/content/Droppable/UniqueDropzone/UniqueDropzone.scss @@ -98,13 +98,29 @@ $grid-columns: 4; } } - .BlockContent { - @media screen and (min-width: get-breakpoint(tablet)) { - min-height: columns() * 1.5; - } + .BlockLayout--typeFlex { + .BlockContent { + @media screen and (min-width: get-breakpoint(tablet)) { + min-height: rows(3); + } - @media screen and (min-width: get-breakpoint(desktop)) { - min-height: columns(2); + @media screen and (min-width: get-breakpoint(desktop)) { + min-height: rows(4); + } + } + } + + // not quite lining up with the rows correctly... + // will likely need to tweak `grid` values + .BlockLayout--typeGrid { + .BlockContent { + @media screen and (min-width: get-breakpoint(tablet)) { + min-height: rows(3, false, true); + } + + @media screen and (min-width: get-breakpoint(desktop)) { + min-height: rows(4, false, true); + } } } } diff --git a/examples/src/content/Plugins/Collidable/props.scss b/examples/src/content/Plugins/Collidable/props.scss index 031d4ba..cb74ead 100644 --- a/examples/src/content/Plugins/Collidable/props.scss +++ b/examples/src/content/Plugins/Collidable/props.scss @@ -9,9 +9,9 @@ $collidable-container-height: 60rem; $collidable-container-height-tablet: 64rem; $collidable-container-height-desktop: 80rem; -$collidable-block-height: columns() * 1.5; -$collidable-block-height-tablet: columns(2); -$collidable-block-height-desktop: columns(3); +$collidable-block-height: rows(3, true); +$collidable-block-height-tablet: rows(4); +$collidable-block-height-desktop: rows(5); $collidable: ( container-height: ( diff --git a/examples/src/content/Plugins/Snappable/Snappable.scss b/examples/src/content/Plugins/Snappable/Snappable.scss index 4c3ccca..bac11bc 100644 --- a/examples/src/content/Plugins/Snappable/Snappable.scss +++ b/examples/src/content/Plugins/Snappable/Snappable.scss @@ -10,12 +10,12 @@ grid-template-columns: repeat(2, 1fr); @media screen and (min-width: get-breakpoint(tablet)) { - grid-template-rows: repeat(4, columns() * 1.5); + grid-template-rows: repeat(4, rows(3)); grid-template-columns: repeat(4, 1fr); } @media screen and (min-width: get-breakpoint(desktop)) { - grid-template-rows: repeat(4, columns(2)); + grid-template-rows: repeat(4, rows(4)); } } } diff --git a/examples/src/content/Plugins/SwapAnimation/SwapAnimation.scss b/examples/src/content/Plugins/SwapAnimation/SwapAnimation.scss index fd40f3a..0d261cd 100644 --- a/examples/src/content/Plugins/SwapAnimation/SwapAnimation.scss +++ b/examples/src/content/Plugins/SwapAnimation/SwapAnimation.scss @@ -24,18 +24,16 @@ $swap-anim-block-name: unquote('Block'); } .BlockContent { - height: columns(); - @media screen and (min-width: get-breakpoint(tablet)) { - height: columns() * 1.5; + height: rows(3); } @media screen and (min-width: get-breakpoint(desktop)) { - height: columns(2); + height: rows(4); } @media screen and (min-width: get-breakpoint('1080p', wide)) { - height: columns() * 2.5; + height: rows(5); } } } diff --git a/examples/src/content/Sortable/MultipleContainers/MultipleContainers.scss b/examples/src/content/Sortable/MultipleContainers/MultipleContainers.scss index f859b40..eb71660 100644 --- a/examples/src/content/Sortable/MultipleContainers/MultipleContainers.scss +++ b/examples/src/content/Sortable/MultipleContainers/MultipleContainers.scss @@ -3,25 +3,17 @@ /// MultipleContainers //// +@import 'utils/shared/layout'; @import 'components/StackedList/props'; $grid-columns: 8; .MultipleContainers { - @include centered-width(columns(5)); display: grid; grid-gap: get-layout-length(gutter); grid-template-columns: 100%; grid-template-areas: 'a' 'b' 'c'; - @media screen and (min-width: get-breakpoint('720p')) { - max-width: columns(7); - } - - @media screen and (min-width: get-breakpoint()) { - max-width: none; - } - @media screen and (min-width: get-breakpoint(desktop)) { grid-template-columns: repeat($grid-columns, 1fr); grid-template-areas: @@ -29,6 +21,10 @@ $grid-columns: 8; 'b b b b b c c c'; } + @media screen and (min-width: get-breakpoint('1080p', wide)) { + @include centered-width(columns(6)); + } + .Container { &:nth-child(1) { grid-area: a; @@ -43,6 +39,13 @@ $grid-columns: 8; } } + // resolve slim padding-bottom when single column + .StackedListHeader { + @media screen and (min-width: get-breakpoint(tablet)) and (max-width: get-breakpoint(desktop) - 1px) { + height: auto; + } + } + .draggable-mirror { // prevent wacky horizontal height issue max-height: stacked-list-item(base, desktop); diff --git a/examples/src/content/Sortable/SimpleList/SimpleList.scss b/examples/src/content/Sortable/SimpleList/SimpleList.scss index 18d48ba..c7d6ff9 100644 --- a/examples/src/content/Sortable/SimpleList/SimpleList.scss +++ b/examples/src/content/Sortable/SimpleList/SimpleList.scss @@ -6,8 +6,11 @@ @import 'utils/shared/layout'; @import 'components/StackedList/props'; +// using an arbitrary width until I have time to fix the `columns` function +$simple-list-width: 42rem; + .SimpleList { - @include centered-width(columns(5)); + @include centered-width($simple-list-width); .StackedListWrapper { .StackedListHeader { diff --git a/examples/src/content/Swappable/Flexbox/Flexbox.scss b/examples/src/content/Swappable/Flexbox/Flexbox.scss index 9f64df3..38456d1 100644 --- a/examples/src/content/Swappable/Flexbox/Flexbox.scss +++ b/examples/src/content/Swappable/Flexbox/Flexbox.scss @@ -19,26 +19,26 @@ $flexbox-block-name: unquote('Block'); @include draggable-source-layout($flexbox-block-name, 1, 2, 4, 5, 7) { .BlockContent { - height: columns(); + height: rows(2); } } @include draggable-source-layout($flexbox-block-name, 3, 6) { .BlockContent { - height: columns() * 1.5; + height: rows(3); } } @media screen and (min-width: get-breakpoint(tablet)) { @include draggable-source-layout($flexbox-block-name, 1, 2, 4, 5, 7) { .BlockContent { - height: columns() * 1.5; + height: rows(3); } } @include draggable-source-layout($flexbox-block-name, 3, 6) { .BlockContent { - height: columns(2); + height: rows(4); } } } @@ -62,13 +62,13 @@ $flexbox-block-name: unquote('Block'); @include draggable-source-layout($flexbox-block-name, 1, 2, 3, 4, 6, 7) { .BlockContent { - height: columns(2); + height: rows(4); } } @include draggable-source-layout($flexbox-block-name, 4, 5) { .BlockContent { - height: columns(3); + height: rows(5); } } } @@ -76,13 +76,13 @@ $flexbox-block-name: unquote('Block'); @media screen and (min-width: get-breakpoint('1080p', wide)) { @include draggable-source-layout($flexbox-block-name, 1, 2, 3, 4, 6, 7) { .BlockContent { - height: columns() * 2.5; + height: rows(5); } } @include draggable-source-layout($flexbox-block-name, 4, 5) { .BlockContent { - height: columns() * 3.5; + height: rows(6); } } } diff --git a/examples/src/content/Swappable/Floated/Floated.scss b/examples/src/content/Swappable/Floated/Floated.scss index 44f0ba6..72f1ff2 100644 --- a/examples/src/content/Swappable/Floated/Floated.scss +++ b/examples/src/content/Swappable/Floated/Floated.scss @@ -20,13 +20,13 @@ $floated-block-name: unquote('Block'); @include draggable-source-layout($floated-block-name, 3) { .BlockContent { - height: columns(2); + height: rows(4, true); } } .draggable--original ~ .Block:nth-child(3) { .BlockContent { - height: columns(); + height: rows(2, true); } } } @@ -42,19 +42,19 @@ $floated-block-name: unquote('Block'); @include draggable-source-layout($floated-block-name, 1, 2, 3, 7, 8) { .BlockContent { - height: columns() * 1.5; + height: rows(3); } } @include draggable-source-layout($floated-block-name, 4) { .BlockContent { - height: columns(3); + height: rows(6); } } @include draggable-source-layout($floated-block-name, 5, 6) { .BlockContent { - height: (columns() * 1.5) + (get-layout-length(gutter) / 2); + height: rows(3); } } } @@ -62,7 +62,7 @@ $floated-block-name: unquote('Block'); @media screen and (min-width: get-breakpoint(desktop)) { @include draggable-source-layout($floated-block-name, 1, 2, 3, 7, 8) { .BlockContent { - height: columns(2); + height: rows(4); } } } @@ -70,19 +70,19 @@ $floated-block-name: unquote('Block'); @media screen and (min-width: get-breakpoint('1080p', wide)) { @include draggable-source-layout($floated-block-name, 4) { .BlockContent { - height: columns(4); + height: rows(8); } } @include draggable-source-layout($floated-block-name, 5, 6) { .BlockContent { - height: columns(2); + height: rows(4); } } @include draggable-source-layout($floated-block-name, 7, 8) { .BlockContent { - height: columns() * 2.5; + height: rows(5); } } } diff --git a/examples/src/content/Swappable/GridLayout/GridLayout.scss b/examples/src/content/Swappable/GridLayout/GridLayout.scss index ca7ce56..0b84fbc 100644 --- a/examples/src/content/Swappable/GridLayout/GridLayout.scss +++ b/examples/src/content/Swappable/GridLayout/GridLayout.scss @@ -7,6 +7,7 @@ $grid-area-names: a, b, c, d, e, f, g; $grid-rows: 5; +$grid-rows-tablet: 6; $grid-columns: 5; $grid-columns-tablet: 8; @@ -22,18 +23,19 @@ $grid-columns-tablet: 8; 'f f f g g'; @media screen and (min-width: get-breakpoint(tablet)) { - grid-template-rows: repeat($grid-rows, columns() * 1.5); + grid-template-rows: repeat($grid-rows-tablet, rows(3)); grid-template-columns: repeat($grid-columns-tablet, 1fr); grid-template-areas: 'a a a a b b b b' 'a a a a d d d d' 'c c c c d d d d' 'e e e e e e e e' + 'f f f g g g g g' 'f f f g g g g g'; } @media screen and (min-width: get-breakpoint(desktop)) { - grid-template-rows: repeat($grid-rows, columns(2)); + grid-template-rows: repeat($grid-rows-tablet, rows(4)); } } diff --git a/examples/src/styles/examples-app.scss b/examples/src/styles/examples-app.scss index ec3baa1..c78b3fb 100644 --- a/examples/src/styles/examples-app.scss +++ b/examples/src/styles/examples-app.scss @@ -23,6 +23,7 @@ @import 'components/Heading/Heading'; @import 'components/Patterns/Patterns'; @import 'components/Main/Main'; +@import 'components/GridOverlay/GridOverlay'; @import 'components/PageHeader/PageHeader'; @import 'components/Handle/DragHandle'; @import 'components/Handle/NopeHandle'; diff --git a/examples/src/styles/examples-theme/_layout-length.scss b/examples/src/styles/examples-theme/_layout-length.scss index 3d84a79..350c07d 100644 --- a/examples/src/styles/examples-theme/_layout-length.scss +++ b/examples/src/styles/examples-theme/_layout-length.scss @@ -5,8 +5,12 @@ $examples-layout-length-data: ( base: 1rem, - gutter: 0.8rem, // base border-width + gutter: ( + mobile: 0.6rem, + base: 0.8rem, + ), column: 9.3rem, + row: 4rem, sidebar: 32rem, page-header: 64.2rem, main-interior: 144rem, diff --git a/examples/src/styles/utils/shared/functions.scss b/examples/src/styles/utils/shared/functions.scss index 73084c0..95049be 100644 --- a/examples/src/styles/utils/shared/functions.scss +++ b/examples/src/styles/utils/shared/functions.scss @@ -6,12 +6,32 @@ // Column based max-width layout // @param {Number} $count - Number of columns this element should span @function columns($count: 1) { - @if type-of($count) != number or $count < 1 { + $column-count-max: 8; + + @if type-of($count) != number or $count < 1 or $count > $column-count-max { @error 'You did not provide a proper column count.'; } - $column-width: $count * get-layout-length(column); + $percentage: ($count / $column-count-max) * 100%; $gutter-width: ($count - 1) * get-layout-length(gutter); - @return $column-width + $gutter-width; + @return $percentage; +} + +// Row based height layout +// @param {Number} $count - Number of rows this element should span +// @param {Boolean} $mobile - Use a smaller gutter if on mobile +// @param {Boolean} $inclusive - For use when the element is meant to begin within a gutter +@function rows($count: 1, $mobile: false, $inclusive: false) { + @if type-of($count) != number or $count < 1 { + @error 'You did not provide a proper row count.'; + } + + $gutter: if($mobile, get-layout-length(gutter, mobile), get-layout-length(gutter)); + $inclusive-gutters: if($inclusive, $gutter, 0); + + $row-height: $count * get-layout-length(row); + $gutter-height: ($count - 1) * $gutter - $inclusive-gutters; + + @return $row-height + $gutter-height; } diff --git a/examples/src/views/templates/document.html b/examples/src/views/templates/document.html index faeb1ac..09950c4 100644 --- a/examples/src/views/templates/document.html +++ b/examples/src/views/templates/document.html @@ -12,5 +12,7 @@ {% block main %}{% endblock %} + +