code.less 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // Code (inline and blocK)
  3. // --------------------------------------------------
  4. // Inline and block code styles
  5. code,
  6. pre {
  7. padding: 0 3px 2px;
  8. #font > #family > .monospace;
  9. font-size: @baseFontSize - 2;
  10. color: @grayDark;
  11. background-color: @codeTagBackground;
  12. .border-radius(3px);
  13. }
  14. // Inline code
  15. code {
  16. padding: 2px 4px;
  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. padding: (@baseLineHeight - 1) / 2;
  26. margin: 0 0 @baseLineHeight / 2;
  27. font-size: @baseFontSize - 1; // 14px to 13px
  28. line-height: @baseLineHeight;
  29. word-break: break-all;
  30. word-wrap: break-word;
  31. white-space: pre;
  32. white-space: pre-wrap;
  33. background-color: #f5f5f5;
  34. border: 1px solid rgba(0,0,0,.15);
  35. .border-radius(@baseBorderRadius);
  36. // Make prettyprint styles more spaced out for readability
  37. &.prettyprint {
  38. margin-bottom: @baseLineHeight;
  39. }
  40. // Account for some code outputs that place code tags in pre tags
  41. code {
  42. padding: 0;
  43. color: inherit;
  44. white-space: pre;
  45. white-space: pre-wrap;
  46. background-color: transparent;
  47. border: 0;
  48. }
  49. }