_component-examples.scss 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. // stylelint-disable no-duplicate-selectors, selector-no-qualifying-type
  2. //
  3. // Grid examples
  4. //
  5. .bd-example-row {
  6. .row {
  7. > .col,
  8. > [class^="col-"] {
  9. padding-top: .75rem;
  10. padding-bottom: .75rem;
  11. background-color: rgba(86, 61, 124, .15);
  12. border: 1px solid rgba(86, 61, 124, .2);
  13. }
  14. }
  15. .row + .row {
  16. margin-top: 1rem;
  17. }
  18. .flex-items-top,
  19. .flex-items-middle,
  20. .flex-items-bottom {
  21. min-height: 6rem;
  22. background-color: rgba(255, 0, 0, .1);
  23. }
  24. }
  25. .bd-example-row-flex-cols .row {
  26. min-height: 10rem;
  27. background-color: rgba(255, 0, 0, .1);
  28. }
  29. .bd-highlight {
  30. background-color: rgba($bd-purple, .15);
  31. border: 1px solid rgba($bd-purple, .15);
  32. }
  33. // Grid mixins
  34. .example-container {
  35. width: 800px;
  36. @include make-container();
  37. }
  38. .example-row {
  39. @include make-row();
  40. }
  41. .example-content-main {
  42. @include make-col-ready();
  43. @include media-breakpoint-up(sm) {
  44. @include make-col(6);
  45. }
  46. @include media-breakpoint-up(lg) {
  47. @include make-col(8);
  48. }
  49. }
  50. .example-content-secondary {
  51. @include make-col-ready();
  52. @include media-breakpoint-up(sm) {
  53. @include make-col(6);
  54. }
  55. @include media-breakpoint-up(lg) {
  56. @include make-col(4);
  57. }
  58. }
  59. //
  60. // Container illustrations
  61. //
  62. .bd-example-container {
  63. min-width: 16rem;
  64. max-width: 25rem;
  65. margin-right: auto;
  66. margin-left: auto;
  67. }
  68. .bd-example-container-header {
  69. height: 3rem;
  70. margin-bottom: .5rem;
  71. background-color: lighten($blue, 50%);
  72. border-radius: .25rem;
  73. }
  74. .bd-example-container-sidebar {
  75. float: right;
  76. width: 4rem;
  77. height: 8rem;
  78. background-color: lighten($blue, 25%);
  79. border-radius: .25rem;
  80. }
  81. .bd-example-container-body {
  82. height: 8rem;
  83. margin-right: 4.5rem;
  84. background-color: lighten($bd-purple, 25%);
  85. border-radius: .25rem;
  86. }
  87. .bd-example-container-fluid {
  88. max-width: none;
  89. }
  90. //
  91. // Docs examples
  92. //
  93. .bd-example {
  94. position: relative;
  95. padding: 1rem;
  96. margin: 1rem (-$grid-gutter-width / 2) 0;
  97. border: solid #f7f7f9;
  98. border-width: .2rem 0 0;
  99. @include clearfix();
  100. @include media-breakpoint-up(sm) {
  101. padding: 1.5rem;
  102. margin-right: 0;
  103. margin-left: 0;
  104. border-width: .2rem;
  105. }
  106. + .highlight,
  107. + .clipboard + .highlight {
  108. margin-top: 0;
  109. }
  110. + p {
  111. margin-top: 2rem;
  112. }
  113. .pos-f-t {
  114. position: relative;
  115. margin: -1rem;
  116. @include media-breakpoint-up(sm) {
  117. margin: -1.5rem;
  118. }
  119. }
  120. .custom-file-input:lang(es) ~ .custom-file-label::after {
  121. content: "Elegir";
  122. }
  123. > .form-control {
  124. + .form-control {
  125. margin-top: .5rem;
  126. }
  127. }
  128. > .nav + .nav,
  129. > .alert + .alert,
  130. > .navbar + .navbar,
  131. > .progress + .progress,
  132. > .progress + .btn {
  133. margin-top: 1rem;
  134. }
  135. > .dropdown-menu:first-child {
  136. position: static;
  137. display: block;
  138. }
  139. > .form-group:last-child {
  140. margin-bottom: 0;
  141. }
  142. > .close {
  143. float: none;
  144. }
  145. }
  146. // Typography
  147. .bd-example-type {
  148. .table {
  149. .type-info {
  150. color: #999;
  151. vertical-align: middle;
  152. }
  153. td {
  154. padding: 1rem 0;
  155. border-color: #eee;
  156. }
  157. tr:first-child td {
  158. border-top: 0;
  159. }
  160. }
  161. h1,
  162. h2,
  163. h3,
  164. h4,
  165. h5,
  166. h6 {
  167. margin-top: 0;
  168. margin-bottom: 0;
  169. }
  170. }
  171. // Contextual background colors
  172. .bd-example-bg-classes p {
  173. padding: 1rem;
  174. }
  175. // Images
  176. .bd-example > img {
  177. + img {
  178. margin-left: .5rem;
  179. }
  180. }
  181. // Buttons
  182. .bd-example {
  183. > .btn-group {
  184. margin-top: .25rem;
  185. margin-bottom: .25rem;
  186. }
  187. > .btn-toolbar + .btn-toolbar {
  188. margin-top: .5rem;
  189. }
  190. }
  191. // Forms
  192. .bd-example-control-sizing select,
  193. .bd-example-control-sizing input[type="text"] + input[type="text"] {
  194. margin-top: .5rem;
  195. }
  196. .bd-example-form .input-group {
  197. margin-bottom: .5rem;
  198. }
  199. .bd-example > textarea.form-control {
  200. resize: vertical;
  201. }
  202. // List groups
  203. .bd-example > .list-group {
  204. max-width: 400px;
  205. }
  206. // Navbars
  207. .bd-example {
  208. .fixed-top,
  209. .sticky-top {
  210. position: static;
  211. margin: -1rem -1rem 1rem;
  212. }
  213. .fixed-bottom {
  214. position: static;
  215. margin: 1rem -1rem -1rem;
  216. }
  217. @include media-breakpoint-up(sm) {
  218. .fixed-top,
  219. .sticky-top {
  220. margin: -1.5rem -1.5rem 1rem;
  221. }
  222. .fixed-bottom {
  223. margin: 1rem -1.5rem -1.5rem;
  224. }
  225. }
  226. }
  227. // Pagination
  228. .bd-example .pagination {
  229. margin-top: .5rem;
  230. margin-bottom: .5rem;
  231. }
  232. // Example modals
  233. .modal {
  234. z-index: 1072;
  235. .tooltip,
  236. .popover {
  237. z-index: 1073;
  238. }
  239. }
  240. .modal-backdrop {
  241. z-index: 1071;
  242. }
  243. .bd-example-modal {
  244. background-color: #fafafa;
  245. .modal {
  246. position: relative;
  247. top: auto;
  248. right: auto;
  249. bottom: auto;
  250. left: auto;
  251. z-index: 1;
  252. display: block;
  253. }
  254. .modal-dialog {
  255. left: auto;
  256. margin-right: auto;
  257. margin-left: auto;
  258. }
  259. }
  260. // Example tabbable tabs
  261. .bd-example-tabs .nav-tabs {
  262. margin-bottom: 1rem;
  263. }
  264. // Popovers
  265. .bd-example-popover-static {
  266. padding-bottom: 1.5rem;
  267. background-color: #f9f9f9;
  268. .popover {
  269. position: relative;
  270. display: block;
  271. float: left;
  272. width: 260px;
  273. margin: 1.25rem;
  274. }
  275. }
  276. // Tooltips
  277. .tooltip-demo a {
  278. white-space: nowrap;
  279. }
  280. .bd-example-tooltip-static .tooltip {
  281. position: relative;
  282. display: inline-block;
  283. margin: 10px 20px;
  284. opacity: 1;
  285. }
  286. // Scrollspy demo on fixed height div
  287. .scrollspy-example {
  288. position: relative;
  289. height: 200px;
  290. margin-top: .5rem;
  291. overflow: auto;
  292. }
  293. .scrollspy-example-2 {
  294. position: relative;
  295. height: 350px;
  296. overflow: auto;
  297. }
  298. .bd-example-border-utils {
  299. [class^="border"] {
  300. display: inline-block;
  301. width: 5rem;
  302. height: 5rem;
  303. margin: .25rem;
  304. background-color: #f5f5f5;
  305. }
  306. }
  307. .bd-example-border-utils-0 {
  308. [class^="border"] {
  309. border: 1px solid $border-color;
  310. }
  311. }
  312. //
  313. // Code snippets
  314. //
  315. .highlight {
  316. padding: 1rem;
  317. margin-top: 1rem;
  318. margin-bottom: 1rem;
  319. background-color: #f7f7f9;
  320. -ms-overflow-style: -ms-autohiding-scrollbar;
  321. @include media-breakpoint-up(sm) {
  322. padding: 1.5rem;
  323. }
  324. }
  325. .bd-content .highlight {
  326. margin-right: (-$grid-gutter-width / 2);
  327. margin-left: (-$grid-gutter-width / 2);
  328. @include media-breakpoint-up(sm) {
  329. margin-right: 0;
  330. margin-left: 0;
  331. }
  332. }
  333. .highlight {
  334. pre {
  335. padding: 0;
  336. margin-top: 0;
  337. margin-bottom: 0;
  338. background-color: transparent;
  339. border: 0;
  340. }
  341. pre code {
  342. font-size: inherit;
  343. color: $gray-900; // Effectively the base text color
  344. }
  345. }