<commit_before>// Background Grid Syntax
// ======================

$susy-overlay-grid-head-exists: false;


// Show Grid/s
// -----------
// Show grid on any element using either background or overlay.
// - [$grid]  : <settings>
@mixin show-grid(
  $grid: $susy
) {
  $inspect: $grid;
  $_output: debug-get(output, $grid);

  @include susy-inspect(show-grid, $inspect);
  @if $_output == overlay {
    @include overlay-grid($grid);
  } @else {
    @include background-grid($grid);
  }
}

@mixin show-grids(
  $grid: $susy
) {
  @include show-grid($grid);
}

// Background Grid
// ---------------
// Show a grid background on any element.
// - [$grid]  : <settings>
@mixin background-grid(
  $grid: $susy
) {
  $inspect  : $grid;
  $_output  : get-background($grid);

  @if length($_output) > 0 {
    $_flow: susy-get(flow, $grid);

    $_image: ();
    @each $name, $layer in map-get($_output, image) {
      $_direction: if($name == baseline, to bottom, to to($_flow));
      $_image: append($_image, linear-gradient($_direction, $layer), comma);
    }
    $_output: map-merge($_output, (image: $_image));

    @include background-grid-output($_output...);
    @include susy-inspect(background-grid, $inspect);
  }
}


// Overlay Grid
// ------------
// Generate an icon to trigger grid-overlays on any given elements.
// $grids...  : <selector> [<settings>] [, <selector>]*
@mixin overlay-grid (
  $grid: $susy
) {
  @if not($susy-overlay-grid-head-exists) {
    @at-root head { @include overlay-head; }
    @at-root head:before { @include overlay-trigger; }
    @at-root head:hover { @include overlay-trigger-hover; }
    $susy-overlay-grid-head-exists: true !global;
  }

  head:hover ~ &,
  head:hover ~ body & {
    position: relative;
    &:before {
      @include grid-overlay-base;
      @include background-grid($grid);
    }
  }
}


// [Private] Overlay Trigger
// -------------------------
@mixin overlay-trigger {
  content: "|||";
  display: block;
  padding: 5px 10px;
  font: {
    family: sans-serif;
    size: 16px;
    weight: bold;
  }
}


// [Private] Overlay Trigger Hover
// -------------------------------
@mixin overlay-trigger-hover {
  background: rgba(white, .5);
  color: red;
}


// [Private] Overlay Head
// ----------------------
// <head> styles to create grid overlay toggle
@mixin overlay-head {
  $_toggle: debug-get(toggle);
  $_horz: null;
  $_vert: null;

  @each $side in $_toggle {
    $_horz: if($side == left or $side == right, $side, $_horz);
    $_vert: if($side == top or $side == bottom, $side, $_vert);
  }

  display: block;
  position: fixed;
  #{$_horz}: 10px;
  #{$_vert}: 10px;
  z-index: 999;
  color: #333;
  background: rgba(white, .25);
}


// [Private] Grid Overlay Base
// ---------------------------
// Base styles for generating a grid overlay
@mixin grid-overlay-base() {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;<commit_msg>Pass grid to overlay-head for positioning<commit_after>// Background Grid Syntax
// ======================

$susy-overlay-grid-head-exists: false;


// Show Grid/s
// -----------
// Show grid on any element using either background or overlay.
// - [$grid]  : <settings>
@mixin show-grid(
  $grid: $susy
) {
  $inspect: $grid;
  $_output: debug-get(output, $grid);

  @include susy-inspect(show-grid, $inspect);
  @if $_output == overlay {
    @include overlay-grid($grid);
  } @else {
    @include background-grid($grid);
  }
}

@mixin show-grids(
  $grid: $susy
) {
  @include show-grid($grid);
}

// Background Grid
// ---------------
// Show a grid background on any element.
// - [$grid]  : <settings>
@mixin background-grid(
  $grid: $susy
) {
  $inspect  : $grid;
  $_output  : get-background($grid);

  @if length($_output) > 0 {
    $_flow: susy-get(flow, $grid);

    $_image: ();
    @each $name, $layer in map-get($_output, image) {
      $_direction: if($name == baseline, to bottom, to to($_flow));
      $_image: append($_image, linear-gradient($_direction, $layer), comma);
    }
    $_output: map-merge($_output, (image: $_image));

    @include background-grid-output($_output...);
    @include susy-inspect(background-grid, $inspect);
  }
}


// Overlay Grid
// ------------
// Generate an icon to trigger grid-overlays on any given elements.
// $grids...  : <selector> [<settings>] [, <selector>]*
@mixin overlay-grid (
  $grid: $susy
) {
  @if not($susy-overlay-grid-head-exists) {
    @at-root head { @include overlay-head($grid); }
    @at-root head:before { @include overlay-trigger; }
    @at-root head:hover { @include overlay-trigger-hover; }
    $susy-overlay-grid-head-exists: true !global;
  }

  head:hover ~ &,
  head:hover ~ body & {
    position: relative;
    &:before {
      @include grid-overlay-base;
      @include background-grid($grid);
    }
  }
}


// [Private] Overlay Trigger
// -------------------------
@mixin overlay-trigger {
  content: "|||";
  display: block;
  padding: 5px 10px;
  font: {
    family: sans-serif;
    size: 16px;
    weight: bold;
  }
}


// [Private] Overlay Trigger Hover
// -------------------------------
@mixin overlay-trigger-hover {
  background: rgba(white, .5);
  color: red;
}


// [Private] Overlay Head
// ----------------------
// <head> styles to create grid overlay toggle
@mixin overlay-head (
  $grid: $susy
) {
  $_toggle: debug-get(toggle, $grid);
  $_horz: null;
  $_vert: null;

  @each $side in $_toggle {
    $_horz: if($side == left or $side == right, $side, $_horz);
    $_vert: if($side == top or $side == bottom, $side, $_vert);
  }

  display: block;
  position: fixed;
  #{$_horz}: 10px;
  #{$_vert}: 10px;
  z-index: 999;
  color: #333;
  background: rgba(white, .25);
}


// [Private] Grid Overlay Base
// ---------------------------
// Base styles for generating a grid overlay
@mixin grid-overlay-base() {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
{'fraction_non_alphanumeric': 0.2229580573951435, 'fraction_numerical': 0.007811173374087281, 'mean_word_length': 2.5396634615384617, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7646637', 'n_tokens_mistral': 2127, 'n_tokens_neox': 1996, 'n_words': 509}