ehrenmurdick-css_writer 0.0.4 → 1.0.0
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.
- data/README +34 -0
- metadata +1 -1
data/README
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
CSS::Writer is for generating CSS from ruby code, similar in appearance to markaby.
|
2
|
+
|
3
|
+
Example:
|
4
|
+
|
5
|
+
require 'css_writer'
|
6
|
+
|
7
|
+
writer = CSS::Writer.new
|
8
|
+
writer.css do
|
9
|
+
body do
|
10
|
+
backgroundColor 'red'
|
11
|
+
end
|
12
|
+
|
13
|
+
div '.class' do
|
14
|
+
fontWeight 'bold'
|
15
|
+
end
|
16
|
+
|
17
|
+
div do
|
18
|
+
input do
|
19
|
+
color '#eee'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
writer.render
|
24
|
+
|
25
|
+
Produces:
|
26
|
+
body {
|
27
|
+
background-color: red;
|
28
|
+
}
|
29
|
+
div.class {
|
30
|
+
font-weight: bold;
|
31
|
+
}
|
32
|
+
div input {
|
33
|
+
color: #eee;
|
34
|
+
}
|