compass 0.12.7 → 0.13.alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. data/README.markdown +1 -1
  2. data/Rakefile +14 -9
  3. data/VERSION.yml +6 -0
  4. data/features/command_line.feature +8 -50
  5. data/features/step_definitions/command_line_steps.rb +3 -2
  6. data/frameworks/compass/stylesheets/compass/_css3.scss +2 -0
  7. data/frameworks/compass/stylesheets/compass/_support.scss +4 -4
  8. data/frameworks/compass/stylesheets/compass/css3/_animation.scss +121 -0
  9. data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +10 -6
  10. data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +32 -36
  11. data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +32 -35
  12. data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +12 -15
  13. data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +27 -48
  14. data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +22 -35
  15. data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +12 -8
  16. data/frameworks/compass/stylesheets/compass/css3/_box.scss +57 -82
  17. data/frameworks/compass/stylesheets/compass/css3/_columns.scss +104 -71
  18. data/frameworks/compass/stylesheets/compass/css3/_filter.scss +38 -18
  19. data/frameworks/compass/stylesheets/compass/css3/_flexbox.scss +294 -0
  20. data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +4 -4
  21. data/frameworks/compass/stylesheets/compass/css3/_hyphenation.scss +13 -22
  22. data/frameworks/compass/stylesheets/compass/css3/_images.scss +45 -48
  23. data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +1 -1
  24. data/frameworks/compass/stylesheets/compass/css3/_regions.scss +12 -8
  25. data/frameworks/compass/stylesheets/compass/css3/_selection.scss +31 -0
  26. data/frameworks/compass/stylesheets/compass/css3/_shared.scss +226 -2
  27. data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +21 -26
  28. data/frameworks/compass/stylesheets/compass/css3/_transform-legacy.scss +3 -3
  29. data/frameworks/compass/stylesheets/compass/css3/_transform.scss +8 -8
  30. data/frameworks/compass/stylesheets/compass/css3/_transition.scss +3 -3
  31. data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +43 -4
  32. data/frameworks/compass/stylesheets/compass/typography/_units.scss +152 -0
  33. data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +180 -102
  34. data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +5 -3
  35. data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +6 -3
  36. data/frameworks/compass/stylesheets/compass/typography/text/_ellipsis.scss +1 -1
  37. data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +7 -3
  38. data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +2 -2
  39. data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +32 -13
  40. data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +14 -9
  41. data/lib/compass/actions.rb +3 -1
  42. data/lib/compass/commands/update_project.rb +1 -2
  43. data/lib/compass/commands/watch_project.rb +11 -113
  44. data/lib/compass/commands.rb +1 -1
  45. data/lib/compass/compiler.rb +8 -1
  46. data/lib/compass/configuration/data.rb +1 -1
  47. data/lib/compass/configuration/helpers.rb +2 -0
  48. data/lib/compass/exec/project_options_parser.rb +8 -0
  49. data/lib/compass/logger.rb +2 -0
  50. data/lib/compass/sass_extensions/functions/cross_browser_support.rb +1 -1
  51. data/lib/compass/sass_extensions/functions/env.rb +18 -0
  52. data/lib/compass/sass_extensions/functions/gradient_support.rb +101 -29
  53. data/lib/compass/sass_extensions/functions/image_size.rb +2 -1
  54. data/lib/compass/sass_extensions/functions/math.rb +13 -1
  55. data/lib/compass/sass_extensions/functions/sprites.rb +82 -22
  56. data/lib/compass/sass_extensions/functions/urls.rb +37 -6
  57. data/lib/compass/sass_extensions/functions/utility.rb +10 -0
  58. data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +11 -9
  59. data/lib/compass/sass_extensions/sprites/image.rb +7 -2
  60. data/lib/compass/sass_extensions/sprites/image_methods.rb +5 -1
  61. data/lib/compass/sass_extensions/sprites/images.rb +29 -0
  62. data/lib/compass/sass_extensions/sprites/layout/diagonal.rb +42 -0
  63. data/lib/compass/sass_extensions/sprites/layout/horizontal.rb +66 -0
  64. data/lib/compass/sass_extensions/sprites/layout/smart.rb +33 -0
  65. data/lib/compass/sass_extensions/sprites/layout/vertical.rb +68 -0
  66. data/lib/compass/sass_extensions/sprites/layout.rb +39 -0
  67. data/lib/compass/sass_extensions/sprites/layout_methods.rb +9 -115
  68. data/lib/compass/sass_extensions/sprites/sprite_map.rb +5 -1
  69. data/lib/compass/sass_extensions/sprites/sprite_methods.rb +8 -14
  70. data/lib/compass/sass_extensions/sprites.rb +2 -0
  71. data/lib/compass/sprite_importer/content.erb +29 -24
  72. data/lib/compass/sprite_importer.rb +7 -11
  73. data/lib/compass/version.rb +10 -13
  74. data/lib/compass/watcher/compiler.rb +59 -0
  75. data/lib/compass/watcher/project_watcher.rb +111 -0
  76. data/lib/compass/watcher/watch.rb +33 -0
  77. data/lib/compass/watcher.rb +11 -0
  78. data/lib/compass.rb +2 -2
  79. data/test/fixtures/sprites/public/images/numeric/200.png +0 -0
  80. data/test/fixtures/stylesheets/busted_font_urls/config.rb +32 -0
  81. data/test/fixtures/stylesheets/busted_font_urls/css/screen.css +7 -0
  82. data/test/fixtures/stylesheets/busted_font_urls/fonts/feed.ttf +0 -0
  83. data/test/fixtures/stylesheets/busted_font_urls/fonts/grid.ttf +0 -0
  84. data/test/fixtures/stylesheets/busted_font_urls/fonts/sub/dk.ttf +0 -0
  85. data/test/fixtures/stylesheets/busted_font_urls/sass/screen.sass +11 -0
  86. data/test/fixtures/stylesheets/busted_font_urls/tmp/screen.css +7 -0
  87. data/test/fixtures/stylesheets/busted_image_urls/tmp/screen.css +9 -0
  88. data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +33 -0
  89. data/test/fixtures/stylesheets/compass/css/animation.css +33 -0
  90. data/test/fixtures/stylesheets/compass/css/background-clip.css +5 -0
  91. data/test/fixtures/stylesheets/compass/css/background-origin.css +15 -0
  92. data/test/fixtures/stylesheets/compass/css/background-size.css +24 -0
  93. data/test/fixtures/stylesheets/compass/css/columns.css +27 -63
  94. data/test/fixtures/stylesheets/compass/css/flexbox.css +121 -0
  95. data/test/fixtures/stylesheets/compass/css/fonts.css +1 -1
  96. data/test/fixtures/stylesheets/compass/css/gradients.css +64 -36
  97. data/test/fixtures/stylesheets/compass/css/grid_background.css +7 -14
  98. data/test/fixtures/stylesheets/compass/css/hyphenation.css +4 -2
  99. data/test/fixtures/stylesheets/compass/css/lists.css +5 -5
  100. data/test/fixtures/stylesheets/compass/css/pie.css +0 -3
  101. data/test/fixtures/stylesheets/compass/css/regions.css +4 -2
  102. data/test/fixtures/stylesheets/compass/css/selection.css +13 -0
  103. data/test/fixtures/stylesheets/compass/css/sprites.css +251 -250
  104. data/test/fixtures/stylesheets/compass/css/text_shadow.css +6 -6
  105. data/test/fixtures/stylesheets/compass/css/transition.css +6 -0
  106. data/test/fixtures/stylesheets/compass/css/units.css +30 -0
  107. data/test/fixtures/stylesheets/compass/css/user-interface.css +22 -1
  108. data/test/fixtures/stylesheets/compass/css/utilities.css +15 -0
  109. data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +177 -8
  110. data/test/fixtures/stylesheets/compass/images/flag-s5b4f509715.png +0 -0
  111. data/test/fixtures/stylesheets/compass/sass/animation-with-legacy-ie.scss +19 -0
  112. data/test/fixtures/stylesheets/compass/sass/animation.scss +13 -0
  113. data/test/fixtures/stylesheets/compass/sass/background-clip.scss +4 -2
  114. data/test/fixtures/stylesheets/compass/sass/background-origin.scss +10 -0
  115. data/test/fixtures/stylesheets/compass/sass/background-size.scss +12 -0
  116. data/test/fixtures/stylesheets/compass/sass/columns.scss +9 -9
  117. data/test/fixtures/stylesheets/compass/sass/flexbox.scss +44 -0
  118. data/test/fixtures/stylesheets/compass/sass/gradients.sass +31 -0
  119. data/test/fixtures/stylesheets/compass/sass/selection.scss +13 -0
  120. data/test/fixtures/stylesheets/compass/sass/transition.scss +1 -1
  121. data/test/fixtures/stylesheets/compass/sass/units.scss +45 -0
  122. data/test/fixtures/stylesheets/compass/sass/user-interface.scss +13 -1
  123. data/test/fixtures/stylesheets/compass/sass/utilities.scss +10 -0
  124. data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +208 -7
  125. data/test/fixtures/stylesheets/envtest/css/env.css +8 -0
  126. data/test/fixtures/stylesheets/envtest/sass/env.scss +16 -0
  127. data/test/fixtures/stylesheets/envtest/tmp/env.css +14 -0
  128. data/test/fixtures/stylesheets/valid/css/simple.css +4 -0
  129. data/test/helpers/diff.rb +1 -1
  130. data/test/integrations/compass_test.rb +23 -14
  131. data/test/integrations/sprites_test.rb +305 -63
  132. data/test/test_helper.rb +5 -15
  133. data/test/units/command_line_test.rb +0 -2
  134. data/test/units/compass_module_test.rb +1 -1
  135. data/test/units/configuration_test.rb +12 -0
  136. data/test/units/regressions_test.rb +8 -8
  137. data/test/units/sass_extensions_test.rb +2 -0
  138. data/test/units/sass_extenstions/gradients_test.rb +33 -0
  139. data/test/units/sprites/image_test.rb +5 -0
  140. data/test/units/sprites/images_test.rb +46 -0
  141. data/test/units/sprites/layout_test.rb +29 -4
  142. data/test/units/watcher/compiler_test.rb +39 -0
  143. data/test/units/watcher/project_watcher_test.rb +73 -0
  144. data/test/units/watcher/watch_test.rb +42 -0
  145. metadata +171 -236
  146. checksums.yaml +0 -7
  147. data/frameworks/blueprint/stylesheets/_blueprint.scss +0 -37
  148. data/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +0 -101
  149. data/frameworks/blueprint/stylesheets/blueprint/_colors.scss +0 -36
  150. data/frameworks/blueprint/stylesheets/blueprint/_debug.scss +0 -28
  151. data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +0 -88
  152. data/frameworks/blueprint/stylesheets/blueprint/_form.scss +0 -66
  153. data/frameworks/blueprint/stylesheets/blueprint/_grid.scss +0 -258
  154. data/frameworks/blueprint/stylesheets/blueprint/_ie.scss +0 -111
  155. data/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +0 -66
  156. data/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +0 -37
  157. data/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +0 -152
  158. data/frameworks/blueprint/stylesheets/blueprint/_print.scss +0 -86
  159. data/frameworks/blueprint/stylesheets/blueprint/_reset.scss +0 -3
  160. data/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +0 -121
  161. data/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +0 -52
  162. data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +0 -90
  163. data/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +0 -37
  164. data/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +0 -83
  165. data/frameworks/blueprint/templates/basic/grid.png +0 -0
  166. data/frameworks/blueprint/templates/basic/ie.sass +0 -4
  167. data/frameworks/blueprint/templates/basic/manifest.rb +0 -30
  168. data/frameworks/blueprint/templates/basic/partials/_base.sass +0 -10
  169. data/frameworks/blueprint/templates/basic/print.sass +0 -4
  170. data/frameworks/blueprint/templates/basic/screen.sass +0 -12
  171. data/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
  172. data/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
  173. data/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
  174. data/frameworks/blueprint/templates/buttons/buttons.sass +0 -49
  175. data/frameworks/blueprint/templates/buttons/manifest.rb +0 -17
  176. data/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
  177. data/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
  178. data/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
  179. data/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
  180. data/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
  181. data/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
  182. data/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
  183. data/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
  184. data/frameworks/blueprint/templates/link_icons/link_icons.sass +0 -13
  185. data/frameworks/blueprint/templates/link_icons/manifest.rb +0 -23
  186. data/frameworks/blueprint/templates/project/grid.png +0 -0
  187. data/frameworks/blueprint/templates/project/ie.sass +0 -16
  188. data/frameworks/blueprint/templates/project/manifest.rb +0 -30
  189. data/frameworks/blueprint/templates/project/partials/_base.sass +0 -11
  190. data/frameworks/blueprint/templates/project/print.sass +0 -8
  191. data/frameworks/blueprint/templates/project/screen.sass +0 -46
  192. data/frameworks/blueprint/templates/semantic/grid.png +0 -0
  193. data/frameworks/blueprint/templates/semantic/ie.sass +0 -16
  194. data/frameworks/blueprint/templates/semantic/manifest.rb +0 -33
  195. data/frameworks/blueprint/templates/semantic/partials/_base.sass +0 -10
  196. data/frameworks/blueprint/templates/semantic/partials/_form.sass +0 -6
  197. data/frameworks/blueprint/templates/semantic/partials/_page.sass +0 -17
  198. data/frameworks/blueprint/templates/semantic/partials/_two_col.sass +0 -38
  199. data/frameworks/blueprint/templates/semantic/print.sass +0 -5
  200. data/frameworks/blueprint/templates/semantic/screen.sass +0 -14
  201. data/lib/compass/commands/generate_grid_background.rb +0 -96
  202. data/lib/compass/grid_builder.rb +0 -102
  203. data/test/fixtures/stylesheets/blueprint/config.rb +0 -14
  204. data/test/fixtures/stylesheets/blueprint/css/ie.css +0 -76
  205. data/test/fixtures/stylesheets/blueprint/css/print.css +0 -56
  206. data/test/fixtures/stylesheets/blueprint/css/screen.css +0 -815
  207. data/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css +0 -56
  208. data/test/fixtures/stylesheets/blueprint/css/single-imports/colors.css +0 -80
  209. data/test/fixtures/stylesheets/blueprint/css/single-imports/debug.css +0 -11
  210. data/test/fixtures/stylesheets/blueprint/css/single-imports/fancy-type.css +0 -30
  211. data/test/fixtures/stylesheets/blueprint/css/single-imports/form.css +0 -42
  212. data/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css +0 -435
  213. data/test/fixtures/stylesheets/blueprint/css/single-imports/ie.css +0 -76
  214. data/test/fixtures/stylesheets/blueprint/css/single-imports/interaction.css +0 -46
  215. data/test/fixtures/stylesheets/blueprint/css/single-imports/link-icons.css +0 -40
  216. data/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css +0 -651
  217. data/test/fixtures/stylesheets/blueprint/css/single-imports/print.css +0 -60
  218. data/test/fixtures/stylesheets/blueprint/css/single-imports/reset-utilities.css +0 -75
  219. data/test/fixtures/stylesheets/blueprint/css/single-imports/reset.css +0 -42
  220. data/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css +0 -437
  221. data/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css +0 -45
  222. data/test/fixtures/stylesheets/blueprint/css/single-imports/typography.css +0 -146
  223. data/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css +0 -35
  224. data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
  225. data/test/fixtures/stylesheets/blueprint/images/link_icons/doc.png +0 -0
  226. data/test/fixtures/stylesheets/blueprint/images/link_icons/email.png +0 -0
  227. data/test/fixtures/stylesheets/blueprint/images/link_icons/external.png +0 -0
  228. data/test/fixtures/stylesheets/blueprint/images/link_icons/feed.png +0 -0
  229. data/test/fixtures/stylesheets/blueprint/images/link_icons/im.png +0 -0
  230. data/test/fixtures/stylesheets/blueprint/images/link_icons/pdf.png +0 -0
  231. data/test/fixtures/stylesheets/blueprint/images/link_icons/visited.png +0 -0
  232. data/test/fixtures/stylesheets/blueprint/images/link_icons/xls.png +0 -0
  233. data/test/fixtures/stylesheets/blueprint/sass/ie.sass +0 -3
  234. data/test/fixtures/stylesheets/blueprint/sass/print.sass +0 -3
  235. data/test/fixtures/stylesheets/blueprint/sass/screen.sass +0 -18
  236. data/test/fixtures/stylesheets/blueprint/sass/single-imports/buttons.scss +0 -4
  237. data/test/fixtures/stylesheets/blueprint/sass/single-imports/colors.scss +0 -34
  238. data/test/fixtures/stylesheets/blueprint/sass/single-imports/debug.scss +0 -3
  239. data/test/fixtures/stylesheets/blueprint/sass/single-imports/fancy-type.scss +0 -3
  240. data/test/fixtures/stylesheets/blueprint/sass/single-imports/form.scss +0 -5
  241. data/test/fixtures/stylesheets/blueprint/sass/single-imports/grid.scss +0 -3
  242. data/test/fixtures/stylesheets/blueprint/sass/single-imports/ie.scss +0 -3
  243. data/test/fixtures/stylesheets/blueprint/sass/single-imports/interaction.scss +0 -3
  244. data/test/fixtures/stylesheets/blueprint/sass/single-imports/link-icons.scss +0 -13
  245. data/test/fixtures/stylesheets/blueprint/sass/single-imports/liquid.scss +0 -3
  246. data/test/fixtures/stylesheets/blueprint/sass/single-imports/print.scss +0 -5
  247. data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset-utilities.scss +0 -5
  248. data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset.scss +0 -1
  249. data/test/fixtures/stylesheets/blueprint/sass/single-imports/rtl.scss +0 -3
  250. data/test/fixtures/stylesheets/blueprint/sass/single-imports/scaffolding.scss +0 -5
  251. data/test/fixtures/stylesheets/blueprint/sass/single-imports/typography.scss +0 -3
  252. data/test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.scss +0 -3
  253. data/test/fixtures/stylesheets/compass/images/flag-s4798b5a210.png +0 -0
  254. data/test/units/compass_png_test.rb +0 -46
