_code.scss 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: .2rem .4rem;
  11. font-size: 90%;
  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: .2rem .4rem;
  19. font-size: 90%;
  20. color: $kbd-color;
  21. background-color: $kbd-bg;
  22. @include border-radius($border-radius-sm);
  23. @include box-shadow(inset 0 -.1rem 0 rgba(0,0,0,.25));
  24. kbd {
  25. padding: 0;
  26. font-size: 100%;
  27. font-weight: bold;
  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: 90%;
  37. line-height: $line-height;
  38. color: $pre-color;
  39. // Account for some code outputs that place code tags in pre tags
  40. code {
  41. padding: 0;
  42. font-size: inherit;
  43. color: inherit;
  44. background-color: transparent;
  45. border-radius: 0;
  46. }
  47. }
  48. // Enable scrollable blocks of code
  49. .pre-scrollable {
  50. max-height: $pre-scrollable-max-height;
  51. overflow-y: scroll;
  52. }