1
0

code.less 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. .border-radius(3px);
  12. }
  13. // Inline code
  14. code {
  15. padding: 2px 4px;
  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. padding: (@baseLineHeight - 1) / 2;
  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. border: 1px solid #ccc; // fallback for IE7-8
  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. }
  50. // Enable scrollable blocks of code
  51. .pre-scrollable {
  52. max-height: 340px;
  53. overflow-y: scroll;
  54. }