Skip to content

Commit bf9f5b0

Browse files
committed
Merge branch 'master' into text-indent
2 parents 93541ff + cde76af commit bf9f5b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+65134
-5549
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
csslint.pnproj
2-
build/

CHANGELOG

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Next (not yet released)
2+
3+
* Rhino and Node CLIs both exit with code 1 when there are errors (pull #72)
4+
* Changed description of adjoining classes to be unsupported in IE6 (fixes #11)
5+
* Made license comment important in build files (fixes #46)
6+
* Code cleanup (pull #70)
7+
* Cleanup of whitespace (pull #74)
8+
9+
June 18, 2011 - v0.2.0
10+
11+
* Make sure headings are counted correctly (fixes #25)
12+
* Make sure float: none doesn't count as a float for rules that care (fixes #10)
13+
* Fix erroneous missing standard border warning (fixes #7)
14+
* Ensure width: 100% is okay when box-sizing is specified (fixes #5)
15+
* Fixed up width/height properties for box model rule (fixes #8)
16+
* Incorporated Rhino CLI and updated contributors list
17+
* Include build file in Git repo so people can grab directly (fixes #59)
18+
* Added rule for tracking using of !important from shinuza (fixes #50)
19+
20+
June 15, 2011 - v0.1.0
21+
22+
* Initial release

LICENSE

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
CSSLint
2-
Copyright (c) 2011 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
3-
4-
Permission is hereby granted, free of charge, to any person obtaining a copy
5-
of this software and associated documentation files (the "Software"), to deal
6-
in the Software without restriction, including without limitation the rights
7-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8-
copies of the Software, and to permit persons to whom the Software is
9-
furnished to do so, subject to the following conditions:
10-
11-
The above copyright notice and this permission notice shall be included in
12-
all copies or substantial portions of the Software.
13-
14-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20-
THE SOFTWARE.
1+
CSSLint
2+
Copyright (c) 2011 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
THE SOFTWARE.

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ By default, CSSLint shows any parsing errors. Parsing errors usually mean you mi
1212

1313
### Don't use adjoining classes
1414

15-
Adjoining classes look like `.foo.bar`. While technically allowed in CSS, these aren't handled properly by Internet Explorer 7 and earlier.
15+
Adjoining classes look like `.foo.bar`. While technically allowed in CSS, these aren't handled properly by Internet Explorer 6 and earlier.
1616

1717
### Remove empty rules
1818

@@ -36,6 +36,10 @@ Even though you can define any group of properties together in a CSS rule, some
3636

3737
Removed the ignored or problematic properties decreases file size and improves performance.
3838

39+
### Avoid using to many !important declarations
40+
41+
Using `!important` overides any cascaded rule and may lead to specificity war. CSSLint checks if you've used `!important`, and if so, displays a warning. If there's at least 10 `!important` declaration in your code CSSLint displays an error.
42+
3943
### Don't use too many floats
4044

4145
Using `float` for layout isn't a great idea, but sometimes you have to. CSSLint simply checks to see if you've used `float` more than 10 times, and if so, displays a warning. Using this many floats usually means you need some sort of abstraction to achieve the layout.
@@ -70,4 +74,43 @@ Heading elements (`h1`-`h6`) should have exactly one rule on a site. CSSLint war
7074

7175
### Be careful using width: 100%
7276

73-
Using `width: 100%` on an element whose parent element has padding will result in the child stretching outside of the parent's bounding box. It's generally not a good idea to use `width: 100%`. Instead, use `width: auto` or `display: block`.
77+
Using `width: 100%` on an element whose parent element has padding will result in the child stretching outside of the parent's bounding box. It's generally not a good idea to use `width: 100%`. Instead, use `width: auto` or `display: block`.
78+
79+
### Zero values don't need units
80+
81+
An easy way to save bytes in CSS is not include units when a value is 0. For instance, `0px` and `0` are the exact same measurement, so leave off the units and save!
82+
83+
### Vendor prefixed properties should also have the standard
84+
85+
When using vendor-prefixed properties such as `-moz-border-radius`, make sure to also include the standard property. The standard property should preferably come after the vendor-prefixed one, such as:
86+
87+
```css
88+
.foo {
89+
-moz-border-radius: 5px;
90+
border-radius: 5px;
91+
}
92+
```
93+
94+
### CSS gradients require all browser prefixes
95+
96+
Right now, there is no standard CSS gradient implementation, which means using CSS gradients in a cross-browser way requires using many different vendor-prefixed versions. CSSLint warns when a rule with a CSS gradient doesn't have gradients for all supporting browsers.
97+
98+
### Avoid selectors that look like regular expressions
99+
100+
CSS3 adds complex attribute selectors such as `~=` that are slow. When using attribute selectors, don't use the complex equality operators to avoid performance penalties.
101+
102+
### Beware of broken box models
103+
104+
Borders and padding add space outside of an element's content. Setting `width` or `height` along with borders and padding is usually a mistake because you won't get the visual result you're looking for. CSSLint warns when a rule uses `width` or `height` in addition to padding and/or border.
105+
106+
## Contributors
107+
108+
### Creators
109+
110+
1. Nicole Sullivan, http://www.stubbornella.org
111+
1. Nicholas C. Zakas, http://www.nczonline.net
112+
113+
### Contributors
114+
115+
1. Samori Gorse, https://twitter.com/shinuza (Rules, Non-zero Exit Code for CLI)
116+
1. Eitan Konigsburg, https://twitter.com/eitanmk (Rhino CLI)

build.xml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- the directories containing the source files -->
44
<property name="src.dir" value="./src" />
55
<property name="npm.dir" value="./npm" />
6+
<property name="tests.dir" value="./tests" />
67

78
<!-- the directories and files to output to -->
89
<property name="build.dir" value="./build" />
@@ -15,6 +16,7 @@
1516
<property name="core.build.file" value="csslint.js"/>
1617
<property name="node.build.file" value="csslint-node.js"/>
1718
<property name="worker.build.file" value="csslint-worker.js"/>
19+
<property name="tests.build.file" value="csslint-tests.js"/>
1820
<property name="rhino.build.file" value="csslint-rhino.js"/>
1921

2022
<loadfile property="license.text" srcfile="LICENSE" />
@@ -27,7 +29,7 @@
2729
<!-- build the core library -->
2830
<target name="build.core">
2931
<concat destfile="${build.dir}/${core.build.file}" fixlastline="true">
30-
<header trimleading="yes">/*
32+
<header trimleading="yes">/*!
3133
${license.text}
3234
*/
3335
var CSSLint = (function(){
@@ -47,7 +49,7 @@
4749
<!-- build the web worker library -->
4850
<target name="build.worker">
4951
<concat destfile="${build.dir}/${worker.build.file}" fixlastline="true">
50-
<header trimleading="yes">/*
52+
<header trimleading="yes">/*!
5153
${license.text}
5254
*/
5355
</header>
@@ -64,7 +66,7 @@
6466
<target name="build.node">
6567

6668
<concat destfile="${build.dir}/${node.build.file}" fixlastline="true">
67-
<header trimleading="yes">/*
69+
<header trimleading="yes">/*!
6870
${license.text}
6971
*/
7072
</header>
@@ -85,7 +87,25 @@
8587

8688
</target>
8789

90+
<!-- build the tests into a single file -->
91+
<target name="build.tests">
92+
<concat destfile="${build.dir}/${tests.build.file}" fixlastline="true">
93+
<fileset dir="${tests.dir}/rules" includes="*.js" />
94+
</concat>
95+
</target>
96+
97+
98+
<!-- build for rhino CLI integration -->
99+
<target name="build.rhino" depends="build.core">
100+
<concat destfile="${build.dir}/${rhino.build.file}" fixlastline="true">
101+
<filelist dir="${build.dir}" files="${core.build.file}" />
102+
<filelist dir="${src.dir}/rhino" files="cli.js" />
103+
</concat>
104+
</target>
105+
106+
107+
88108
<!-- Build all files -->
89-
<target name="all" depends="clean,build.core,build.worker,build.node"/>
109+
<target name="all" depends="clean,build.core,build.worker,build.node,build.tests,build.rhino"/>
90110

91111
</project>

0 commit comments

Comments
 (0)