example.sass 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. pre
  38. max-height: 50vh
  39. &:not(:last-child)
  40. margin-bottom: 1.5rem
  41. $structure: $danger
  42. $structure-invert: $danger-invert
  43. .structure
  44. border-color: $structure
  45. border-radius: $radius
  46. padding: 1.5rem
  47. &:before
  48. background: $structure
  49. color: $structure-invert
  50. content: "Structure"
  51. .structure-item
  52. position: relative
  53. &:before
  54. +overlay
  55. background: rgba($black, 0.7)
  56. background: $background
  57. border: 1px solid $border
  58. content: ""
  59. display: block
  60. z-index: 1
  61. &:after
  62. +overlay
  63. align-items: center
  64. content: attr(title)
  65. display: flex
  66. font-family: $family-monospace
  67. font-size: 11px
  68. justify-content: center
  69. padding: 3px 5px
  70. z-index: 2
  71. &.is-structure-container
  72. padding: 1.5rem 0.75rem 0.75rem
  73. &:after
  74. align-items: flex-start
  75. justify-content: flex-start
  76. padding: 0.5rem 0.75rem
  77. .highlight
  78. position: relative
  79. .copy,
  80. .expand
  81. +unselectable
  82. background: $white
  83. border: solid $border
  84. border-width: 0 0 1px 1px
  85. color: $text-light
  86. cursor: pointer
  87. outline: none
  88. position: absolute
  89. right: 0
  90. top: 0
  91. &:hover
  92. border-color: $code
  93. color: $code
  94. .expand
  95. border-right-width: 1px
  96. right: 50px
  97. +tablet
  98. pre
  99. white-space: pre-wrap
  100. +tablet
  101. .section:not(.is-fullwidth) > .example:not(.is-fullwidth)
  102. margin-left: 1.5rem
  103. margin-right: 1.5rem
  104. & + .highlight
  105. margin-left: 1.5rem
  106. margin-right: 1.5rem
  107. .section.is-fullwidth
  108. padding: 0 !important
  109. .example
  110. border-left: none
  111. border-radius: 0
  112. border-right: none
  113. padding: 0
  114. & + .highlight
  115. border-left: none
  116. border-radius: 0
  117. border-right: none