code.less 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. box-shadow: none;
  31. }
  32. }
  33. // Blocks of code
  34. pre {
  35. display: block;
  36. padding: ((@line-height-computed - 1) / 2);
  37. margin: 0 0 (@line-height-computed / 2);
  38. font-size: (@font-size-base - 1); // 14px to 13px
  39. line-height: @line-height-base;
  40. word-break: break-all;
  41. word-wrap: break-word;
  42. color: @pre-color;
  43. background-color: @pre-bg;
  44. border: 1px solid @pre-border-color;
  45. border-radius: @border-radius-base;
  46. // Account for some code outputs that place code tags in pre tags
  47. code {
  48. padding: 0;
  49. font-size: inherit;
  50. color: inherit;
  51. white-space: pre-wrap;
  52. background-color: transparent;
  53. border-radius: 0;
  54. }
  55. }
  56. // Enable scrollable blocks of code
  57. .pre-scrollable {
  58. max-height: @pre-scrollable-max-height;
  59. overflow-y: scroll;
  60. }