_code.scss 1.1 KB

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