code.less 1.2 KB

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