example.sass 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. .bd-example,
  2. .bd-structure,
  3. .bd-snippet
  4. border: 1px solid $yellow
  5. position: relative
  6. &:before
  7. background: $yellow
  8. border-radius: $radius $radius 0 0
  9. bottom: 100%
  10. color: $yellow-invert
  11. content: "Example"
  12. display: inline-block
  13. font-size: 7px
  14. font-weight: bold
  15. left: -1px
  16. letter-spacing: 1px
  17. padding: 3px 5px
  18. position: absolute
  19. text-transform: uppercase
  20. vertical-align: top
  21. +tablet
  22. &.is-fullwidth
  23. border-left: none
  24. border-right: none
  25. padding: 0
  26. .bd-example,
  27. .bd-structure
  28. padding: 1.5rem
  29. &:not(:first-child)
  30. margin-top: 2rem
  31. &:not(:last-child)
  32. margin-bottom: 1.5rem
  33. .bd-example
  34. &.bd-is-clipped
  35. border-top-right-radius: $radius-large
  36. & + .highlight
  37. border: 1px solid $yellow
  38. border-radius: 0 0 $radius $radius
  39. border-top: none
  40. margin-top: -1.5rem
  41. &:not(:last-child)
  42. margin-bottom: 1.5rem
  43. // Snippet
  44. .bd-snippet
  45. +block
  46. border: 1px solid $yellow
  47. margin-top: 2rem
  48. position: relative
  49. &::before
  50. content: "Snippet"
  51. align-items: stretch
  52. display: flex
  53. .bd-snippet-preview
  54. padding: 1.5rem
  55. .bd-snippet-code
  56. background-color: $pre-background
  57. .bd-snippet-code.bd-is-more.bd-is-more-clipped
  58. .highlight
  59. height: 2em
  60. overflow: hidden
  61. pre
  62. overflow: hidden
  63. .bd-show
  64. display: flex
  65. .bd-snippet.bd-is-horizontal
  66. border-radius: $radius-large
  67. border-top-left-radius: 0
  68. .bd-snippet-code.bd-is-more.bd-is-more-clipped
  69. .highlight
  70. pre
  71. padding-top: 0.325rem
  72. .bd-snippet.bd-is-clipped
  73. .bd-snippet-code
  74. overflow: auto
  75. +desktop
  76. .bd-snippet.bd-is-vertical
  77. align-items: stretch
  78. border-radius: $radius-large
  79. border-top-left-radius: 0
  80. display: flex
  81. justify-content: center
  82. .bd-snippet-preview,
  83. .bd-snippet-code
  84. width: 50%
  85. .bd-snippet-code
  86. &,
  87. .highlight,
  88. .highlight pre
  89. align-items: stretch
  90. border-radius: 0 $radius-large $radius-large 0
  91. display: flex
  92. flex-direction: column
  93. .highlight,
  94. .highlight pre,
  95. .highlight .language-html
  96. flex-grow: 1
  97. .highlight pre
  98. white-space: pre
  99. &.bd-is-one-fifth
  100. .bd-snippet-preview
  101. align-items: center
  102. display: flex
  103. justify-content: center
  104. width: calc(128px + 3rem)
  105. .bd-snippet-code
  106. width: calc(100% - 128px - 3rem)
  107. &.bd-is-two-fifths
  108. .bd-snippet-preview
  109. align-items: center
  110. display: flex
  111. justify-content: center
  112. width: calc(256px + 3rem)
  113. .bd-snippet-code
  114. width: calc(100% - 256px - 3rem)
  115. &.bd-is-one-third
  116. .bd-snippet-preview
  117. width: 33.3333%
  118. .bd-snippet-code
  119. width: 66.6666%
  120. // Highlight
  121. .highlight.bd-is-hovering
  122. border-radius: 2px
  123. box-shadow: 0 0 0 2px $yellow
  124. .highlight pre
  125. max-height: 320px
  126. margin-bottom: 0 !important
  127. .highlight-full,
  128. #navbarJsExample
  129. &:not(:last-child)
  130. margin-bottom: 1.5rem
  131. .highlight pre
  132. max-height: none
  133. $structure: $danger
  134. $structure-invert: $danger-invert
  135. .bd-structure
  136. border-color: $structure
  137. border-radius: $radius
  138. padding: 1.5rem
  139. &:before
  140. background: $structure
  141. color: $structure-invert
  142. content: "Structure"
  143. .bd-structure-item
  144. position: relative
  145. &:before
  146. +overlay
  147. background: rgba($black, 0.7)
  148. background: $background
  149. border: 1px solid $border
  150. content: ""
  151. display: block
  152. z-index: 1
  153. &:after
  154. +overlay
  155. align-items: center
  156. content: attr(title)
  157. display: flex
  158. font-family: $family-monospace
  159. font-size: 11px
  160. justify-content: center
  161. padding: 3px 5px
  162. z-index: 2
  163. &.bd-is-structure-container
  164. padding: 1.5rem 0.75rem 0.75rem
  165. &:after
  166. align-items: flex-start
  167. justify-content: flex-start
  168. padding: 0.5rem 0.75rem
  169. .highlight
  170. position: relative
  171. .bd-copy,
  172. .bd-expand
  173. background: none
  174. border: none
  175. color: $text
  176. cursor: pointer
  177. font-size: 0.625rem
  178. outline: none
  179. padding-bottom: 0
  180. padding-top: 0
  181. position: absolute
  182. right: 0.25rem
  183. top: 0.25rem
  184. &:hover
  185. background-color: $yellow
  186. color: $yellow-invert
  187. &:focus,
  188. &:active
  189. box-shadow: none
  190. .bd-expand
  191. right: 45px
  192. .bd-show
  193. +overlay
  194. align-items: center
  195. background-color: rgba($background, 0.7)
  196. border: none
  197. color: rgba(#000, 0.5)
  198. cursor: pointer
  199. display: none
  200. font-size: $size-small
  201. justify-content: center
  202. width: 100%
  203. strong
  204. color: currentColor
  205. font-weight: $weight-semibold
  206. &:hover
  207. background-color: rgba($yellow, 0.8)
  208. color: rgba(#000, 0.7)
  209. +tablet
  210. pre
  211. white-space: pre-wrap
  212. +tablet
  213. .section:not(.is-fullwidth) > .bd-example:not(.is-fullwidth)
  214. margin-left: 1.5rem
  215. margin-right: 1.5rem
  216. & + .highlight
  217. margin-left: 1.5rem
  218. margin-right: 1.5rem
  219. .section.is-fullwidth
  220. padding: 0 !important
  221. .bd-snippet
  222. border-left: none
  223. border-radius: 0
  224. border-right: none
  225. .bd-example
  226. border-left: none
  227. border-radius: 0
  228. border-right: none
  229. padding: 0
  230. & + .highlight
  231. border-left: none
  232. border-radius: 0
  233. border-right: none