cheatsheet.css 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. body {
  2. scroll-behavior: smooth;
  3. }
  4. /**
  5. * Bootstrap "Journal code" icon
  6. * @link https://icons.getbootstrap.com/icons/journal-code/
  7. */
  8. .bd-heading a::before {
  9. display: inline-block;
  10. width: 1em;
  11. height: 1em;
  12. margin-right: .25rem;
  13. content: "";
  14. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%25230d6efd' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2h1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1H2a2 2 0 0 1 2-2z'/%3E%3Cpath d='M2 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2z'/%3E%3Cpath fill-rule='evenodd' d='M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z'/%3E%3C/svg%3E");
  15. background-size: 1em;
  16. }
  17. /* stylelint-disable-next-line selector-max-universal */
  18. .bd-heading + div > * + * {
  19. margin-top: 3rem;
  20. }
  21. /* Table of contents */
  22. .bd-aside a {
  23. padding: .1875rem .5rem;
  24. margin-top: .125rem;
  25. margin-left: .3125rem;
  26. color: rgba(0, 0, 0, .65);
  27. text-decoration: none;
  28. }
  29. .bd-aside a:hover,
  30. .bd-aside a:focus {
  31. color: rgba(0, 0, 0, .85);
  32. background-color: rgba(121, 82, 179, .1);
  33. }
  34. .bd-aside .active {
  35. font-weight: 600;
  36. color: rgba(0, 0, 0, .85);
  37. }
  38. .bd-aside .btn {
  39. padding: .25rem .5rem;
  40. font-weight: 600;
  41. color: rgba(0, 0, 0, .65);
  42. border: 0;
  43. }
  44. .bd-aside .btn:hover,
  45. .bd-aside .btn:focus {
  46. color: rgba(0, 0, 0, .85);
  47. background-color: rgba(121, 82, 179, .1);
  48. }
  49. .bd-aside .btn:focus {
  50. box-shadow: 0 0 0 1px rgba(121, 82, 179, .7);
  51. }
  52. .bd-aside .btn::before {
  53. width: 1.25em;
  54. line-height: 0;
  55. content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
  56. transition: transform .35s ease;
  57. /* rtl:raw:
  58. transform: rotate(180deg) translateX(-2px);
  59. */
  60. transform-origin: .5em 50%;
  61. }
  62. .bd-aside .btn[aria-expanded="true"]::before {
  63. transform: rotate(90deg)/* rtl:ignore */;
  64. }
  65. /* Examples */
  66. .scrollspy-example {
  67. position: relative;
  68. height: 200px;
  69. margin-top: .5rem;
  70. overflow: auto;
  71. }
  72. [id="modal"] .bd-example .btn,
  73. [id="buttons"] .bd-example .btn,
  74. [id="tooltips"] .bd-example .btn,
  75. [id="popovers"] .bd-example .btn,
  76. [id="dropdowns"] .bd-example .btn-group,
  77. [id="dropdowns"] .bd-example .dropdown,
  78. [id="dropdowns"] .bd-example .dropup,
  79. [id="dropdowns"] .bd-example .dropend,
  80. [id="dropdowns"] .bd-example .dropstart {
  81. margin: 0 1rem 1rem 0;
  82. }
  83. /* Layout */
  84. @media (min-width: 1200px) {
  85. body {
  86. display: grid;
  87. gap: 1rem;
  88. grid-template-columns: 1fr 4fr 1fr;
  89. grid-template-rows: auto;
  90. }
  91. .bd-header {
  92. position: fixed;
  93. top: 0;
  94. /* rtl:begin:ignore */
  95. right: 0;
  96. left: 0;
  97. /* rtl:end:ignore */
  98. z-index: 1030;
  99. grid-column: 1 / span 3;
  100. }
  101. .bd-aside,
  102. .bd-cheatsheet {
  103. padding-top: 4rem;
  104. }
  105. /**
  106. * 1. Too bad only Firefox supports subgrids ATM
  107. */
  108. .bd-cheatsheet,
  109. .bd-cheatsheet section,
  110. .bd-cheatsheet article {
  111. display: inherit; /* 1 */
  112. gap: inherit; /* 1 */
  113. grid-template-columns: 1fr 4fr;
  114. grid-column: 1 / span 2;
  115. grid-template-rows: auto;
  116. }
  117. .bd-aside {
  118. grid-area: 1 / 3;
  119. scroll-margin-top: 4rem;
  120. }
  121. .bd-cheatsheet section,
  122. .bd-cheatsheet section > h2 {
  123. top: 2rem;
  124. scroll-margin-top: 2rem;
  125. }
  126. .bd-cheatsheet section > h2::before {
  127. position: absolute;
  128. /* rtl:begin:ignore */
  129. top: 0;
  130. right: 0;
  131. bottom: -2rem;
  132. left: 0;
  133. /* rtl:end:ignore */
  134. z-index: -1;
  135. content: "";
  136. background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1) calc(100% - 3rem), rgba(255, 255, 255, .01));
  137. }
  138. .bd-cheatsheet article,
  139. .bd-cheatsheet .bd-heading {
  140. top: 8rem;
  141. scroll-margin-top: 8rem;
  142. }
  143. .bd-cheatsheet .bd-heading {
  144. z-index: 1;
  145. }
  146. }