intro.sass 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. $scrollableArea: 2000px
  2. $exampleWidth: 400px
  3. $exampleHeight: 180px
  4. @mixin inline-block
  5. display: inline-block
  6. vertical-align: middle
  7. *vertical-align: auto
  8. *zoom: 1
  9. *display: inline
  10. *, *:after, *:before
  11. box-sizing: border-box
  12. body
  13. position: relative
  14. .yellow-box
  15. width: 100px
  16. height: 100px
  17. background-color: #fe8
  18. pointer-events: none
  19. .green-box
  20. margin-top: ($exampleHeight - 50px) / 2
  21. margin-left: ($exampleWidth - 200px) / 2
  22. width: 200px
  23. height: 50px
  24. background-color: #4e9
  25. .no-green &
  26. display: none
  27. .scroll-box
  28. height: 150px
  29. border: 10px solid #eee
  30. background: #fbfbfb
  31. overflow: auto
  32. position: relative
  33. .scroll-content
  34. height: $scrollableArea
  35. width: $scrollableArea
  36. padding: ($scrollableArea - $exampleHeight)/2 ($scrollableArea - $exampleWidth)/2 + 9
  37. pre.pre-with-output
  38. margin: 0
  39. width: 50%
  40. float: left
  41. code mark
  42. background: #b8daff
  43. color: #000
  44. p, h2, h3
  45. clear: both
  46. output
  47. display: block
  48. position: relative
  49. width: 50%
  50. float: right
  51. margin-bottom: 15px
  52. &.scroll-page
  53. .scroll-box
  54. overflow: hidden
  55. &:after
  56. content: "↕ scroll the page ↕"
  57. &:after
  58. content: "↕ scroll this area ↕"
  59. position: absolute
  60. bottom: 25px
  61. width: 100%
  62. text-align: center
  63. font-size: 16px
  64. font-variant: small-caps
  65. color: #777
  66. opacity: 1
  67. transition: opacity 0.2s
  68. &.scrolled:after
  69. opacity: 0
  70. &[deactivated], &[activated]
  71. .scroll-box
  72. pointer-events: none
  73. cursor: pointer
  74. &:after
  75. position: absolute
  76. top: 0
  77. left: 0
  78. right: 0
  79. bottom: 0
  80. opacity: 1
  81. content: "Click To Show"
  82. background-color: #AAA
  83. border-left: 10px solid #EEE
  84. color: white
  85. font-size: 24px
  86. font-variant: normal
  87. padding-top: 80px
  88. &[activated]
  89. &:after
  90. content: "Click To Hide"
  91. &.visible-enabled
  92. &:after
  93. height: 35px
  94. padding-top: 5px
  95. .attachment-mark
  96. position: relative
  97. &:after
  98. content: "A"
  99. width: 10px
  100. height: 10px
  101. background-color: red
  102. display: inline-block
  103. line-height: 10px
  104. font-size: 9px
  105. color: white
  106. text-align: center
  107. position: absolute
  108. span.attachment-mark
  109. &:after
  110. position: relative
  111. top: -1px
  112. margin-right: 1px
  113. .tether-marker-dot
  114. @extend .attachment-mark
  115. position: absolute
  116. &:after
  117. top: -5px
  118. left: -5px
  119. @each $type in target, element
  120. .tether-#{ $type }-marker
  121. position: absolute
  122. @each $side in left, top, bottom, right
  123. div.tether-#{ $type }-attached-#{ $side } &
  124. #{ $side }: 0
  125. div.tether-#{ $type }-attached-center &
  126. left: 50%
  127. .tether-element-attached-middle .tether-element-marker
  128. top: 50px
  129. .tether-target-attached-middle .tether-target-marker
  130. top: 25px
  131. .tether-element
  132. position: relative
  133. &.tether-pinned-left
  134. box-shadow: inset 2px 0 0 0 red
  135. &.tether-pinned-right
  136. box-shadow: inset -2px 0 0 0 red
  137. &.tether-pinned-top
  138. box-shadow: inset 0 2px 0 0 red
  139. &.tether-pinned-bottom
  140. box-shadow: inset 0 -2px 0 0 red
  141. .tether-target
  142. position: relative
  143. .tether-element.tether-out-of-bounds[data-example="hide"]
  144. display: none
  145. [data-example^="optimizer"]
  146. &.lang-javascript
  147. /* This should just be a `code` selector, but sass doesn't allow that with & */
  148. min-height: 220px
  149. &.tether-element
  150. &:before
  151. margin-top: 26px
  152. display: block
  153. text-align: center
  154. content: "I'm in the body"
  155. line-height: 1.2
  156. font-size: 15px
  157. padding: 4px
  158. color: #666
  159. .scroll-box .tether-element:before
  160. content: "I'm in my scroll parent!"
  161. .tether-element[data-example="scroll-visible"]
  162. height: 30px
  163. .tether-marker-dot
  164. display: none
  165. .hs-doc-content h2.projects-header
  166. text-align: center
  167. font-weight: 300
  168. .projects-paragraph
  169. text-align: center
  170. a
  171. +inline-block
  172. text-align: center
  173. margin-right: 30px
  174. color: inherit
  175. span
  176. +inline-block
  177. margin-bottom: 20px
  178. font-size: 20px
  179. color: inherit
  180. font-weight: 300
  181. img
  182. display: block
  183. max-width: 100%
  184. width: 100px