example.sass 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. & + .highlight
  35. border: 1px solid $yellow
  36. border-radius: 0 0 $radius $radius
  37. border-top: none
  38. margin-top: -1.5rem
  39. &:not(:last-child)
  40. margin-bottom: 1.5rem
  41. // Snippet
  42. .bd-snippet
  43. +block
  44. border: 1px solid $yellow
  45. margin-top: 2rem
  46. position: relative
  47. &::before
  48. content: "Snippet"
  49. align-items: stretch
  50. display: flex
  51. .bd-snippet-preview
  52. padding: 1.5rem
  53. .bd-snippet-code
  54. background-color: $pre-background
  55. .bd-snippet.bd-is-clipped
  56. .bd-snippet-code
  57. overflow: auto
  58. +desktop
  59. .bd-snippet.bd-is-vertical
  60. align-items: stretch
  61. display: flex
  62. justify-content: center
  63. .bd-snippet-preview,
  64. .bd-snippet-code
  65. width: 50%
  66. .bd-snippet-code
  67. &,
  68. .highlight,
  69. .highlight pre
  70. align-items: stretch
  71. display: flex
  72. flex-direction: column
  73. .highlight,
  74. .highlight pre,
  75. .highlight .language-html
  76. flex-grow: 1
  77. .highlight pre
  78. white-space: pre
  79. &.bd-is-one-third
  80. .bd-snippet-preview
  81. width: 33.3333%
  82. .bd-snippet-code
  83. width: 66.6666%
  84. // Highlight
  85. .highlight.bd-is-hovering
  86. border-radius: 2px
  87. box-shadow: 0 0 0 2px $yellow
  88. .highlight pre
  89. max-height: 320px
  90. margin-bottom: 0 !important
  91. .highlight-full,
  92. #navbarJsExample
  93. &:not(:last-child)
  94. margin-bottom: 1.5rem
  95. .highlight pre
  96. max-height: none
  97. $structure: $danger
  98. $structure-invert: $danger-invert
  99. .bd-structure
  100. border-color: $structure
  101. border-radius: $radius
  102. padding: 1.5rem
  103. &:before
  104. background: $structure
  105. color: $structure-invert
  106. content: "Structure"
  107. .bd-structure-item
  108. position: relative
  109. &:before
  110. +overlay
  111. background: rgba($black, 0.7)
  112. background: $background
  113. border: 1px solid $border
  114. content: ""
  115. display: block
  116. z-index: 1
  117. &:after
  118. +overlay
  119. align-items: center
  120. content: attr(title)
  121. display: flex
  122. font-family: $family-monospace
  123. font-size: 11px
  124. justify-content: center
  125. padding: 3px 5px
  126. z-index: 2
  127. &.bd-is-structure-container
  128. padding: 1.5rem 0.75rem 0.75rem
  129. &:after
  130. align-items: flex-start
  131. justify-content: flex-start
  132. padding: 0.5rem 0.75rem
  133. .highlight
  134. position: relative
  135. .bd-copy,
  136. .bd-expand
  137. background: none
  138. border: none
  139. color: $text
  140. cursor: pointer
  141. font-size: 0.625rem
  142. outline: none
  143. padding-bottom: 0
  144. padding-top: 0
  145. position: absolute
  146. right: 0.25rem
  147. top: 0.25rem
  148. &:hover
  149. background-color: $yellow
  150. color: $yellow-invert
  151. &:focus,
  152. &:active
  153. box-shadow: none
  154. .bd-expand
  155. right: 45px
  156. +tablet
  157. pre
  158. white-space: pre-wrap
  159. +tablet
  160. .section:not(.is-fullwidth) > .bd-example:not(.is-fullwidth)
  161. margin-left: 1.5rem
  162. margin-right: 1.5rem
  163. & + .highlight
  164. margin-left: 1.5rem
  165. margin-right: 1.5rem
  166. .section.is-fullwidth
  167. padding: 0 !important
  168. .bd-example
  169. border-left: none
  170. border-radius: 0
  171. border-right: none
  172. padding: 0
  173. & + .highlight
  174. border-left: none
  175. border-radius: 0
  176. border-right: none