example.sass 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. .example,
  2. .structure
  3. border: 1px solid $warning
  4. border-top-right-radius: $radius
  5. color: $warning-invert
  6. padding: 1.5rem
  7. position: relative
  8. &:not(:first-child)
  9. margin-top: 2rem
  10. &:not(:last-child)
  11. margin-bottom: 1.5rem
  12. &:before
  13. background: $warning
  14. border-radius: $radius $radius 0 0
  15. bottom: 100%
  16. content: "Example"
  17. display: inline-block
  18. font-size: 7px
  19. font-weight: bold
  20. left: -1px
  21. letter-spacing: 1px
  22. padding: 3px 5px
  23. position: absolute
  24. text-transform: uppercase
  25. vertical-align: top
  26. +tablet
  27. &.is-fullwidth
  28. border-left: none
  29. border-right: none
  30. padding: 0
  31. .example
  32. & + .highlight
  33. border: 1px solid $warning
  34. border-radius: 0 0 $radius $radius
  35. border-top: none
  36. margin-top: -1.5rem
  37. &:not(:last-child)
  38. margin-bottom: 1.5rem
  39. .highlight pre
  40. max-height: 320px
  41. margin-bottom: 0 !important
  42. padding: 1.25em 1.5em
  43. code
  44. padding: 0
  45. $structure: $danger
  46. $structure-invert: $danger-invert
  47. .structure
  48. border-color: $structure
  49. border-radius: $radius
  50. padding: 1.5rem
  51. &:before
  52. background: $structure
  53. color: $structure-invert
  54. content: "Structure"
  55. .structure-item
  56. position: relative
  57. &:before
  58. +overlay
  59. background: rgba($black, 0.7)
  60. background: $background
  61. border: 1px solid $border
  62. content: ""
  63. display: block
  64. z-index: 1
  65. &:after
  66. +overlay
  67. align-items: center
  68. content: attr(title)
  69. display: flex
  70. font-family: $family-monospace
  71. font-size: 11px
  72. justify-content: center
  73. padding: 3px 5px
  74. z-index: 2
  75. &.is-structure-container
  76. padding: 1.5rem 0.75rem 0.75rem
  77. &:after
  78. align-items: flex-start
  79. justify-content: flex-start
  80. padding: 0.5rem 0.75rem
  81. .highlight
  82. position: relative
  83. .copy,
  84. .expand
  85. +unselectable
  86. background: $white
  87. border: solid $border
  88. border-width: 0 0 1px 1px
  89. color: $text-light
  90. cursor: pointer
  91. outline: none
  92. position: absolute
  93. right: 0
  94. top: 0
  95. &:hover
  96. border-color: $code
  97. color: $code
  98. .expand
  99. border-right-width: 1px
  100. right: 50px
  101. +tablet
  102. pre
  103. white-space: pre-wrap
  104. +tablet
  105. .section:not(.is-fullwidth) > .example:not(.is-fullwidth)
  106. margin-left: 1.5rem
  107. margin-right: 1.5rem
  108. & + .highlight
  109. margin-left: 1.5rem
  110. margin-right: 1.5rem
  111. .section.is-fullwidth
  112. padding: 0 !important
  113. .example
  114. border-left: none
  115. border-radius: 0
  116. border-right: none
  117. padding: 0
  118. & + .highlight
  119. border-left: none
  120. border-radius: 0
  121. border-right: none