csswaxer 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +8 -2
  2. data/VERSION +1 -1
  3. data/lib/csswaxer.rb +5 -4
  4. data/lib/example.css +3 -1
  5. metadata +3 -3
data/README.md CHANGED
@@ -16,13 +16,19 @@ Ruby command that prettifies CSS files grouping lines by property rather than by
16
16
  * Accept CSS files with commands split on multiple lines
17
17
  * Accept different media types, not only screen
18
18
  * Contain every possible CSS property
19
+ * Align TABS for each property
20
+ * Also expand shorthand property list-style (css_parser does not)
21
+ * Recreate shorthand formats in the final output
19
22
 
20
23
  ## History ##
21
24
 
22
- v0.0.6 2010/04/32
25
+ v0.0.7 2010/04/03
26
+ Expanded shorthand properties: background, font, margin, padding
27
+
28
+ v0.0.6 2010/04/02
23
29
  Requires CSS Parser > 1.1.0 which includes load_file!
24
30
 
25
- v0.0.5 2010/04/32
31
+ v0.0.5 2010/04/02
26
32
  Fixed a bug; now respects multiple property values for the same selector
27
33
 
28
34
  v0.0.4 2010/03/31
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
data/lib/csswaxer.rb CHANGED
@@ -22,6 +22,7 @@ module CssWaxer
22
22
  properties = {}
23
23
  # First make sure to take the most important property values for each selector
24
24
  parser.each_selector(:screen).each do |ruleset|
25
+ ruleset[:rules].expand_shorthand! # NOTE: list-style is not affected
25
26
  declarations = ruleset[:rules].instance_variable_get(:@declarations)
26
27
  ruleset[:rules].selectors.each do |selector|
27
28
  declarations.each do |property, values|
@@ -59,7 +60,7 @@ module CssWaxer
59
60
  puts titleize(family)
60
61
  properties.each do |property|
61
62
  next unless merged.has_key? property
62
- puts "\n/* #{property} */"
63
+ puts "/* #{property} */"
63
64
  merged[property].each do |values, selectors|
64
65
  important = " !important" if values[1]
65
66
  puts "#{selectors.join(", ")}\t{#{property}: #{values[0]}#{important}}"
@@ -71,7 +72,7 @@ module CssWaxer
71
72
  unless merged.empty?
72
73
  puts titleize("Unrecognized properties")
73
74
  merged.each do |property, values_and_selectors|
74
- puts "\n/* #{property} */"
75
+ puts "/* #{property} */"
75
76
  values_and_selectors.each do |values, selectors|
76
77
  important = " !important" if values[1]
77
78
  puts "#{selectors.join(", ")}\t{#{property}: #{values[0]}#{important}}"
@@ -90,7 +91,7 @@ module CssWaxer
90
91
  def css_families
91
92
  # Based on the list from http://www.eskimo.com/~bloo/indexdot/css/
92
93
  [
93
- ['Typography', %w{font-family font-size font-style font-variant font-weight font font-size-adjust font-stretch}],
94
+ ['Typography', %w{font-family font-size font-style font-variant font-weight font font-size-adjust font-stretch line-height}],
94
95
  ['Text', %w{word-spacing letter-spacing white-space word-wrap text-align text-align-last text-decoration text-transform text-shadow text-indent text-underline-position}],
95
96
  ['Colors', %w{color background-color layer-background-color border-top-color border-right-color border-bottom-color border-left-color border-color scrollbar-face-color scrollbar-arrow-color scrollbar-base-color scrollbar-shadow-color scrollbar-darkshadow-color scrollbar-highlight-color scrollbar-3dlight-color scrollbar-track-color outline-color}],
96
97
  ['Backgrounds', %w{layer-background-image background-image background-repeat background-attachment background-position background-position-x background-position-y background}],
@@ -98,7 +99,7 @@ module CssWaxer
98
99
  ['Lists', %w{marker-offset list-style-type list-style-position list-style-image list-style}],
99
100
  ['Tables', %w{border-collapse border-spacing caption-side empty-cells speak-header table-layout}],
100
101
  ['Layout', %w{display visibility position float clear}],
101
- ['Sizes', %w{width min-width max-width line-height height min-height max-height}],
102
+ ['Sizes', %w{width min-width max-width height min-height max-height}],
102
103
  ['Positions', %w{top right bottom left vertical-align overflow overflow-x overflow-y text-overflow clip z-index}],
103
104
  ['Margins', %w{margin-top margin-right margin-bottom margin-left margin}],
104
105
  ['Paddings', %w{padding-top padding-right padding-bottom padding-left padding}],
data/lib/example.css CHANGED
@@ -1,4 +1,6 @@
1
1
  a {line-height:12px; font-size: 12px;}
2
2
  b,c {font-size:40px;}
3
- b {font-size:12px;}
3
+ b {font-size:12px; font-weight: bold;}
4
4
  c, d {line-height: 12px}
5
+ e {font-weight: bold; font-variant: small-caps;}
6
+ f {font: italic normal bold 1em/1.5em Arial, sans-serif;}
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Claudio Baccigalupo
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-02 00:00:00 +02:00
17
+ date: 2010-04-03 00:00:00 +02:00
18
18
  default_executable: csswaxer
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency