example.sass 3.4 KB

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