code.less 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // Code (inline and block)
  3. // --------------------------------------------------
  4. // Inline and block code styles
  5. code,
  6. kbd,
  7. pre,
  8. samp {
  9. font-family: @font-family-monospace;
  10. }
  11. // Inline code
  12. code {
  13. padding: 2px 4px;
  14. font-size: 90%;
  15. color: @code-color;
  16. background-color: @code-bg;
  17. border-radius: @border-radius-base;
  18. }
  19. // User input typically entered via keyboard
  20. kbd {
  21. padding: 2px 4px;
  22. font-size: 90%;
  23. color: @kbd-color;
  24. background-color: @kbd-bg;
  25. border-radius: @border-radius-small;
  26. box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
  27. kbd {
  28. padding: 0;
  29. font-size: 100%;
  30. font-weight: 700;
  31. box-shadow: none;
  32. }
  33. }
  34. // Blocks of code
  35. pre {
  36. display: block;
  37. padding: ((@line-height-computed - 1) / 2);
  38. margin: 0 0 (@line-height-computed / 2);
  39. font-size: (@font-size-base - 1); // 14px to 13px
  40. line-height: @line-height-base;
  41. color: @pre-color;
  42. word-break: break-all;
  43. word-wrap: break-word;
  44. background-color: @pre-bg;
  45. border: 1px solid @pre-border-color;
  46. border-radius: @border-radius-base;
  47. // Account for some code outputs that place code tags in pre tags
  48. code {
  49. padding: 0;
  50. font-size: inherit;
  51. color: inherit;
  52. white-space: pre-wrap;
  53. background-color: transparent;
  54. border-radius: 0;
  55. }
  56. }
  57. // Enable scrollable blocks of code
  58. .pre-scrollable {
  59. max-height: @pre-scrollable-max-height;
  60. overflow-y: scroll;
  61. }