_code.scss 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Inline and block code styles
  2. code,
  3. kbd,
  4. pre,
  5. samp {
  6. font-family: $font-family-monospace;
  7. }
  8. // Inline code
  9. code {
  10. padding: $code-padding-y $code-padding-x;
  11. font-size: $code-font-size;
  12. color: $code-color;
  13. background-color: $code-bg;
  14. @include border-radius($border-radius);
  15. }
  16. // User input typically entered via keyboard
  17. kbd {
  18. padding: $code-padding-y $code-padding-x;
  19. font-size: $code-font-size;
  20. color: $kbd-color;
  21. background-color: $kbd-bg;
  22. @include border-radius($border-radius-sm);
  23. @include box-shadow($kbd-box-shadow);
  24. kbd {
  25. padding: 0;
  26. font-size: 100%;
  27. font-weight: $nested-kbd-font-weight;
  28. @include box-shadow(none);
  29. }
  30. }
  31. // Blocks of code
  32. pre {
  33. display: block;
  34. margin-top: 0;
  35. margin-bottom: 1rem;
  36. font-size: $code-font-size;
  37. color: $pre-color;
  38. // Account for some code outputs that place code tags in pre tags
  39. code {
  40. padding: 0;
  41. font-size: inherit;
  42. color: inherit;
  43. background-color: transparent;
  44. border-radius: 0;
  45. }
  46. }
  47. // Enable scrollable blocks of code
  48. .pre-scrollable {
  49. max-height: $pre-scrollable-max-height;
  50. overflow-y: scroll;
  51. }