code.less 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. }
  14. // Inline code
  15. code {
  16. color: #d14;
  17. background-color: #f7f7f9;
  18. border: 1px solid #e1e1e8;
  19. white-space: nowrap;
  20. }
  21. // Blocks of code
  22. pre {
  23. display: block;
  24. margin: 0 0 @baseLineHeight / 2;
  25. font-size: @baseFontSize - 1; // 14px to 13px
  26. line-height: @baseLineHeight;
  27. word-break: break-all;
  28. word-wrap: break-word;
  29. white-space: pre;
  30. white-space: pre-wrap;
  31. background-color: #f5f5f5;
  32. // Make prettyprint styles more spaced out for readability
  33. &.prettyprint {
  34. margin-bottom: @baseLineHeight;
  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. }