3 Limit the length of a line.
11 Lines that exceed the maximum length but contain no whitespace (other than at the beginning of the line) are ignored.
13 When evaluating the line length, the arguments of any `url(...)` functions are excluded from the calculation, because typically you have no control over the length of these arguments. This means that long `url()` functions should not contribute to violations.
17 `int`: Maximum number of characters allowed.
19 For example, with `20`:
21 The following patterns are considered violations:
24 a { color: 0; top: 0; }
29 background: linear-gradient(red, blue);
33 The following patterns are *not* considered violations:
44 background: url(a-url-that-is-over-20-characters-long);
48 ## Optional secondary options
50 ### `ignore: ["non-comments"]`
52 Only enforce the line-length limit for lines within comments.
54 This does not apply to comments that are stuck in between other stuff, only to lines that begin at the beginning or in the middle of a comment.
56 For example, with a maximum length of `30`.
58 The following patterns are considered violations:
60 Each have only one violation.
63 /* This line is too long for my rule */
64 a { color: pink; background: orange; }
65 a { color: pink; /* this comment is also long but not on its own line */ }
69 a { color: pink; background: orange; }
72 * but this line is too long for my liking,
73 * though this one is fine
75 a { color: pink; /* this comment is also long but not on its own line */ }
78 ### `ignore: ["comments"]`
80 Only enforce the line-length limit for lines that are not comments.
82 This also applies to comments that are between code on the same line.
84 For example, with a maximum length of `30`.
86 The following patterns are considered violations:
89 a { color: pink; } /* comment that is too long */
93 a { /* this comment is too long for the max length */ }
96 The following patterns are *not* considered violations:
99 /* comment that is too long for my rule*/
105 * comment that is too long the max length
106 * comment that is too long the max length
112 ### `ignorePattern: "/regex/"`
114 Ignore any line that matches the given regex pattern, regardless of whether it is comment or not.
122 The following pattern is *not* considered a violation:
125 @import "../../../../another/css/or/scss/file/or/something.css";
128 Given the following, with a maximum length of `20`.
131 ["/https?:\/\/[0-9,a-z]*.*/"]
134 The following pattern is *not* considered a violation:
137 /* ignore urls https://www.example.com */