You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.mdown
+7-9
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# CSSOM
2
2
3
-
CSSOM.js is a CSS parser written in pure JavaScript. It also a partial implementation of [CSS Object Model](http://dev.w3.org/csswg/cssom/).
3
+
CSSOM.js is a CSS parser written in pure JavaScript. It is also a partial implementation of [CSS Object Model](http://dev.w3.org/csswg/cssom/).
4
4
5
5
CSSOM.parse("body {color: black}")
6
6
-> {
@@ -22,12 +22,11 @@ CSSOM.js is a CSS parser written in pure JavaScript. It also a partial implement
22
22
Works well in Google Chrome 6+, Safari 5+, Firefox 3.6+, Opera 10.63+.
23
23
Doesn't work in IE < 9 because of unsupported getters/setters.
24
24
25
-
To use CSSOM.js in the browser you might want to build a one-file version that exposes CSSOM global variable:
25
+
To use CSSOM.js in the browser you might want to build a one-file version that exposes a single `CSSOM` global variable:
26
26
27
27
➤ git clone https://github.com/NV/CSSOM.git
28
28
➤ cd CSSOM
29
-
➤ npm install -d
30
-
➤ ./node_modules/.bin/jake
29
+
➤ node build.js
31
30
build/CSSOM.js is done
32
31
33
32
To use it with Node.js or any other CommonJS loader:
@@ -36,7 +35,7 @@ To use it with Node.js or any other CommonJS loader:
36
35
37
36
## Don’t use it if...
38
37
39
-
You parse CSS to mungle, minify or reformat the following code:
38
+
You parse CSS to mungle, minify or reformat code like this:
40
39
41
40
```css
42
41
div {
@@ -47,8 +46,7 @@ div {
47
46
48
47
This pattern is often used to give browsers that don’t understand linear gradients a fallback solution (e.g. gray color in the example).
49
48
In CSSOM, `background: gray`[gets overwritten](http://nv.github.io/CSSOM/docs/parse.html#css=div%20%7B%0A%20%20%20%20%20%20background%3A%20gray%3B%0A%20%20%20%20background%3A%20linear-gradient(to%20bottom%2C%20white%200%25%2C%20black%20100%25)%3B%0A%7D).
50
-
The last same-name property always overwrites all the previous ones.
51
-
49
+
It doesn't get preserved.
52
50
53
51
If you do CSS mungling, minification, image inlining, and such, CSSOM.js is no good for you, considere using one of the following:
54
52
@@ -58,9 +56,9 @@ If you do CSS mungling, minification, image inlining, and such, CSSOM.js is no g
0 commit comments