Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion megatype/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
35 changes: 24 additions & 11 deletions megatype/_debug.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down