_code.scss 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // Code (inline and blocK)
  3. // --------------------------------------------------
  4. // Inline and block code styles
  5. code,
  6. pre {
  7. @include font-family-monospace();
  8. font-size: $font-size-base - 2;
  9. background-color: $code-tag-bg;
  10. color: $text-color;
  11. border: 1px solid darken($code-tag-bg, 15%);
  12. padding: 10px;
  13. border-radius: 4px;
  14. }
  15. // Inline code
  16. code {
  17. color: $text-color;
  18. background-color: $code-tag-bg;
  19. border: 1px solid darken($code-tag-bg, 15%);
  20. white-space: nowrap;
  21. }
  22. // Blocks of code
  23. pre {
  24. display: block;
  25. margin: 0 0 $line-height-base;
  26. line-height: $line-height-base;
  27. word-break: break-all;
  28. word-wrap: break-word;
  29. white-space: pre;
  30. white-space: pre-wrap;
  31. background-color: $code-tag-bg;
  32. // Make prettyprint styles more spaced out for readability
  33. &.prettyprint {
  34. margin-bottom: $line-height-base;
  35. }
  36. // Account for some code outputs that place code tags in pre tags
  37. code {
  38. padding: 0;
  39. color: inherit;
  40. white-space: pre;
  41. white-space: pre-wrap;
  42. background-color: transparent;
  43. border: 0;
  44. }
  45. }