2
0

_code.scss 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. font-size: $code-font-size;
  11. color: $code-color;
  12. word-break: break-word;
  13. // Streamline the style when inside anchors to avoid broken underline and more
  14. a > & {
  15. color: inherit;
  16. }
  17. }
  18. // User input typically entered via keyboard
  19. kbd {
  20. padding: $kbd-padding-y $kbd-padding-x;
  21. font-size: $kbd-font-size;
  22. color: $kbd-color;
  23. background-color: $kbd-bg;
  24. @include border-radius($border-radius-sm);
  25. @include box-shadow($kbd-box-shadow);
  26. kbd {
  27. padding: 0;
  28. font-size: 100%;
  29. font-weight: $nested-kbd-font-weight;
  30. @include box-shadow(none);
  31. }
  32. }
  33. // Blocks of code
  34. pre {
  35. display: block;
  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. font-size: inherit;
  41. color: inherit;
  42. word-break: normal;
  43. }
  44. }
  45. // Enable scrollable blocks of code
  46. .pre-scrollable {
  47. max-height: $pre-scrollable-max-height;
  48. overflow-y: scroll;
  49. }