code.less 1.1 KB

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