_code.scss 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. white-space: nowrap;
  18. border-radius: $border-radius-base;
  19. }
  20. // User input typically entered via keyboard
  21. kbd {
  22. padding: 2px 4px;
  23. font-size: 90%;
  24. color: $kbd-color;
  25. background-color: $kbd-bg;
  26. border-radius: $border-radius-small;
  27. box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
  28. }
  29. // Blocks of code
  30. pre {
  31. display: block;
  32. padding: (($line-height-computed - 1) / 2);
  33. margin: 0 0 ($line-height-computed / 2);
  34. font-size: ($font-size-base - 1); // 14px to 13px
  35. line-height: $line-height-base;
  36. word-break: break-all;
  37. word-wrap: break-word;
  38. color: $pre-color;
  39. background-color: $pre-bg;
  40. border: 1px solid $pre-border-color;
  41. border-radius: $border-radius-base;
  42. // Account for some code outputs that place code tags in pre tags
  43. code {
  44. padding: 0;
  45. font-size: inherit;
  46. color: inherit;
  47. white-space: pre-wrap;
  48. background-color: transparent;
  49. border-radius: 0;
  50. }
  51. }
  52. // Enable scrollable blocks of code
  53. .pre-scrollable {
  54. max-height: $pre-scrollable-max-height;
  55. overflow-y: scroll;
  56. }