_code.scss 1.2 KB

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