diff --git a/megatype/_config.scss b/megatype/_config.scss index 59a04f6..2adbf0f 100644 --- a/megatype/_config.scss +++ b/megatype/_config.scss @@ -26,8 +26,10 @@ $site-color-names: map-keys($palettes) !default; // Debugging // =================================== -// debug grid columns, grid, type baseline, & breakpoints +// debug grid (rows, columns), type baseline, & breakpoints $debug-grid: true !default; +$debug-grid-show-rows: true !default; +$debug-grid-show-columns: true !default; $debug-type: true !default; $debug-breakpoints: true !default; diff --git a/megatype/_debug.scss b/megatype/_debug.scss index 30230bb..0f22ca9 100644 --- a/megatype/_debug.scss +++ b/megatype/_debug.scss @@ -54,19 +54,32 @@ &:before { @include all-breakpoints { - background: + $grid-rows-bg: null; + $grid-columns-bg:null; + @if $debug-grid-show-rows == true { // vertical grid starts at 0 - linear-gradient(to bottom, - transparentize(darken($debug-base, 5%), 0.4) 1px, - transparent 1px, transparent $current-rootsize), + $grid-rows-bg: + "linear-gradient(to bottom, " + + transparentize(darken($debug-base, 5%), 0.4) + " 1px, " + + "transparent 1px, transparent #{$current-rootsize})"; + } + @if $debug-grid-show-columns == true { // for horizontal grid, starts at center, is more complex to draw - linear-gradient(to right, - transparent 0px, - transparent $current-rootsize / 2 - 1px, - transparentize(darken($debug-base, 5%), 0.9) $current-rootsize / 2 - 1px, - transparentize(darken($debug-base, 5%), 0.9) $current-rootsize / 2, - transparent $current-rootsize / 2, - transparent $current-rootsize); + $grid-columns-bg: + "linear-gradient(to right, " + + "transparent 0px, " + + "transparent " + ($current-rootsize / 2 - 1px) + ", " + + transparentize(darken($debug-base, 5%), 0.9) + " " + ($current-rootsize / 2 - 1px) + ", " + + transparentize(darken($debug-base, 5%), 0.9) + " " + ($current-rootsize / 2) + ", " + + "transparent " + ($current-rootsize / 2) + ", " + + "transparent " + $current-rootsize + ")"; + } + + $separator: null; + @if $debug-grid-show-rows == true and $debug-grid-show-columns == true { + $separator: ", "; + } + background: #{$grid-rows-bg}#{$separator}#{$grid-columns-bg}; background-repeat: repeat; background-position: center top; background-size: $current-rootsize $current-rootsize;