_component-examples.scss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. //
  2. // Grid examples
  3. //
  4. .bd-example-row {
  5. .row {
  6. > .col,
  7. > [class^="col-"] {
  8. padding-top: .75rem;
  9. padding-bottom: .75rem;
  10. background-color: rgba(39, 41, 43, .03);
  11. border: 1px solid rgba(39, 41, 43, .1);
  12. }
  13. }
  14. .row + .row {
  15. margin-top: 1rem;
  16. }
  17. }
  18. .bd-example-row-flex-cols .row {
  19. min-height: 10rem;
  20. background-color: rgba(255, 0, 0, .1);
  21. }
  22. .bd-highlight {
  23. background-color: rgba($bd-purple, .15);
  24. border: 1px solid rgba($bd-purple, .15);
  25. }
  26. // Grid mixins
  27. .example-container {
  28. width: 800px;
  29. @include make-container();
  30. }
  31. .example-row {
  32. @include make-row();
  33. }
  34. .example-content-main {
  35. @include make-col-ready();
  36. @include media-breakpoint-up(sm) {
  37. @include make-col(6);
  38. }
  39. @include media-breakpoint-up(lg) {
  40. @include make-col(8);
  41. }
  42. }
  43. .example-content-secondary {
  44. @include make-col-ready();
  45. @include media-breakpoint-up(sm) {
  46. @include make-col(6);
  47. }
  48. @include media-breakpoint-up(lg) {
  49. @include make-col(4);
  50. }
  51. }
  52. //
  53. // Docs examples
  54. //
  55. .bd-example {
  56. position: relative;
  57. padding: 1rem;
  58. margin: 1rem (-$grid-gutter-width * .5) 0;
  59. border: solid $gray-300;
  60. border-width: 1px 0 0;
  61. @include clearfix();
  62. @include media-breakpoint-up(sm) {
  63. padding: 1.5rem;
  64. margin-right: 0;
  65. margin-left: 0;
  66. border-width: 1px;
  67. @include border-top-radius(.25rem);
  68. + .bd-clipboard + .highlight {
  69. @include border-bottom-radius(.25rem);
  70. }
  71. }
  72. + p {
  73. margin-top: 2rem;
  74. }
  75. > .form-control {
  76. + .form-control {
  77. margin-top: .5rem;
  78. }
  79. }
  80. > .nav + .nav,
  81. > .alert + .alert,
  82. > .navbar + .navbar,
  83. > .progress + .progress {
  84. margin-top: 1rem;
  85. }
  86. > .dropdown-menu {
  87. position: static;
  88. display: block;
  89. }
  90. > :last-child {
  91. margin-bottom: 0;
  92. }
  93. // Images
  94. > svg + svg,
  95. > img + img {
  96. margin-left: .5rem;
  97. }
  98. // Buttons
  99. > .btn,
  100. > .btn-group {
  101. margin: .25rem .125rem;
  102. }
  103. > .btn-toolbar + .btn-toolbar {
  104. margin-top: .5rem;
  105. }
  106. // List groups
  107. > .list-group {
  108. max-width: 400px;
  109. }
  110. > [class*="list-group-horizontal"] {
  111. max-width: 100%;
  112. }
  113. // Navbars
  114. .fixed-top,
  115. .sticky-top {
  116. position: static;
  117. margin: -1rem -1rem 1rem;
  118. }
  119. .fixed-bottom {
  120. position: static;
  121. margin: 1rem -1rem -1rem;
  122. }
  123. @include media-breakpoint-up(sm) {
  124. .fixed-top,
  125. .sticky-top {
  126. margin: -1.5rem -1.5rem 1rem;
  127. }
  128. .fixed-bottom {
  129. margin: 1rem -1.5rem -1.5rem;
  130. }
  131. }
  132. // Pagination
  133. .pagination {
  134. margin-top: .5rem;
  135. margin-bottom: .5rem;
  136. }
  137. }
  138. // Ratio helpers
  139. .bd-example-ratios {
  140. .ratio {
  141. display: inline-block;
  142. width: 10rem;
  143. color: $gray-600;
  144. background-color: $gray-100;
  145. border: $border-width solid $border-color;
  146. > div {
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. }
  151. }
  152. }
  153. .bd-example-ratios-breakpoint {
  154. .ratio-4x3 {
  155. width: 16rem;
  156. @include media-breakpoint-up(md) {
  157. --bs-aspect-ratio: 50%; // 2x1
  158. }
  159. }
  160. }
  161. .bd-example-modal {
  162. background-color: #fafafa;
  163. .modal {
  164. position: static;
  165. display: block;
  166. }
  167. }
  168. .bd-example-offcanvas {
  169. @include border-start-radius(0);
  170. .offcanvas {
  171. position: static;
  172. display: block;
  173. height: 200px;
  174. visibility: visible;
  175. transform: translate(0);
  176. }
  177. }
  178. // Tooltips
  179. .tooltip-demo a {
  180. white-space: nowrap;
  181. }
  182. // Scrollspy demo on fixed height div
  183. .scrollspy-example {
  184. position: relative;
  185. height: 200px;
  186. margin-top: .5rem;
  187. overflow: auto;
  188. }
  189. .scrollspy-example-2 {
  190. position: relative;
  191. height: 350px;
  192. overflow: auto;
  193. }
  194. .bd-example-border-utils {
  195. [class^="border"] {
  196. display: inline-block;
  197. width: 5rem;
  198. height: 5rem;
  199. margin: .25rem;
  200. background-color: #f5f5f5;
  201. }
  202. }
  203. .bd-example-border-utils-0 {
  204. [class^="border"] {
  205. border: 1px solid $border-color;
  206. }
  207. }
  208. .bd-example-rounded-utils {
  209. [class*="rounded"] {
  210. margin: .25rem;
  211. }
  212. }
  213. .bd-example-position-utils {
  214. position: relative;
  215. padding: 3em;
  216. .position-relative {
  217. height: 200px;
  218. background-color: #f5f5f5;
  219. }
  220. .position-absolute {
  221. width: 2em;
  222. height: 2em;
  223. background-color: $dark;
  224. @include border-radius();
  225. }
  226. }
  227. .bd-example-position-examples {
  228. &::after {
  229. content: none;
  230. }
  231. }
  232. // Toasts
  233. .bd-example-toasts {
  234. min-height: 240px;
  235. }
  236. //
  237. // Code snippets
  238. //
  239. .highlight {
  240. padding: 1rem;
  241. margin-bottom: 1rem;
  242. background-color: $gray-100;
  243. @include media-breakpoint-up(sm) {
  244. padding: 1rem 1.5rem;
  245. }
  246. pre {
  247. padding: 0;
  248. margin-top: .65rem;
  249. margin-bottom: .65rem;
  250. white-space: pre;
  251. background-color: transparent;
  252. border: 0;
  253. }
  254. pre code {
  255. @include font-size(inherit);
  256. color: $gray-900; // Effectively the base text color
  257. word-wrap: normal;
  258. }
  259. }
  260. .bd-content .highlight {
  261. margin-right: (-$grid-gutter-width * .5);
  262. margin-left: (-$grid-gutter-width * .5);
  263. @include media-breakpoint-up(sm) {
  264. margin-right: 0;
  265. margin-left: 0;
  266. }
  267. }