example.sass 5.4 KB

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