doggystyle 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.hound.yml +5 -0
  4. data/.npmignore +18 -0
  5. data/.ruby-version +1 -0
  6. data/.scss-lint.yml +243 -0
  7. data/.travis.yml +5 -0
  8. data/CHANGELOG.md +5 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +40 -0
  12. data/RELEASING.md +1 -0
  13. data/Rakefile +9 -0
  14. data/bin/doggystyle +5 -0
  15. data/bower.json +38 -0
  16. data/circle.yml +13 -0
  17. data/core/_imports.scss +229 -0
  18. data/core/animations/_jump.scss +7 -0
  19. data/core/animations/_shake.scss +24 -0
  20. data/core/animations/_wobble.scss +8 -0
  21. data/core/functions/_mobile-first.scss +3 -0
  22. data/core/functions/_opposite-direction.scss +45 -0
  23. data/core/functions/casts/_to-bool.scss +19 -0
  24. data/core/functions/casts/_to-color.scss +74 -0
  25. data/core/functions/casts/_to-list.scss +38 -0
  26. data/core/functions/casts/_to-map.scss +27 -0
  27. data/core/functions/casts/_to-null.scss +15 -0
  28. data/core/functions/casts/_to-number.scss +66 -0
  29. data/core/functions/casts/_to-string.scss +15 -0
  30. data/core/functions/colours/_colour-contrast.scss +61 -0
  31. data/core/functions/colours/_colour.scss +69 -0
  32. data/core/functions/colours/_random-colour.scss +78 -0
  33. data/core/functions/lists/_contains.scss +62 -0
  34. data/core/functions/lists/_first.scss +19 -0
  35. data/core/functions/lists/_insert-nth.scss +37 -0
  36. data/core/functions/lists/_last.scss +11 -0
  37. data/core/functions/lists/_merge.scss +30 -0
  38. data/core/functions/lists/_prepend.scss +11 -0
  39. data/core/functions/lists/_remove-nth.scss +53 -0
  40. data/core/functions/lists/_remove.scss +30 -0
  41. data/core/functions/lists/_replace-nth.scss +55 -0
  42. data/core/functions/lists/_replace.scss +36 -0
  43. data/core/functions/lists/_reverse.scss +31 -0
  44. data/core/functions/lists/_second.scss +19 -0
  45. data/core/functions/lists/_shift.scss +24 -0
  46. data/core/functions/lists/_slice.scss +52 -0
  47. data/core/functions/lists/_sort.scss +51 -0
  48. data/core/functions/maps/_map-deep-get.scss +51 -0
  49. data/core/functions/maps/_map-deep-set.scss +34 -0
  50. data/core/functions/maps/_map-depth.scss +23 -0
  51. data/core/functions/maps/_map-extend.scss +47 -0
  52. data/core/functions/maps/_map-has-keys.scss +23 -0
  53. data/core/functions/maps/_map-has-nested-keys.scss +24 -0
  54. data/core/functions/maps/_map-set.scss +4 -0
  55. data/core/functions/maps/_map-zip.scss +50 -0
  56. data/core/functions/numbers/_add-unit.scss +54 -0
  57. data/core/functions/numbers/_pad.scss +16 -0
  58. data/core/functions/numbers/_spacer.scss +16 -0
  59. data/core/functions/numbers/_strip.scss +29 -0
  60. data/core/functions/numbers/_units.scss +17 -0
  61. data/core/functions/svg/_dots.scss +84 -0
  62. data/core/functions/svg/_fake-radius.scss +131 -0
  63. data/core/functions/svg/_lines.scss +76 -0
  64. data/core/functions/svg/_svg.scss +12 -0
  65. data/core/functions/text/_smart-lineheight.scss +13 -0
  66. data/core/functions/text/_string-explode.scss +45 -0
  67. data/core/functions/text/_string-replace.scss +38 -0
  68. data/core/helpers/_custom-elements.scss +114 -0
  69. data/core/helpers/_eases.scss +44 -0
  70. data/core/helpers/_reset.scss +282 -0
  71. data/core/helpers/_show-breakpoints.scss +25 -0
  72. data/core/helpers/_strings.scss +648 -0
  73. data/core/helpers/_warnings.scss +3 -0
  74. data/core/helpers/checks/_check.scss +69 -0
  75. data/core/helpers/checks/_is-absolute-length.scss +25 -0
  76. data/core/helpers/checks/_is-angel.scss +25 -0
  77. data/core/helpers/checks/_is-arglist.scss +11 -0
  78. data/core/helpers/checks/_is-bool.scss +23 -0
  79. data/core/helpers/checks/_is-calc.scss +11 -0
  80. data/core/helpers/checks/_is-colour.scss +23 -0
  81. data/core/helpers/checks/_is-dark.scss +14 -0
  82. data/core/helpers/checks/_is-duration.scss +15 -0
  83. data/core/helpers/checks/_is-false.scss +13 -0
  84. data/core/helpers/checks/_is-first-character.scss +11 -0
  85. data/core/helpers/checks/_is-frequency.scss +15 -0
  86. data/core/helpers/checks/_is-function.scss +44 -0
  87. data/core/helpers/checks/_is-integer.scss +15 -0
  88. data/core/helpers/checks/_is-length.scss +16 -0
  89. data/core/helpers/checks/_is-light.scss +14 -0
  90. data/core/helpers/checks/_is-list.scss +11 -0
  91. data/core/helpers/checks/_is-map.scss +11 -0
  92. data/core/helpers/checks/_is-null.scss +11 -0
  93. data/core/helpers/checks/_is-number.scss +19 -0
  94. data/core/helpers/checks/_is-percentage.scss +13 -0
  95. data/core/helpers/checks/_is-position.scss +16 -0
  96. data/core/helpers/checks/_is-pseudo.scss +24 -0
  97. data/core/helpers/checks/_is-relative-length.scss +25 -0
  98. data/core/helpers/checks/_is-resolution.scss +15 -0
  99. data/core/helpers/checks/_is-selector.scss +3 -0
  100. data/core/helpers/checks/_is-string.scss +11 -0
  101. data/core/helpers/checks/_is-time.scss +15 -0
  102. data/core/helpers/checks/_is-unit.scss +16 -0
  103. data/core/helpers/private/_arglist-to-list.scss +36 -0
  104. data/core/helpers/private/_brightness.scss +13 -0
  105. data/core/helpers/private/_find-digits.scss +41 -0
  106. data/core/helpers/private/_find-integer.scss +40 -0
  107. data/core/helpers/private/_from-hex.scss +48 -0
  108. data/core/helpers/private/_from-hsl.scss +55 -0
  109. data/core/helpers/private/_from-rgb.scss +55 -0
  110. data/core/helpers/private/_get-color-value.scss +26 -0
  111. data/core/helpers/private/_hash-fix.scss +15 -0
  112. data/core/helpers/private/_hex-to-dec.scss +28 -0
  113. data/core/helpers/private/_length.scss +26 -0
  114. data/core/helpers/private/_lightness.scss +15 -0
  115. data/core/helpers/private/_list-items-to-strings.scss +8 -0
  116. data/core/helpers/private/_min-max-number.scss +12 -0
  117. data/core/helpers/private/_pow.scss +29 -0
  118. data/core/helpers/private/_string-compare.scss +38 -0
  119. data/core/helpers/private/_string-explode.scss +43 -0
  120. data/core/helpers/private/_sudo.scss +23 -0
  121. data/core/helpers/symbols/_arrows.scss +337 -0
  122. data/core/helpers/symbols/_block.scss +97 -0
  123. data/core/helpers/symbols/_box.scss +385 -0
  124. data/core/helpers/symbols/_common.scss +101 -0
  125. data/core/helpers/symbols/_currency.scss +82 -0
  126. data/core/helpers/symbols/_dingbats.scss +565 -0
  127. data/core/helpers/symbols/_geometric.scss +289 -0
  128. data/core/helpers/symbols/_letterlike.scss +235 -0
  129. data/core/helpers/symbols/_misc.scss +568 -0
  130. data/core/helpers/symbols/_operators.scss +766 -0
  131. data/core/helpers/symbols/_punctuation.scss +214 -0
  132. data/core/mixins/_align.scss +15 -0
  133. data/core/mixins/_animate.scss +16 -0
  134. data/core/mixins/_aspect-ratio.scss +86 -0
  135. data/core/mixins/_backface-visibility.scss +7 -0
  136. data/core/mixins/_background-image.scss +13 -0
  137. data/core/mixins/_blend.scss +10 -0
  138. data/core/mixins/_blendmodes.scss +24 -0
  139. data/core/mixins/_border-radius.scss +105 -0
  140. data/core/mixins/_browsers.scss +155 -0
  141. data/core/mixins/_bulletpoint.scss +12 -0
  142. data/core/mixins/_center.scss +3 -0
  143. data/core/mixins/_clearfix.scss +7 -0
  144. data/core/mixins/_columns.scss +22 -0
  145. data/core/mixins/_custom-property.scss +15 -0
  146. data/core/mixins/_devices.scss +97 -0
  147. data/core/mixins/_dropdown.scss +38 -0
  148. data/core/mixins/_fake-radius.scss +99 -0
  149. data/core/mixins/_filters.scss +163 -0
  150. data/core/mixins/_flip.scss +11 -0
  151. data/core/mixins/_font-face.scss +11 -0
  152. data/core/mixins/_fontsize.scss +126 -0
  153. data/core/mixins/_gallery.scss +134 -0
  154. data/core/mixins/_gradient.scss +72 -0
  155. data/core/mixins/_image-size.scss +18 -0
  156. data/core/mixins/_image.scss +12 -0
  157. data/core/mixins/_inputs.scss +18 -0
  158. data/core/mixins/_keyframes.scss +8 -0
  159. data/core/mixins/_last.scss +5 -0
  160. data/core/mixins/_nth-last.scss +7 -0
  161. data/core/mixins/_nth.scss +10 -0
  162. data/core/mixins/_placeholder.scss +15 -0
  163. data/core/mixins/_prefixer.scss +55 -0
  164. data/core/mixins/_selection.scss +15 -0
  165. data/core/mixins/_shadow.scss +7 -0
  166. data/core/mixins/_size.scss +13 -0
  167. data/core/mixins/_smart-horizontal.scss +21 -0
  168. data/core/mixins/_sudo-image.scss +12 -0
  169. data/core/mixins/_text-shadow.scss +30 -0
  170. data/core/mixins/_transforms.scss +264 -0
  171. data/core/mixins/_transition.scss +189 -0
  172. data/core/mixins/_triangle-classic.scss +170 -0
  173. data/core/mixins/_triangle.scss +250 -0
  174. data/core/mixins/_unwrap.scss +5 -0
  175. data/core/mixins/_user-select.scss +5 -0
  176. data/core/mixins/_vertical.scss +10 -0
  177. data/core/mixins/columns/_columns.scss +92 -0
  178. data/core/mixins/flexbox/_flex-container.scss +201 -0
  179. data/core/mixins/flexbox/_flex-grid.scss +235 -0
  180. data/core/mixins/flexbox/_flex-items.scss +140 -0
  181. data/core/mixins/flexbox/_flex-remove.scss +12 -0
  182. data/core/mixins/grid/_break-between.scss +6 -0
  183. data/core/mixins/grid/_grid.scss +150 -0
  184. data/core/mixins/svg/_svg-size.scss +4 -0
  185. data/core/mixins/svg/_svg.scss +9 -0
  186. data/core/placeholders/_clear.scss +27 -0
  187. data/core/placeholders/_cursor.scss +35 -0
  188. data/core/placeholders/_misc.scss +20 -0
  189. data/core/placeholders/_rendering.scss +21 -0
  190. data/core/placeholders/_text.scss +41 -0
  191. data/core/settings/_colours.scss +30 -0
  192. data/core/settings/_directories.scss +7 -0
  193. data/core/settings/_global.scss +14 -0
  194. data/core/settings/_grid.scss +24 -0
  195. data/core/settings/_padding.scss +8 -0
  196. data/core/settings/_spacing.scss +8 -0
  197. data/core/settings/_text.scss +13 -0
  198. data/doggystyle.gemspec +29 -0
  199. data/eyeglass-exports.js +7 -0
  200. data/features/install.feature +29 -0
  201. data/features/step_definitions/doggystyle_steps.rb +31 -0
  202. data/features/support/bourbon_support.rb +19 -0
  203. data/features/support/env.rb +1 -0
  204. data/features/update.feature +30 -0
  205. data/features/version.feature +5 -0
  206. data/index.js +7 -0
  207. data/lib/doggystyle.rb +7 -0
  208. data/lib/doggystyle/generator.rb +81 -0
  209. data/lib/doggystyle/version.rb +3 -0
  210. data/package.json +33 -0
  211. data/spec/doggystyle/library/border_color_spec.rb +51 -0
  212. data/spec/doggystyle/library/border_radius_spec.rb +25 -0
  213. data/spec/doggystyle/library/border_style_spec.rb +51 -0
  214. data/spec/doggystyle/library/border_width_spec.rb +51 -0
  215. data/spec/doggystyle/library/buttons_spec.rb +53 -0
  216. data/spec/doggystyle/library/clearfix_spec.rb +18 -0
  217. data/spec/doggystyle/library/contrast_switch_spec.rb +23 -0
  218. data/spec/doggystyle/library/ellipsis_spec.rb +20 -0
  219. data/spec/doggystyle/library/font_face_spec_1.rb +16 -0
  220. data/spec/doggystyle/library/font_face_spec_2.rb +21 -0
  221. data/spec/doggystyle/library/font_face_spec_3.rb +16 -0
  222. data/spec/doggystyle/library/font_face_spec_4.rb +17 -0
  223. data/spec/doggystyle/library/font_stacks_spec.rb +40 -0
  224. data/spec/doggystyle/library/hide_text_spec.rb +17 -0
  225. data/spec/doggystyle/library/hide_visually_spec.rb +35 -0
  226. data/spec/doggystyle/library/margin_spec.rb +51 -0
  227. data/spec/doggystyle/library/modular_scale_spec.rb +43 -0
  228. data/spec/doggystyle/library/padding_spec.rb +51 -0
  229. data/spec/doggystyle/library/position_spec.rb +67 -0
  230. data/spec/doggystyle/library/prefixer_spec.rb +34 -0
  231. data/spec/doggystyle/library/shade_spec.rb +31 -0
  232. data/spec/doggystyle/library/size_spec.rb +31 -0
  233. data/spec/doggystyle/library/strip_unit_spec.rb +31 -0
  234. data/spec/doggystyle/library/text_inputs_spec.rb +75 -0
  235. data/spec/doggystyle/library/tint_spec.rb +31 -0
  236. data/spec/doggystyle/library/triangle_spec.rb +31 -0
  237. data/spec/doggystyle/library/word_wrap_spec.rb +29 -0
  238. data/spec/doggystyle/utilities/assign_inputs_spec.rb +50 -0
  239. data/spec/doggystyle/utilities/collapse_directionals.rb +25 -0
  240. data/spec/doggystyle/utilities/directional_values_spec.rb +21 -0
  241. data/spec/doggystyle/utilities/font_source_declaration_spec.rb +29 -0
  242. data/spec/doggystyle/utilities/retrieve_bourbon_setting_spec.rb +31 -0
  243. data/spec/doggystyle/utilities/unpack_spec.rb +32 -0
  244. data/spec/doggystyle/validators/contains_spec.rb +27 -0
  245. data/spec/doggystyle/validators/is_length_spec.rb +49 -0
  246. data/spec/doggystyle/validators/is_light_spec.rb +37 -0
  247. data/spec/doggystyle/validators/is_number_spec.rb +43 -0
  248. data/spec/doggystyle/validators/is_size_spec.rb +43 -0
  249. data/spec/fixtures/_setup.scss +1 -0
  250. data/spec/fixtures/library/border-color.scss +26 -0
  251. data/spec/fixtures/library/border-radius.scss +17 -0
  252. data/spec/fixtures/library/border-style.scss +21 -0
  253. data/spec/fixtures/library/border-width.scss +21 -0
  254. data/spec/fixtures/library/buttons.scss +17 -0
  255. data/spec/fixtures/library/clearfix.scss +5 -0
  256. data/spec/fixtures/library/contrast-switch.scss +9 -0
  257. data/spec/fixtures/library/ellipsis.scss +5 -0
  258. data/spec/fixtures/library/font-face-1.scss +6 -0
  259. data/spec/fixtures/library/font-face-2.scss +10 -0
  260. data/spec/fixtures/library/font-face-3.scss +8 -0
  261. data/spec/fixtures/library/font-face-4.scss +7 -0
  262. data/spec/fixtures/library/font-stacks.scss +41 -0
  263. data/spec/fixtures/library/hide-text.scss +5 -0
  264. data/spec/fixtures/library/hide-visually.scss +9 -0
  265. data/spec/fixtures/library/margin.scss +21 -0
  266. data/spec/fixtures/library/modular-scale.scss +29 -0
  267. data/spec/fixtures/library/padding.scss +21 -0
  268. data/spec/fixtures/library/position.scss +25 -0
  269. data/spec/fixtures/library/prefixer.scss +13 -0
  270. data/spec/fixtures/library/shade.scss +17 -0
  271. data/spec/fixtures/library/size.scss +13 -0
  272. data/spec/fixtures/library/strip-unit.scss +17 -0
  273. data/spec/fixtures/library/text-inputs.scss +21 -0
  274. data/spec/fixtures/library/tint.scss +17 -0
  275. data/spec/fixtures/library/triangle.scss +9 -0
  276. data/spec/fixtures/library/word-wrap.scss +9 -0
  277. data/spec/fixtures/utilities/assign-inputs.scss +19 -0
  278. data/spec/fixtures/utilities/collapse-directionals.scss +17 -0
  279. data/spec/fixtures/utilities/directional-values.scss +13 -0
  280. data/spec/fixtures/utilities/font-source-declaration.scss +11 -0
  281. data/spec/fixtures/utilities/retrieve-bourbon-setting.scss +16 -0
  282. data/spec/fixtures/utilities/unpack.scss +17 -0
  283. data/spec/fixtures/validators/contains.scss +28 -0
  284. data/spec/fixtures/validators/is-length.scss +35 -0
  285. data/spec/fixtures/validators/is-light.scss +29 -0
  286. data/spec/fixtures/validators/is-number.scss +31 -0
  287. data/spec/fixtures/validators/is-size.scss +31 -0
  288. data/spec/spec_helper.rb +22 -0
  289. data/spec/support/matchers/have_rule.rb +35 -0
  290. data/spec/support/matchers/have_ruleset.rb +20 -0
  291. data/spec/support/matchers/have_value.rb +17 -0
  292. data/spec/support/parser_support.rb +16 -0
  293. data/spec/support/sass_support.rb +10 -0
  294. metadata +527 -0
