Skip to content

Commit f4d4a12

Browse files
committed
Merge pull request #118 from primer/scss-lint-settings-upgrade
Update scss-lint properties for v0.38.0
2 parents dbbd2fa + 0f5ce8a commit f4d4a12

10 files changed

Lines changed: 148 additions & 100 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ By contributing to Primer, you agree to the terms presented in [this license agr
134134
When contributing changes to Primer, be sure to do the following steps when opening a pull request:
135135

136136
1. Bump the version number in `bower.json` (it's purely placebo right now, but it's good habit) and `package.json`.
137-
2. Run `grunt css` and commit the changes. This compiles the SCSS to CSS so we can do basic analysis on the number of selectors, file size, etc.
137+
2. Run `grunt` and commit the changes. This compiles the SCSS to CSS so we can do basic analysis on the number of selectors, file size, etc.
138138

139139
In addition, please read through our [contributing guidelines](https://github.com/primer/primer/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
140140

css/.primer-stats.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
### css/primer.css
88

99
- **Total Stylesheets:** 1
10-
- **Total Stylesheet Size:** 27568
10+
- **Total Stylesheet Size:** 27336
1111
- **Total Media Queries:** 1
1212
- **Total Rules:** 360
13-
- **Selectors Per Rule:** 1.4861111111111112
14-
- **Total Selectors:** 535
15-
- **Identifiers Per Selector:** 2.1289719626168226
16-
- **Specificity Per Selector:** 16.457943925233646
13+
- **Selectors Per Rule:** 1.4833333333333334
14+
- **Total Selectors:** 534
15+
- **Identifiers Per Selector:** 2.1273408239700373
16+
- **Specificity Per Selector:** 16.46441947565543
1717
- **Top Selector Specificity:** 50
1818
- **Top Selector Specificity Selector:** .fullscreen-overlay-enabled.dark-theme .tooltipped .tooltipped-s:before
1919
- **Total Id Selectors:** 0
20-
- **Total Identifiers:** 1139
21-
- **Total Declarations:** 904
22-
- **Total Unique Colors:** 79
20+
- **Total Identifiers:** 1136
21+
- **Total Declarations:** 899
22+
- **Total Unique Colors:** 78
2323
- **Total Important Keywords:** 1

css/primer.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "primer",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"homepage": "http://primercss.io",
55
"author": "GitHub, Inc.",
66
"scss": "./scss/primer.scss",

scss/.scss-lint.yml

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
# This is the lint file for .scss files. It uses https://github.com/causes/scss-lint
1+
# This is the lint file for .scss files. It uses https://github.com/brigade/scss-lint
22
# to search through .scss files and point out errors.
33
# You can view these errors in your editor.
44
#
55
# Here's a link to all the default configurations
6-
# https://github.com/causes/scss-lint/blob/master/config/default.yml
6+
# https://github.com/brigade/scss-lint/blob/master/config/default.yml
77
# below is our settings.
88

99
linters:
1010
BangFormat:
1111
enabled: true
1212
space_before_bang: true
1313
space_after_bang: false
14+
severity: error
15+
16+
BemDepth:
17+
enabled: false
1418

1519
BorderZero:
1620
enabled: true
1721
convention: zero # or `none`
22+
severity: error
1823

1924
ColorKeyword:
2025
enabled: true
26+
severity: error
2127

2228
ColorVariable:
2329
enabled: false
@@ -27,75 +33,92 @@ linters:
2733

2834
DebugStatement:
2935
enabled: true
36+
severity: error
3037

3138
DeclarationOrder:
32-
enabled: true
39+
enabled: false
3340

3441
DuplicateProperty:
3542
enabled: true
43+
severity: error
3644

3745
ElsePlacement:
3846
enabled: true
3947
style: same_line # or 'new_line'
48+
severity: error
4049

4150
EmptyLineBetweenBlocks:
4251
enabled: true
4352
ignore_single_line_blocks: true
53+
severity: error
4454

4555
EmptyRule:
4656
enabled: false
4757

4858
FinalNewline:
4959
enabled: true
5060
present: true
61+
severity: error
5162

5263
HexLength:
5364
enabled: true
5465
style: short # or 'long'
66+
severity: error
5567

5668
HexNotation:
5769
enabled: true
5870
style: lowercase # or 'uppercase'
71+
severity: error
5972

6073
HexValidation:
6174
enabled: true
75+
severity: error
6276

6377
IdSelector:
64-
enabled: true
78+
enabled: false
79+
severity: warning
6580

6681
ImportantRule:
67-
enabled: true
82+
enabled: false
83+
severity: error
6884

6985
ImportPath:
7086
enabled: true
7187
leading_underscore: false
7288
filename_extension: false
89+
severity: error
7390

7491
Indentation:
7592
enabled: true
7693
allow_non_nested_indentation: false
7794
character: space # or 'tab'
7895
width: 2
96+
severity: error
7997

8098
LeadingZero:
8199
enabled: true
82100
style: include_zero
101+
severity: error
83102

84103
MergeableSelector:
85104
enabled: true
86105
force_nesting: true
106+
severity: error
87107

88108
NameFormat:
89109
enabled: false
90-
convention: hyphenated_lowercase # or 'BEM', or a regex pattern
91110

92111
NestingDepth:
93-
enabled: false
94-
max_depth: 3
112+
enabled: true
113+
max_depth: 5
114+
severity: error
95115

96116
PlaceholderInExtend:
97117
enabled: false
98118

119+
PropertyCount:
120+
enabled: false
121+
99122
PropertySortOrder:
100123
enabled: false
101124
ignore_unspecified: true
@@ -273,82 +296,111 @@ linters:
273296

274297
PropertySpelling:
275298
enabled: true
299+
severity: error
276300
extra_properties: []
277301

302+
PropertyUnits:
303+
enabled: false
304+
severity: error
305+
global: ['em', 'rem', '%'] # Allow relative units globally
306+
properties:
307+
border: ['px'] # Only pixels
308+
line-height: [] # No units allowed
309+
margin: ['em', 'rem']
310+
278311
QualifyingElement:
279-
enabled: true
312+
enabled: false
280313
allow_element_with_attribute: false
281314
allow_element_with_class: false
282315
allow_element_with_id: false
316+
severity: warning
283317

284318
SelectorDepth:
285319
enabled: true
286320
max_depth: 4
321+
severity: error
287322

288323
SelectorFormat:
289-
enabled: false
290-
convention: hyphenated_lowercase # or 'BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern
324+
enabled: true
325+
convention: ^((?!js\-))[a-z1-2\-\_]+
326+
severity: error
291327

292328
Shorthand:
293329
enabled: true
330+
severity: error
294331

295332
SingleLinePerProperty:
296333
enabled: true
297334
allow_single_line_rule_sets: true
335+
severity: error
298336

299337
SingleLinePerSelector:
300338
enabled: true
339+
severity: error
301340

302341
SpaceAfterComma:
303342
enabled: true
343+
severity: error
304344

305345
SpaceAfterPropertyColon:
306346
enabled: true
307347
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
348+
severity: error
308349

309350
SpaceAfterPropertyName:
310351
enabled: true
352+
severity: error
311353

312354
SpaceBeforeBrace:
313355
enabled: true
314356
style: space # or 'new_line'
315357
allow_single_line_padding: true
358+
severity: error
316359

317360
SpaceBetweenParens:
318361
enabled: true
319362
spaces: 0
363+
severity: error
320364

321365
StringQuotes:
322366
enabled: true
323367
style: double_quotes
368+
severity: error
324369

325370
TrailingSemicolon:
326371
enabled: true
372+
severity: error
327373

328374
TrailingZero:
329-
enabled: false
375+
enabled: true
376+
severity: error
330377

331378
UnnecessaryMantissa:
332379
enabled: true
380+
severity: error
333381

334382
UnnecessaryParentReference:
335383
enabled: true
384+
severity: error
336385

337386
UrlFormat:
338387
enabled: true
388+
severity: error
339389

340390
UrlQuotes:
341391
enabled: true
392+
severity: error
342393

343394
VariableForProperty:
344395
enabled: false
345-
properties: []
346396

347397
VendorPrefix:
348398
enabled: true
349399
identifier_list: base
350400
additional_identifiers: []
351401
excluded_identifiers: []
402+
severity: error
352403

353404
ZeroUnit:
354405
enabled: true
406+
severity: error

scss/_buttons.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
// Green primary button
8686
.btn-primary {
8787
color: #fff;
88-
text-shadow: 0 -1px 0 rgba(0,0,0,0.15);
88+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.15);
8989
background-color: #60b044;
9090
background-image: linear-gradient(#8add6d, #60b044);
9191
border-color: darken(#60b044, 2%);
@@ -104,7 +104,7 @@
104104

105105
&:active,
106106
&.selected {
107-
text-shadow: 0 1px 0 rgba(0,0,0,0.15);
107+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
108108
background-color: darken(#60b044, 5%);
109109
background-image: none;
110110
border-color: darken(#4a993e, 5%);
@@ -348,11 +348,11 @@
348348
&:focus {
349349
z-index: 3;
350350
}
351-
}
352351

353-
// Tuck buttons into one another to prevent double border
354-
.btn + .btn {
355-
margin-left: -1px;
352+
// Tuck buttons into one another to prevent double border
353+
+ .btn {
354+
margin-left: -1px;
355+
}
356356
}
357357

358358
.btn + .button_to,

0 commit comments

Comments
 (0)