example.sass 3.2 KB

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