@@ -0,0 +1,25 @@
1
+ require "spec_helper"
2
+
3
+ describe "border-radius" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/border-radius")
6
+ end
7
+
8
+ context "called with one argument" do
9
+ it "applies to correct sides" do
10
+ top = "border-top-left-radius: 1em; " +
11
+ "border-top-right-radius: 1em;"
12
+ left = "border-bottom-left-radius: 2em; " +
13
+ "border-top-left-radius: 2em;"
14
+ right = "border-bottom-right-radius: 3em; " +
15
+ "border-top-right-radius: 3em;"
16
+ bottom = "border-bottom-left-radius: 4em; " +
17
+ "border-bottom-right-radius: 4em;"
18
+
19
+ expect(".border-top-radius").to have_ruleset(top)
20
+ expect(".border-left-radius").to have_ruleset(left)
21
+ expect(".border-right-radius").to have_ruleset(right)
22
+ expect(".border-bottom-radius").to have_ruleset(bottom)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,51 @@
1
+ require "spec_helper"
2
+
3
+ describe "border-style" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/border-style")
6
+ end
7
+
8
+ context "called with one style" do
9
+ it "applies same style to all sides" do
10
+ rule = "border-style: solid"
11
+
12
+ expect(".border-style-all").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with two styles" do
17
+ it "applies to alternating sides" do
18
+ rule = "border-style: dotted dashed"
19
+
20
+ expect(".border-style-alternate").to have_rule(rule)
21
+ end
22
+ end
23
+
24
+ context "called with three styles" do
25
+ it "applies second style to left and right" do
26
+ rule = "border-style: dashed double solid"
27
+
28
+ expect(".border-style-implied-left").to have_rule(rule)
29
+ end
30
+ end
31
+
32
+ context "called with four styles" do
33
+ it "applies different styles to all sides" do
34
+ rule = "border-style: dotted groove ridge none"
35
+
36
+ expect(".border-style-explicit").to have_rule(rule)
37
+ end
38
+ end
39
+
40
+ context "called with null values" do
41
+ it "writes rules for other three" do
42
+ ruleset = "border-top-style: inset; " +
43
+ "border-right-style: none; " +
44
+ "border-left-style: double;"
45
+ bad_rule = "border-bottom-style: null;"
46
+
47
+ expect(".border-style-false-third").to have_ruleset(ruleset)
48
+ expect(".border-style-false-third").to_not have_rule(bad_rule)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require "spec_helper"
2
+
3
+ describe "border-width" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/border-width")
6
+ end
7
+
8
+ context "called with one color" do
9
+ it "applies same width to all sides" do
10
+ rule = "border-width: 1px"
11
+
12
+ expect(".border-width-all").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with two widths" do
17
+ it "applies to alternating sides" do
18
+ rule = "border-width: 2px 3px"
19
+
20
+ expect(".border-width-alternate").to have_rule(rule)
21
+ end
22
+ end
23
+
24
+ context "called with three widths" do
25
+ it "applies second width to left and right" do
26
+ rule = "border-width: 4px 5px 6px"
27
+
28
+ expect(".border-width-implied-left").to have_rule(rule)
29
+ end
30
+ end
31
+
32
+ context "called with four widths" do
33
+ it "applies different widths to all sides" do
34
+ rule = "border-width: 7px 8px 9px 10px"
35
+
36
+ expect(".border-width-explicit").to have_rule(rule)
37
+ end
38
+ end
39
+
40
+ context "called with null values" do
41
+ it "writes rules for other three" do
42
+ ruleset = "border-top-width: 11px; " +
43
+ "border-right-width: 12px; " +
44
+ "border-left-width: 13px;"
45
+ bad_rule = "border-bottom-width: null;"
46
+
47
+ expect(".border-width-false-third").to have_ruleset(ruleset)
48
+ expect(".border-width-false-third").to_not have_rule(bad_rule)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,53 @@
1
+ require "spec_helper"
2
+
3
+ describe "buttons" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/buttons")
6
+
7
+ @buttons_list = %w(
8
+ button
9
+ [type='button']
10
+ [type='reset']
11
+ [type='submit']
12
+ )
13
+ end
14
+
15
+ context "expands plain buttons" do
16
+ it "finds selectors" do
17
+ list = @buttons_list.join(", ")
18
+ ruleset = "content: #{list};"
19
+
20
+ expect(".all-buttons").to have_ruleset(ruleset)
21
+ end
22
+ end
23
+
24
+ context "expands active buttons" do
25
+ it "finds selectors" do
26
+ list = @buttons_list.map { |input| "#{input}:active" }
27
+ list = list.join(", ")
28
+ ruleset = "content: #{list};"
29
+
30
+ expect(".all-buttons-active").to have_ruleset(ruleset)
31
+ end
32
+ end
33
+
34
+ context "expands focus buttons" do
35
+ it "finds selectors" do
36
+ list = @buttons_list.map { |input| "#{input}:focus" }
37
+ list = list.join(", ")
38
+ ruleset = "content: #{list};"
39
+
40
+ expect(".all-buttons-focus").to have_ruleset(ruleset)
41
+ end
42
+ end
43
+
44
+ context "expands hover buttons" do
45
+ it "finds selectors" do
46
+ list = @buttons_list.map { |input| "#{input}:hover" }
47
+ list = list.join(", ")
48
+ ruleset = "content: #{list};"
49
+
50
+ expect(".all-buttons-hover").to have_ruleset(ruleset)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+
3
+ describe "clearfix" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/clearfix")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds clearfix" do
10
+ input = ".clearfix::after"
11
+ ruleset = "clear: both; " +
12
+ 'content: ""; ' +
13
+ "display: block;"
14
+
15
+ expect(input).to have_ruleset(ruleset)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+
3
+ describe "contrast-switch" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/contrast-switch")
6
+ end
7
+
8
+ context "called with a light base color" do
9
+ it "outputs the dark color" do
10
+ rule = "color: #000;"
11
+
12
+ expect(".contrast-switch-light-base").to have_ruleset(rule)
13
+ end
14
+ end
15
+
16
+ context "called with a dark base color" do
17
+ it "outputs the light color" do
18
+ rule = "color: #eee;"
19
+
20
+ expect(".contrast-switch-dark-base").to have_ruleset(rule)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ require "spec_helper"
2
+
3
+ describe "ellipsis" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/ellipsis")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds ellipsis" do
10
+ ruleset = "display: inline-block; " +
11
+ "max-width: 100%; " +
12
+ "overflow: hidden; " +
13
+ "text-overflow: ellipsis; " +
14
+ "white-space: nowrap; " +
15
+ "word-wrap: normal;"
16
+
17
+ expect(".ellipsis").to have_ruleset(ruleset)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-face" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("css3/font-face-1")
6
+ end
7
+
8
+ context "called with defaults" do
9
+ it "outputs defaults" do
10
+ ruleset = 'font-family: "source-sans-pro"; ' +
11
+ 'src: url("/fonts/source-sans-pro/source-sans-pro-regular.woff2") format("woff2"), url("/fonts/source-sans-pro/source-sans-pro-regular.woff") format("woff"), url("/fonts/source-sans-pro/source-sans-pro-regular.ttf") format("truetype");'
12
+
13
+ expect("@font-face").to have_ruleset(ruleset)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-face" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("css3/font-face-5")
6
+ end
7
+
8
+ context "called with additional CSS rules" do
9
+ it "outputs defaults with additional content" do
10
+ ruleset = 'font-family: "calibre"; ' +
11
+ 'src: url("fonts/calibre.woff2") format("woff2"), ' +
12
+ 'url("fonts/calibre.woff") format("woff"), ' +
13
+ 'url("fonts/calibre.ttf") format("truetype"); ' +
14
+ "font-style: normal;" +
15
+ "font-weight: 600;" +
16
+ "unicode-range: U+26;"
17
+
18
+ expect("@font-face").to have_ruleset(ruleset)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-face" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("css3/font-face-3")
6
+ end
7
+
8
+ context "called with defaults" do
9
+ it "outputs defaults" do
10
+ ruleset = 'font-family: "pitch";' +
11
+ 'src: font-url("/fonts/pitch.woff2") format("woff2");'
12
+
13
+ expect("@font-face").to have_ruleset(ruleset)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-face" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("css3/font-face-4")
6
+ end
7
+
8
+ context "called with defaults" do
9
+ it "outputs defaults" do
10
+ ruleset = 'font-family: "circular"; ' +
11
+ 'src: url("/circular.woff2") format("woff2"), ' +
12
+ 'url("/circular.svg#circular") format("svg");'
13
+
14
+ expect("@font-face").to have_ruleset(ruleset)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,40 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-stacks" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/font-stacks")
6
+ end
7
+
8
+ context "stacks used in variable" do
9
+ it "output stacks" do
10
+ helvetica = '"Helvetica Neue", "Helvetica", "Arial", sans-serif'
11
+ lucida_grande = '"Lucida Grande", "Lucida Sans Unicode", ' +
12
+ '"Geneva", "Verdana", sans-serif'
13
+ verdana = '"Verdana", "Geneva", sans-serif'
14
+ garamond = '"Garamond", "Baskerville", "Baskerville Old Face", ' +
15
+ '"Hoefler Text", "Times New Roman", serif'
16
+ georgia = '"Georgia", "Times", "Times New Roman", serif'
17
+ hoefler_text = '"Hoefler Text", "Baskerville Old Face", ' +
18
+ '"Garamond", "Times New Roman", serif'
19
+ consolas = '"Consolas", "monaco", monospace'
20
+ courier_new = '"Courier New", "Courier", "Lucida Sans Typewriter", ' +
21
+ '"Lucida Typewriter", monospace'
22
+ monaco = '"monaco", "Consolas", "Lucida Console", monospace'
23
+
24
+ system = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", ' +
25
+ '"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", ' +
26
+ '"Helvetica Neue", sans-serif'
27
+
28
+ expect(".helvetica").to have_value(helvetica)
29
+ expect(".lucida-grande").to have_value(lucida_grande)
30
+ expect(".verdana").to have_value(verdana)
31
+ expect(".garamond").to have_value(garamond)
32
+ expect(".georgia").to have_value(georgia)
33
+ expect(".hoefler-text").to have_value(hoefler_text)
34
+ expect(".consolas").to have_value(consolas)
35
+ expect(".courier-new").to have_value(courier_new)
36
+ expect(".monaco").to have_value(monaco)
37
+ expect(".system").to have_value(system)
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+
3
+ describe "hide-text" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/hide-text")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds hide-text" do
10
+ ruleset = "overflow: hidden; " +
11
+ "text-indent: 101%; " +
12
+ "white-space: nowrap;"
13
+
14
+ expect(".hide-text").to have_ruleset(ruleset)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe "hide-visually" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/hide-visually")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds properties to hide the element" do
10
+ ruleset = "border: 0; " +
11
+ "clip: rect(1px, 1px, 1px, 1px); " +
12
+ "clip-path: circle(1% at 1% 1%); " +
13
+ "height: 1px; " +
14
+ "overflow: hidden; " +
15
+ "padding: 0; " +
16
+ "position: absolute; " +
17
+ "width: 1px;"
18
+
19
+ expect(".hide-visually").to have_ruleset(ruleset)
20
+ end
21
+ end
22
+
23
+ context "called with unhide argument" do
24
+ it "adds properties to reverse the hiding of the element" do
25
+ ruleset = "clip: auto; " +
26
+ "clip-path: none; " +
27
+ "height: auto; " +
28
+ "overflow: visible; " +
29
+ "position: static; " +
30
+ "width: auto;"
31
+
32
+ expect(".hide-visually--unhide").to have_ruleset(ruleset)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,51 @@
1
+ require "spec_helper"
2
+
3
+ describe "margin" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("library/margin")
6
+ end
7
+
8
+ context "called with one size" do
9
+ it "applies same width to all sides" do
10
+ rule = "margin: 1px"
11
+
12
+ expect(".margin-all").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with two sizes" do
17
+ it "applies to alternating sides" do
18
+ rule = "margin: 2px 3px"
19
+
20
+ expect(".margin-alternate").to have_rule(rule)
21
+ end
22
+ end
23
+
24
+ context "called with three sizes" do
25
+ it "applies second width to left and right" do
26
+ rule = "margin: 4px 5px 6px"
27
+
28
+ expect(".margin-implied-left").to have_rule(rule)
29
+ end
30
+ end
31
+
32
+ context "called with four sizes" do
33
+ it "applies different widths to all sides" do
34
+ rule = "margin: 7px 8px 9px 10px"
35
+
36
+ expect(".margin-explicit").to have_rule(rule)
37
+ end
38
+ end
39
+
40
+ context "called with null values" do
41
+ it "writes rules for other three" do
42
+ ruleset = "margin-top: 11px; " +
43
+ "margin-right: 12px; " +
44
+ "margin-left: 13px;"
45
+ bad_rule = "margin-bottom: null;"
46
+
47
+ expect(".margin-false-third").to have_ruleset(ruleset)
48
+ expect(".margin-false-third").to_not have_rule(bad_rule)
49
+ end
50
+ end
51
+ end