_code.scss 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 $code-tag-border;
  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. code.code--small {
  23. font-size: $font-size-xs;
  24. padding: 5px;
  25. margin: 0 2px;
  26. }
  27. p.code--line {
  28. line-height: 1.8;
  29. }
  30. // Blocks of code
  31. pre {
  32. display: block;
  33. margin: 0 0 $line-height-base;
  34. line-height: $line-height-base;
  35. word-break: break-all;
  36. word-wrap: break-word;
  37. white-space: pre;
  38. white-space: pre-wrap;
  39. background-color: $code-tag-bg;
  40. // Make prettyprint styles more spaced out for readability
  41. &.prettyprint {
  42. margin-bottom: $line-height-base;
  43. }
  44. // Account for some code outputs that place code tags in pre tags
  45. code {
  46. padding: 0;
  47. color: inherit;
  48. white-space: pre;
  49. white-space: pre-wrap;
  50. background-color: transparent;
  51. border: 0;
  52. }
  53. }