automatthew-casuistry 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +2 -1
- data/README.rdoc +36 -12
- data/casuistry.gemspec +4 -4
- data/lib/casuistry.rb +111 -122
- data/lib/properties.rb +115 -112
- data/lib/tags.rb +1 -1
- data/test/basics.rb +8 -7
- data/test/dan.cssy +160 -0
- data/test/fiddle.css +25 -0
- data/test/fiddle.cssy +10 -9
- metadata +3 -2
- data/test/experiment.cssy +0 -19
data/Manifest
CHANGED
data/README.rdoc
CHANGED
@@ -1,21 +1,45 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
= Casuistry, a.k.a Cssy
|
2
|
+
|
3
|
+
Cssy is a CSS companion to Markaby. You declare selectors using methods named after the type selectors (i.e. tags) or after the class and id selectors of your choice, which are handled by method_missing. As in Markaby, id selectors are distinguished from class selectors by the "!" at the end of the method name. You can chain class/id selectors onto type selectors and each other.
|
4
|
+
|
5
|
+
Because in CSS you don't have to begin with a type selector, starting a selector chain with a class/id selector is currently allowed in Casuistry. This may go away in the future.
|
6
|
+
|
7
|
+
== Usage
|
8
|
+
|
9
|
+
|
10
|
+
css = Cssy.new
|
11
|
+
css.process do
|
12
|
+
div do
|
13
|
+
|
14
|
+
# this is a property on div
|
15
|
+
background :red
|
16
|
+
|
17
|
+
selector('ul li') do
|
18
|
+
color('green')
|
19
|
+
end
|
20
|
+
|
21
|
+
p.ugly.truly do
|
22
|
+
color('aqua')
|
10
23
|
end
|
11
|
-
|
24
|
+
|
25
|
+
selector('.smurf').house do
|
12
26
|
height('256px')
|
13
27
|
end
|
14
|
-
|
28
|
+
|
29
|
+
menu! do
|
15
30
|
padding("10px")
|
16
31
|
end
|
32
|
+
|
33
|
+
# this is a property on div, again
|
34
|
+
width('9934px')
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
gargamel do
|
39
|
+
margin("0px")
|
17
40
|
end
|
18
|
-
|
41
|
+
|
42
|
+
selector('.outer.middle.inner') do
|
19
43
|
top("34px")
|
20
44
|
end
|
21
45
|
end
|
data/casuistry.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Casuistry-0.2.
|
2
|
+
# Gem::Specification for Casuistry-0.2.1
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{casuistry}
|
7
|
-
s.version = "0.2.
|
7
|
+
s.version = "0.2.1"
|
8
8
|
|
9
9
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
10
|
s.authors = ["Matthew King"]
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.description = %q{Generates CSS using Ruby, like Markaby}
|
13
13
|
s.email = %q{automatthew@gmail.com}
|
14
14
|
s.extra_rdoc_files = ["lib/casuistry.rb", "lib/properties.rb", "lib/tags.rb", "README.rdoc"]
|
15
|
-
s.files = ["casuistry.gemspec", "lib/casuistry.rb", "lib/properties.rb", "lib/tags.rb", "Manifest", "README.rdoc", "test/basics.rb", "test/dan.css", "test/
|
15
|
+
s.files = ["casuistry.gemspec", "lib/casuistry.rb", "lib/properties.rb", "lib/tags.rb", "Manifest", "README.rdoc", "test/basics.rb", "test/dan.css", "test/dan.cssy", "test/fiddle.css", "test/fiddle.cssy", "test/helper.rb", "test/nesting.cssy", "test/test.css", "test/test.cssy"]
|
16
16
|
s.has_rdoc = true
|
17
17
|
s.homepage = %q{}
|
18
18
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Casuistry", "--main", "README.rdoc"]
|
@@ -40,7 +40,7 @@ end
|
|
40
40
|
# require dep
|
41
41
|
# end
|
42
42
|
#
|
43
|
-
# Version = '0.2.
|
43
|
+
# Version = '0.2.1'
|
44
44
|
#
|
45
45
|
# task :default => [:test]
|
46
46
|
#
|
data/lib/casuistry.rb
CHANGED
@@ -3,165 +3,154 @@ require 'tags'
|
|
3
3
|
|
4
4
|
# Markaby-ish way to declare CSS
|
5
5
|
class Casuistry
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
attr_reader :data, :assigns
|
6
|
+
|
7
|
+
attr_reader :data
|
10
8
|
|
11
9
|
def self.process(*args,&block)
|
12
10
|
self.new.process(*args,&block)
|
13
11
|
end
|
14
12
|
|
15
|
-
def initialize(
|
16
|
-
@selector = selector
|
13
|
+
def initialize(sel=nil)
|
17
14
|
@data = []
|
15
|
+
@selectors = [ sel]
|
16
|
+
@properties = []
|
18
17
|
|
18
|
+
# possible states are :closed_block, :chain, :open_block
|
19
|
+
@state = :closed_block
|
19
20
|
end
|
20
21
|
|
21
22
|
def process(*args, &block)
|
22
23
|
if block
|
23
|
-
|
24
|
+
instance_eval(&block)
|
24
25
|
else
|
25
|
-
|
26
|
+
instance_eval(args.join("\n"))
|
26
27
|
end
|
27
28
|
@data
|
28
29
|
end
|
29
30
|
|
30
31
|
def output
|
31
32
|
output = ""
|
32
|
-
@data.each do |
|
33
|
-
output <<
|
34
|
-
properties =
|
33
|
+
@data.each do |sel|
|
34
|
+
output << sel.first
|
35
|
+
properties = sel.last.map { |s| " #{s}" }.join("\n")
|
35
36
|
output << "\n{\n#{properties}\n}\n"
|
36
37
|
end
|
37
38
|
output
|
38
39
|
end
|
39
40
|
|
40
|
-
|
41
|
+
# state transitions
|
42
|
+
def open_block(new_selector)
|
43
|
+
case @state
|
44
|
+
when :closed_block, :open_block
|
45
|
+
combined_selector = [current_selector, new_selector].compact.join(" ")
|
46
|
+
@selectors.push combined_selector
|
47
|
+
new_property_set
|
48
|
+
when :chain
|
49
|
+
@selectors[-1] = "#{current_selector}#{new_selector}"
|
50
|
+
new_property_set
|
51
|
+
else
|
52
|
+
raise "You can't get to :open_block from #{@state.inspect}"
|
53
|
+
end
|
54
|
+
|
55
|
+
@state = :open_block
|
56
|
+
end
|
41
57
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
def open_block(new_selector)
|
55
|
-
case @state
|
56
|
-
when :closed_block, :open_block
|
57
|
-
combined_selector = [current_selector, new_selector].compact.join(" ")
|
58
|
-
@selectors.push combined_selector
|
59
|
-
open_properties
|
60
|
-
when :chaining
|
61
|
-
# puts current_selector, new_selector
|
62
|
-
@selectors[-1] = "#{current_selector}#{new_selector}"
|
63
|
-
open_properties
|
64
|
-
else
|
65
|
-
raise "You can't get to :open_block from #{@state.inspect}"
|
58
|
+
def chain(new_selector)
|
59
|
+
case @state
|
60
|
+
when :closed_block, :open_block
|
61
|
+
combined_selector = [current_selector, new_selector].compact.join(" ")
|
62
|
+
@selectors.push( combined_selector)
|
63
|
+
when :chain
|
64
|
+
@selectors[-1] = "#{current_selector}#{new_selector}"
|
65
|
+
else
|
66
|
+
raise "You can't get to :chain from #{@state.inspect}"
|
67
|
+
end
|
68
|
+
|
69
|
+
@state = :chain
|
66
70
|
end
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
raise "You can't get to :chaining from #{@state.inspect}"
|
71
|
+
|
72
|
+
def closed_block
|
73
|
+
case @state
|
74
|
+
when :open_block, :closed_block
|
75
|
+
@selectors.pop
|
76
|
+
@properties.pop
|
77
|
+
else
|
78
|
+
raise "You can't get to :closed_block from #{@state.inspect}"
|
79
|
+
end
|
80
|
+
|
81
|
+
@state = :closed_block
|
79
82
|
end
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
83
|
+
|
84
|
+
|
85
|
+
# normal methods
|
86
|
+
|
87
|
+
def selector(sel)
|
88
|
+
if block_given?
|
89
|
+
open_block(sel)
|
90
|
+
yield
|
91
|
+
closed_block
|
92
|
+
else
|
93
|
+
chain(sel)
|
94
|
+
end
|
95
|
+
self
|
90
96
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
else
|
103
|
-
chaining(sel)
|
97
|
+
|
98
|
+
def method_missing(name, &block)
|
99
|
+
sel = selectify(name)
|
100
|
+
if block_given?
|
101
|
+
open_block(sel)
|
102
|
+
yield
|
103
|
+
closed_block
|
104
|
+
else
|
105
|
+
chain(sel)
|
106
|
+
end
|
107
|
+
self
|
104
108
|
end
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
def method_missing(name, &block)
|
109
|
-
sel = selectify(name)
|
110
|
-
if block_given?
|
111
|
-
open_block(sel)
|
112
|
-
yield
|
113
|
-
closed_block
|
114
|
-
else
|
115
|
-
chaining(sel)
|
109
|
+
|
110
|
+
def current_selector
|
111
|
+
@selectors[-1]
|
116
112
|
end
|
117
|
-
self
|
118
|
-
end
|
119
113
|
|
120
|
-
|
121
|
-
@
|
122
|
-
|
123
|
-
|
124
|
-
def current_properties
|
125
|
-
@properties[-1]
|
126
|
-
end
|
127
|
-
|
128
|
-
def open_properties
|
129
|
-
@properties.push []
|
130
|
-
@casuist.data << [current_selector, current_properties ]
|
131
|
-
end
|
114
|
+
def current_properties
|
115
|
+
@properties[-1]
|
116
|
+
end
|
132
117
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
def #{tag}(&block)
|
137
|
-
selector_eval('#{tag}', &block)
|
118
|
+
def new_property_set
|
119
|
+
@properties.push []
|
120
|
+
@data << [current_selector, current_properties ]
|
138
121
|
end
|
139
|
-
METHOD
|
140
|
-
end.join
|
141
122
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
123
|
+
# define tag methods to delegate to selector
|
124
|
+
methods = HTML_TAGS.map do |tag|
|
125
|
+
<<-METHOD
|
126
|
+
def #{tag}(&block)
|
127
|
+
selector('#{tag}', &block)
|
128
|
+
end
|
129
|
+
METHOD
|
130
|
+
end.join
|
131
|
+
|
132
|
+
module_eval methods
|
133
|
+
|
134
|
+
CSS_PROPERTIES.each do |method_name|
|
135
|
+
define_method method_name do |*args|
|
136
|
+
css_attr = method_name.gsub('_', '-')
|
137
|
+
property(css_attr, args)
|
138
|
+
end
|
148
139
|
end
|
149
|
-
end
|
150
|
-
|
151
140
|
|
152
|
-
|
153
|
-
def property(css_attr, *args)
|
154
|
-
current_properties << "#{css_attr}: #{args.join(' ')};"
|
155
|
-
end
|
156
|
-
|
157
141
|
|
158
|
-
|
159
|
-
|
160
|
-
def selectify(method_name)
|
161
|
-
matches = method_name.to_s.match( /([\w_]+)!$/)
|
162
|
-
matches ? "##{matches[1]}" : ".#{method_name}"
|
163
|
-
end
|
164
142
|
|
143
|
+
def property(css_attr, *args)
|
144
|
+
current_properties << "#{css_attr}: #{args.join(' ')};"
|
145
|
+
end
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
def selectify(method_name)
|
151
|
+
matches = method_name.to_s.match( /([\w_]+)!$/)
|
152
|
+
matches ? "##{matches[1]}" : ".#{method_name}"
|
153
|
+
end
|
165
154
|
|
166
155
|
end
|
167
156
|
|
data/lib/properties.rb
CHANGED
@@ -1,112 +1,115 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
1
|
+
class Casuistry
|
2
|
+
CSS_PROPERTIES = %w{
|
3
|
+
azimuth
|
4
|
+
background
|
5
|
+
background_attachment
|
6
|
+
background_color
|
7
|
+
background_image
|
8
|
+
background_position
|
9
|
+
background_repeat
|
10
|
+
border
|
11
|
+
border_collapse
|
12
|
+
border_color
|
13
|
+
border_spacing
|
14
|
+
border_style
|
15
|
+
border_top
|
16
|
+
border_top_color
|
17
|
+
border_top_style
|
18
|
+
border_top_width
|
19
|
+
border_width
|
20
|
+
bottom
|
21
|
+
caption_side
|
22
|
+
clear
|
23
|
+
clip
|
24
|
+
color
|
25
|
+
content
|
26
|
+
counter_increment
|
27
|
+
counter_reset
|
28
|
+
cue
|
29
|
+
cue_after
|
30
|
+
cue_before
|
31
|
+
cursor
|
32
|
+
direction
|
33
|
+
display
|
34
|
+
elevation
|
35
|
+
empty_cells
|
36
|
+
float
|
37
|
+
font
|
38
|
+
font_family
|
39
|
+
font_size
|
40
|
+
font_size_adjust
|
41
|
+
font_stretch
|
42
|
+
font_style
|
43
|
+
font_variant
|
44
|
+
font_weight
|
45
|
+
height
|
46
|
+
left
|
47
|
+
letter_spacing
|
48
|
+
line_height
|
49
|
+
list_style
|
50
|
+
list_style_image
|
51
|
+
list_style_position
|
52
|
+
list_style_type
|
53
|
+
margin
|
54
|
+
margin_left
|
55
|
+
margin_top
|
56
|
+
margin_right
|
57
|
+
margin_bottom
|
58
|
+
marker_offset
|
59
|
+
marks
|
60
|
+
max_height
|
61
|
+
max_width
|
62
|
+
min_height
|
63
|
+
min_width
|
64
|
+
orphans
|
65
|
+
outline
|
66
|
+
outline_color
|
67
|
+
outline_style
|
68
|
+
outline_width
|
69
|
+
overflow
|
70
|
+
padding
|
71
|
+
padding_left
|
72
|
+
padding_top
|
73
|
+
padding_right
|
74
|
+
padding_bottom
|
75
|
+
page
|
76
|
+
page_break_after
|
77
|
+
page_break_before
|
78
|
+
page_break_inside
|
79
|
+
pause
|
80
|
+
pause_after
|
81
|
+
pause_before
|
82
|
+
pitch
|
83
|
+
pitch_range
|
84
|
+
play_during
|
85
|
+
position
|
86
|
+
quotes
|
87
|
+
richness
|
88
|
+
right
|
89
|
+
size
|
90
|
+
speak
|
91
|
+
speak_header
|
92
|
+
speak_numeral
|
93
|
+
speak_punctuation
|
94
|
+
speech_rate
|
95
|
+
stress
|
96
|
+
table_layout
|
97
|
+
text_align
|
98
|
+
text_decoration
|
99
|
+
text_indent
|
100
|
+
text_shadow
|
101
|
+
text_transform
|
102
|
+
top
|
103
|
+
unicode_bidi
|
104
|
+
vertical_align
|
105
|
+
visibility
|
106
|
+
voice_family
|
107
|
+
volume
|
108
|
+
white_space
|
109
|
+
widows
|
110
|
+
width
|
111
|
+
word_spacing
|
112
|
+
z_index
|
113
|
+
}
|
114
|
+
|
115
|
+
end
|
data/lib/tags.rb
CHANGED
data/test/basics.rb
CHANGED
@@ -88,16 +88,17 @@ describe "Casuistry" do
|
|
88
88
|
|
89
89
|
it "processes strings" do
|
90
90
|
fiddle = [
|
91
|
-
["
|
92
|
-
["ul li", ["color: green;"]],
|
93
|
-
["
|
94
|
-
["
|
95
|
-
["
|
91
|
+
["div", ["background: red;", "width: 9934px;"]],
|
92
|
+
["div ul li", ["color: green;"]],
|
93
|
+
["div p.ugly.truly", ["color: aqua;"]],
|
94
|
+
["div .smurf.house", ["height: 256px;"]],
|
95
|
+
["div #menu", ["padding: 10px;"]],
|
96
96
|
[".gargamel", ["margin: 0px;"]],
|
97
97
|
[".outer.middle.inner", ["top: 34px;"]]
|
98
98
|
]
|
99
|
-
c = Cssy.
|
100
|
-
c.
|
99
|
+
c = Cssy.new
|
100
|
+
c.process(File.read( "#{here}/fiddle.cssy"))
|
101
|
+
c.data.should == fiddle
|
101
102
|
# c.output.should == File.read( "#{here}/fiddle.css")
|
102
103
|
end
|
103
104
|
|
data/test/dan.cssy
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
# within a class
|
2
|
+
|
3
|
+
class Widget
|
4
|
+
|
5
|
+
# need this to get stylesheet methods
|
6
|
+
include Casuistry
|
7
|
+
|
8
|
+
# add in Grid Layout support
|
9
|
+
include Casuistry::Grid
|
10
|
+
|
11
|
+
# changes default units to 10 x 10 pixel blocks
|
12
|
+
grid :columns => { :width => 10, :height => 10 }, :units => 'px'
|
13
|
+
|
14
|
+
# define some reusable stuff
|
15
|
+
def block ; display :block ; margin 0 ; padding 0 ; end
|
16
|
+
def wrap ; clear :both ; end
|
17
|
+
def left ; float :left ; end
|
18
|
+
def dark ; color :gray ; end
|
19
|
+
def style light ; color :silver ; end
|
20
|
+
def large ; font :size => '13px' ; end
|
21
|
+
def small ; font :size => '11px' ; end
|
22
|
+
|
23
|
+
# generate a "CSS reset" and include some other stylesheets
|
24
|
+
reset ; include Main ; include Products
|
25
|
+
|
26
|
+
intro_text! / a.back do
|
27
|
+
padding :top => 0, :left => 0, :bottom => 2, :right => 2
|
28
|
+
font :weight => :bold ; background :url => '/images/icons-back.gif', :repeat => false
|
29
|
+
end
|
30
|
+
|
31
|
+
img.title { padding :bottom => 1 }
|
32
|
+
|
33
|
+
div.wizard do
|
34
|
+
|
35
|
+
left ; margin :right => 1
|
36
|
+
|
37
|
+
ul.steps do
|
38
|
+
|
39
|
+
block
|
40
|
+
|
41
|
+
li.step do
|
42
|
+
block ; display false;
|
43
|
+
width 40 ; height 33.5
|
44
|
+
margin :left => '2px' ; padding 1.5
|
45
|
+
border '1px solid silver'
|
46
|
+
|
47
|
+
add '.selected' { display :block }
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
div.tab-selector span do
|
54
|
+
dark ; small ; centered ; block ; left
|
55
|
+
height 2.5 ; width 13 ; padding '12px 8px 0 8px' ; cursor :pointer
|
56
|
+
background :url => '/images/tab/unselected.gif', :repeat => :x
|
57
|
+
self & selected do
|
58
|
+
font :weight => :bold ; color :black
|
59
|
+
background :url => '/images/tab/selected.gif', :repeat => :x
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
form do
|
64
|
+
|
65
|
+
ul.properties do
|
66
|
+
|
67
|
+
block
|
68
|
+
|
69
|
+
li.property do
|
70
|
+
|
71
|
+
block ; padding :bottom => 4
|
72
|
+
|
73
|
+
label do
|
74
|
+
block ; left ; dark ; large
|
75
|
+
width 8 ; text_align :right
|
76
|
+
padding :right => 2 ; font :weight => :bold
|
77
|
+
end
|
78
|
+
|
79
|
+
div.value { left ; dark }
|
80
|
+
|
81
|
+
div.radio.value | div.checkbox.value do
|
82
|
+
div.option do
|
83
|
+
large ; padding :left => 2 ; height 2 ; cursor :pointer
|
84
|
+
background :url => '/images/bt_radio_off.gif', :repeat => false
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
div.text.value do
|
89
|
+
|
90
|
+
small ; dark ; margin :top => '-4px'
|
91
|
+
|
92
|
+
input do
|
93
|
+
height 2 ; width 22 ; border false; background :url => '/images/textfield_bg.gif', :repeat => false
|
94
|
+
padding 0.5 ; font :weight => :bold
|
95
|
+
end
|
96
|
+
|
97
|
+
textarea { width 28 ; height 18 }
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
li.size.property do
|
104
|
+
|
105
|
+
div.option do
|
106
|
+
background :url => '/images/bt_radio_off.gif', :repeat => false
|
107
|
+
padding :left => 2 ; height 2 ; large
|
108
|
+
|
109
|
+
self & selected do
|
110
|
+
background :url => '/images/bt_radio_on.gif', :repeat => false
|
111
|
+
padding :left => 2 ; height 2 ; large
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
|
118
|
+
li.style.property do
|
119
|
+
|
120
|
+
div.option do
|
121
|
+
left ; border '1px solid silver' ; padding '1px' ; margin-left 0.5 ; opacity 0.5
|
122
|
+
end
|
123
|
+
|
124
|
+
div.option.hover | div.option.selected { border '1px solid gray' }
|
125
|
+
|
126
|
+
div.option.selected { opacity 1.0 }
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
li.tos.property / div.option
|
131
|
+
background :url => '/images/checkbox.gif', :repeat => false ; padding :left => 2
|
132
|
+
end
|
133
|
+
|
134
|
+
li.code.property { display false }
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
div.preview do
|
143
|
+
|
144
|
+
left ; height 40
|
145
|
+
|
146
|
+
iframe do
|
147
|
+
block ; height 34 ; width 49 ; position :relative
|
148
|
+
margin 0.5 ; padding :top => 3, :left => 0
|
149
|
+
border '1px solid silver'
|
150
|
+
end
|
151
|
+
|
152
|
+
div.ac_results do
|
153
|
+
padding 0.5 ; margin :top => 1
|
154
|
+
border '1px solid silver' ; text_align :left ; dark
|
155
|
+
background :color => :white ;
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|
data/test/fiddle.css
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
ul
|
2
|
+
{
|
3
|
+
background: red;
|
4
|
+
width: 134px;
|
5
|
+
}
|
6
|
+
ul li .ugly
|
7
|
+
{
|
8
|
+
color: green;
|
9
|
+
}
|
10
|
+
ul .smurf .house
|
11
|
+
{
|
12
|
+
height: 256px;
|
13
|
+
}
|
14
|
+
ul #asrael
|
15
|
+
{
|
16
|
+
padding: 10px;
|
17
|
+
}
|
18
|
+
.gargamel
|
19
|
+
{
|
20
|
+
margin: 0px;
|
21
|
+
}
|
22
|
+
.outer .middle .inner
|
23
|
+
{
|
24
|
+
top: 34px;
|
25
|
+
}
|
data/test/fiddle.cssy
CHANGED
@@ -1,26 +1,27 @@
|
|
1
|
-
# favorite = 'green'
|
2
1
|
|
3
|
-
|
2
|
+
div do
|
4
3
|
|
5
|
-
|
4
|
+
# this is a property on div
|
5
|
+
background :red
|
6
6
|
|
7
|
-
li do
|
7
|
+
selector('ul li') do
|
8
8
|
color('green')
|
9
9
|
end
|
10
10
|
|
11
|
-
p.ugly do
|
11
|
+
p.ugly.truly do
|
12
12
|
color('aqua')
|
13
13
|
end
|
14
14
|
|
15
|
-
smurf.house do
|
15
|
+
selector('.smurf').house do
|
16
16
|
height('256px')
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
menu! do
|
20
20
|
padding("10px")
|
21
21
|
end
|
22
22
|
|
23
|
-
#
|
23
|
+
# this is a property on div, again
|
24
|
+
width('9934px')
|
24
25
|
|
25
26
|
end
|
26
27
|
|
@@ -28,6 +29,6 @@ gargamel do
|
|
28
29
|
margin("0px")
|
29
30
|
end
|
30
31
|
|
31
|
-
outer.middle.inner do
|
32
|
+
selector('.outer.middle.inner') do
|
32
33
|
top("34px")
|
33
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: automatthew-casuistry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew King
|
@@ -33,7 +33,8 @@ files:
|
|
33
33
|
- README.rdoc
|
34
34
|
- test/basics.rb
|
35
35
|
- test/dan.css
|
36
|
-
- test/
|
36
|
+
- test/dan.cssy
|
37
|
+
- test/fiddle.css
|
37
38
|
- test/fiddle.cssy
|
38
39
|
- test/helper.rb
|
39
40
|
- test/nesting.cssy
|
data/test/experiment.cssy
DELETED