/**
 * Code
 * --------------------------------------------------
 */


// Inline and block code styles
code,
kbd,
pre,
samp {
  font-family: $font-family-monospace;
}

// Inline code
code {
  background-color: $code-bg;
  border-radius: rem($border-radius-base);
  color: $code-color;
  font-size: 90%;
  padding: rem(2 4);
}

// User input typically entered via keyboard
kbd {
  background-color: $kbd-bg;
  border-radius: rem($border-radius-small);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
  color: $kbd-color;
  font-size: 90%;
  padding: rem(2 4);

  kbd {
    box-shadow: none;
    font-size: 100%;
    padding: 0;
  }
}

// Blocks of code
pre {
  background-color: $pre-bg;
  border: 1px solid $pre-border-color;
  border-radius: rem($border-radius-base);
  color: $pre-color;
  display: block;
  font-size: rem($font-size-base - 1); // 14px to 13px
  line-height: $line-height-base;
  margin: rem(0 0 ($line-height-computed / 2));
  padding: rem(($line-height-computed - 1) / 2);
  word-break: break-all;
  word-wrap: break-word;

  // Account for some code outputs that place code tags in pre tags
  code {
    background-color: transparent;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
    padding: 0;
    white-space: pre-wrap;
  }
}

// Enable fixed height scrollable blocks of code
.pre-scrollable {
  max-height: rem($pre-scrollable-max-height);
  overflow-y: auto;
}


// Enable horizontal scrollable blocks of code
.pre-wrap {
  overflow: auto;
  white-space: pre;
  word-wrap: normal;
}