@@ -1,38 +0,0 @@
1
- // Page layout can be done using mixins applied to your semantic classes and IDs
2
- // For instance this layout defines a two column layout on pages with
3
- // a body class of "two-col".
4
- //
5
- // The markup would look like:
6
- // <div id="container">
7
- // <div id="header"></div>
8
- // <div id="sidebar"></div>
9
- // <div id="content"></div>
10
- // <div id="footer"></div>
11
- // </div>
12
- //
13
- // and the layout would look like:
14
- // +------------------------+
15
- // | #header |
16
- // +--------+---------------+
17
- // | | |
18
- // |#sidebar| #content |
19
- // | | |
20
- // +------------------------+
21
- // | #footer |
22
- // +--------+---------------+
23
-
24
- body.two-col
25
- #container
26
- +container
27
- #header, #footer
28
- +column($blueprint-grid-columns)
29
- #sidebar
30
- // One third of the grid columns, rounding down. With 24 cols, this is 8.
31
- $sidebar-columns: floor($blueprint-grid-columns / 3)
32
- +column($sidebar-columns)
33
- #content
34
- // Two thirds of the grid columns, rounding up.
35
- // With 24 cols, this is 16.
36
- $content-columns: ceil(2 * $blueprint-grid-columns / 3)
37
- // true means it's the last column in the row
38
- +column($content-columns, true)
@@ -1,5 +0,0 @@
1
- @import blueprint
2
-
3
- //Recommended Blueprint configuration with scoping and semantic layout:
4
- body.bp
5
- +blueprint-print(true)
@@ -1,14 +0,0 @@
1
- // This import applies a global reset to any page that imports this stylesheet.
2
- @import blueprint/reset
3
-
4
- // To configure blueprint, edit the partials/base.sass file.
5
- @import partials/base
6
-
7
- // Import all the default blueprint modules so that we can access their mixins.
8
- @import blueprint
9
-
10
- // Combine the partials into a single screen stylesheet.
11
- @import partials/page
12
- @import partials/form
13
- @import partials/two_col
14
-
@@ -1,96 +0,0 @@
1
- require 'compass/commands/project_base'
2
- require 'compass/commands/update_project'
3
- require 'compass/grid_builder'
4
-
5
- module Compass
6
- module Commands
7
- module GridBackgroundOptionsParser
8
- def set_options(opts)
9
- banner = %Q{Usage: compass grid-img W+GxH [path/to/grid.png]
10
-
11
- Description:
12
- Generates a background image that can be used to check grid alignment.
13
-
14
- Height is optional and defaults to 20px
15
-
16
- By default, the image generated will be named "grid.png"
17
- and be found in the images directory.
18
-
19
- Unless you need to check layouts in legacy browsers, it's preferable
20
- to use the pure CSS3-based grid background mixin:
21
-
22
- http://compass-style.org/reference/compass/layout/grid_background/
23
-
24
- Examples:
25
-
26
- compass grid-img 40+10 # 40px column, 10px gutter, 20px height
27
- compass grid-img 40+20x28 # 40px column, 20px gutter, 28px height
28
- compass grid-img 60+20x28 images/wide_grid.png
29
-
30
- Options:
31
- }
32
- opts.banner = banner
33
-
34
- super
35
- end
36
- end
37
- class GenerateGridBackground < ProjectBase
38
-
39
- include Actions
40
-
41
- register :"grid-img"
42
-
43
- class << self
44
- def option_parser(arguments)
45
- parser = Compass::Exec::CommandOptionParser.new(arguments)
46
- parser.extend(Compass::Exec::GlobalOptionsParser)
47
- parser.extend(GridBackgroundOptionsParser)
48
- end
49
-
50
- def usage
51
- option_parser([]).to_s
52
- end
53
-
54
- def description(command)
55
- "Generates a grid background image."
56
- end
57
-
58
- def parse!(arguments)
59
- parser = option_parser(arguments)
60
- parser.parse!
61
- if arguments.size == 0
62
- raise OptionParser::ParseError, "Please specify the grid dimensions."
63
- end
64
- parser.options[:grid_dimensions] = arguments.shift
65
- parser.options[:grid_filename] = arguments.shift
66
- parser.options
67
- end
68
- end
69
- def initialize(working_path, options)
70
- super
71
- assert_project_directory_exists!
72
- Compass.add_configuration(options, 'command_line')
73
- end
74
-
75
- def perform
76
- unless options[:grid_dimensions] =~ /^(\d+)\+(\d+)(?:x(\d+))?$/
77
- puts "ERROR: '#{options[:grid_dimensions]}' is not valid."
78
- puts "Dimensions should be specified like: 30+10x20"
79
- puts "where 30 is the column width, 10 is the gutter width, and 20 is the (optional) height."
80
- return
81
- end
82
- logger.yellow do
83
- $stderr.puts "Unless you need to check layouts in legacy browsers, it's preferable"
84
- $stderr.puts "to use the pure CSS3-based grid background mixin:"
85
- $stderr.puts
86
- $stderr.puts "http://compass-style.org/reference/compass/layout/grid_background/"
87
- end
88
- column_width = $1.to_i
89
- gutter_width = $2.to_i
90
- height = $3.to_i if $3
91
- filename = options[:grid_filename] || projectize("#{project_images_subdirectory}/grid.png")
92
- GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :height => height, :filename => filename, :working_path => self.working_path)).generate!
93
- end
94
- end
95
- end
96
- end
@@ -1,102 +0,0 @@
1
- require 'zlib'
2
-
3
- module Compass
4
-
5
- # A simple class to represent and create a PNG-File
6
- # No drawing features given
7
- # Just subclass and write [R,G,B]-Byte-Values into the <tt>@data</tt> matrix
8
- # Build for compactness, so not much error checking!
9
- #
10
- # Code based on seattlerb's png, see http://seattlerb.rubyforge.org/png/
11
- class PNG
12
- CRC_TABLE = (0..255).map do |n|
13
- (0...8).inject(n){|x,i| x = ((x & 1) == 1) ? 0xedb88320 ^ (x >> 1) : x >> 1}
14
- end
15
-
16
- class << self
17
- def crc(chunkdata='')
18
- chunkdata.unpack('C*').inject(0xffffffff){|crc, byte| CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8) } ^ 0xffffffff
19
- end
20
-
21
- def chunk(type, data="")
22
- [data.size, type, data, crc(type + data)].pack("Na*a*N")
23
- end
24
- end
25
-
26
- # Initiates a new PNG-Object
27
- # * <tt>width</tt>: Width of the image in pixels
28
- # * <tt>height</tt>: Height of the image in pixels
29
- # * <tt>background</tt>: Background-color represented as [R,G,B]-Byte-Array
30
- def initialize(width, height, background = [255,255,255])
31
- @height = height
32
- @width = width
33
- @data = Array.new(@height) { |x| Array.new(@width, background) }
34
- end
35
-
36
- BITS = 8
37
- RGB = 2 # Color Types ( RGBA = 6)
38
- NONE = 0 # Filter
39
-
40
- # binary representation of the PNG, write to file with binary mode
41
- def to_blob
42
- blob = []
43
- blob << [137, 80, 78, 71, 13, 10, 26, 10].pack("C*")
44
- blob << PNG.chunk('IHDR', [@width, @height, BITS, RGB, NONE, NONE, NONE].pack("N2C5"))
45
- blob << PNG.chunk('IDAT', Zlib::Deflate.deflate(self.png_join))
46
- blob << PNG.chunk('IEND', '')
47
- blob.join
48
- end
49
-
50
- def png_join
51
- @data.map { |row| "\0" + row.map { |p| "%c%c%c" % p}.join }.join
52
- end
53
- end
54
-
55
- class GridBuilder < PNG
56
- include Actions
57
-
58
- attr_reader :column_width, :gutter_width, :filename, :able_to_generate, :options
59
-
60
- # ==== Options
61
- # * <tt>options</tt>
62
- # * <tt>:column_width</tt> -- Width (in pixels) of current grid column
63
- # * <tt>:gutter_width</tt> -- Width (in pixels) of current grid gutter
64
- # * <tt>:height</tt> -- Height (in pixels) of a row
65
- # * <tt>:filename</tt> -- Output path of grid.png file
66
- def initialize(options={})
67
- @column_width = options[:column_width] || 0
68
- gutter_width = options[:gutter_width] || 0
69
-
70
- height = options[:height] || 20
71
- width = @column_width + gutter_width
72
- width = 10 if width == 0
73
-
74
- @filename = options[:filename]
75
- @options = options
76
-
77
- super(width, height, [0xe9,0xe9,0xe9])
78
- end
79
-
80
- def working_path
81
- options[:working_path]
82
- end
83
-
84
- # generates (overwriting if necessary) grid.png image to be tiled in background
85
- def generate!
86
- (0...@height-1).each do |line|
87
- @data[line] = Array.new(@width){|x| x < @column_width ? [0xe8, 0xef, 0xfb] : [0xff,0xff,0xff] }
88
- end
89
-
90
- if File.exists?(filename)
91
- if options[:force]
92
- overwrite = true
93
- else
94
- msg = "#{filename} already exists. Overwrite with --force."
95
- raise Compass::FilesystemConflict.new(msg)
96
- end
97
- end
98
- directory File.dirname(filename)
99
- write_file(filename, self.to_blob, options, true)
100
- end
101
- end
102
- end
@@ -1,14 +0,0 @@
1
- # Require any additional compass plugins here.
2
- project_type = :stand_alone
3
- css_dir = "tmp"
4
- sass_dir = "sass"
5
- images_dir = "images"
6
- output_style = :nested
7
- line_comments = false
8
- # To enable relative image paths using the images_url() function:
9
- # http_images_path = :relative
10
- http_images_path = "/images"
11
-
12
- asset_cache_buster do |path, file|
13
- "busted=true"
14
- end
@@ -1,76 +0,0 @@
1
- body {
2
- text-align: center; }
3
- * html body legend {
4
- margin: 0px -8px 16px 0;
5
- padding: 0; }
6
- html > body p code {
7
- *white-space: normal; }
8
-
9
- .container {
10
- text-align: left; }
11
-
12
- sup {
13
- vertical-align: text-top; }
14
-
15
- sub {
16
- vertical-align: text-bottom; }
17
-
18
- hr {
19
- margin: -8px auto 11px; }
20
-
21
- img {
22
- -ms-interpolation-mode: bicubic; }
23
-
24
- fieldset {
25
- padding-top: 0; }
26
-
27
- legend {
28
- margin-top: -0.2em;
29
- margin-bottom: 1em;
30
- margin-left: -0.5em; }
31
-
32
- fieldset, #IE8#HACK {
33
- padding-top: 1.4em; }
34
-
35
- legend, #IE8#HACK {
36
- margin-top: 0;
37
- margin-bottom: 0; }
38
-
39
- textarea {
40
- overflow: auto; }
41
-
42
- label {
43
- position: relative;
44
- top: -0.25em; }
45
-
46
- input.text {
47
- margin: 0.5em 0;
48
- background-color: white;
49
- border: 1px solid #bbbbbb; }
50
- input.text:focus {
51
- border: 1px solid #666666; }
52
- input.title {
53
- margin: 0.5em 0;
54
- background-color: white;
55
- border: 1px solid #bbbbbb; }
56
- input.title:focus {
57
- border: 1px solid #666666; }
58
- input.checkbox {
59
- position: relative;
60
- top: 0.25em; }
61
- input.radio {
62
- position: relative;
63
- top: 0.25em; }
64
- input.button {
65
- position: relative;
66
- top: 0.25em; }
67
-
68
- textarea {
69
- margin: 0.5em 0; }
70
-
71
- select {
72
- margin: 0.5em 0; }
73
-
74
- button {
75
- position: relative;
76
- top: 0.25em; }
@@ -1,56 +0,0 @@
1
- body {
2
- line-height: 1.5;
3
- font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
4
- color: black;
5
- background: none;
6
- font-size: 10pt; }
7
-
8
- .container {
9
- background: none; }
10
-
11
- hr {
12
- background: #cccccc;
13
- color: #cccccc;
14
- width: 100%;
15
- height: 2px;
16
- margin: 2em 0;
17
- padding: 0;
18
- border: none; }
19
- hr.space {
20
- background: white;
21
- color: white; }
22
-
23
- h1, h2, h3, h4, h5, h6 {
24
- font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; }
25
-
26
- code {
27
- font-size: 0.9em;
28
- font-family: "andale mono", "lucida console", monospace; }
29
-
30
- a img {
31
- border: none; }
32
- a:link, a:visited {
33
- background: transparent;
34
- font-weight: 700;
35
- text-decoration: underline; }
36
-
37
- p img.top {
38
- margin-top: 0; }
39
-
40
- blockquote {
41
- margin: 1.5em;
42
- padding: 1em;
43
- font-style: italic;
44
- font-size: 0.9em; }
45
-
46
- .small {
47
- font-size: 0.9em; }
48
-
49
- .large {
50
- font-size: 1.1em; }
51
-
52
- .quiet {
53
- color: #999999; }
54
-
55
- .hide {
56
- display: none; }