1
1
mirror of https://github.com/primer/css.git synced 2024-12-25 23:23:47 +03:00

Merge pull request #118 from primer/scss-lint-settings-upgrade

Update scss-lint properties for v0.38.0
This commit is contained in:
Mark Otto 2015-06-01 11:30:24 -07:00
commit f4d4a126f1
10 changed files with 148 additions and 100 deletions

View File

@ -134,7 +134,7 @@ By contributing to Primer, you agree to the terms presented in [this license agr
When contributing changes to Primer, be sure to do the following steps when opening a pull request: When contributing changes to Primer, be sure to do the following steps when opening a pull request:
1. Bump the version number in `bower.json` (it's purely placebo right now, but it's good habit) and `package.json`. 1. Bump the version number in `bower.json` (it's purely placebo right now, but it's good habit) and `package.json`.
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. 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.
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. 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.

View File

@ -7,17 +7,17 @@
### css/primer.css ### css/primer.css
- **Total Stylesheets:** 1 - **Total Stylesheets:** 1
- **Total Stylesheet Size:** 27568 - **Total Stylesheet Size:** 27336
- **Total Media Queries:** 1 - **Total Media Queries:** 1
- **Total Rules:** 360 - **Total Rules:** 360
- **Selectors Per Rule:** 1.4861111111111112 - **Selectors Per Rule:** 1.4833333333333334
- **Total Selectors:** 535 - **Total Selectors:** 534
- **Identifiers Per Selector:** 2.1289719626168226 - **Identifiers Per Selector:** 2.1273408239700373
- **Specificity Per Selector:** 16.457943925233646 - **Specificity Per Selector:** 16.46441947565543
- **Top Selector Specificity:** 50 - **Top Selector Specificity:** 50
- **Top Selector Specificity Selector:** .fullscreen-overlay-enabled.dark-theme .tooltipped .tooltipped-s:before - **Top Selector Specificity Selector:** .fullscreen-overlay-enabled.dark-theme .tooltipped .tooltipped-s:before
- **Total Id Selectors:** 0 - **Total Id Selectors:** 0
- **Total Identifiers:** 1139 - **Total Identifiers:** 1136
- **Total Declarations:** 904 - **Total Declarations:** 899
- **Total Unique Colors:** 79 - **Total Unique Colors:** 78
- **Total Important Keywords:** 1 - **Total Important Keywords:** 1

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "primer", "name": "primer",
"version": "2.1.0", "version": "2.2.0",
"homepage": "http://primercss.io", "homepage": "http://primercss.io",
"author": "GitHub, Inc.", "author": "GitHub, Inc.",
"scss": "./scss/primer.scss", "scss": "./scss/primer.scss",

View File

@ -1,9 +1,9 @@
# This is the lint file for .scss files. It uses https://github.com/causes/scss-lint # This is the lint file for .scss files. It uses https://github.com/brigade/scss-lint
# to search through .scss files and point out errors. # to search through .scss files and point out errors.
# You can view these errors in your editor. # You can view these errors in your editor.
# #
# Here's a link to all the default configurations # Here's a link to all the default configurations
# https://github.com/causes/scss-lint/blob/master/config/default.yml # https://github.com/brigade/scss-lint/blob/master/config/default.yml
# below is our settings. # below is our settings.
linters: linters:
@ -11,13 +11,19 @@ linters:
enabled: true enabled: true
space_before_bang: true space_before_bang: true
space_after_bang: false space_after_bang: false
severity: error
BemDepth:
enabled: false
BorderZero: BorderZero:
enabled: true enabled: true
convention: zero # or `none` convention: zero # or `none`
severity: error
ColorKeyword: ColorKeyword:
enabled: true enabled: true
severity: error
ColorVariable: ColorVariable:
enabled: false enabled: false
@ -27,20 +33,24 @@ linters:
DebugStatement: DebugStatement:
enabled: true enabled: true
severity: error
DeclarationOrder: DeclarationOrder:
enabled: true enabled: false
DuplicateProperty: DuplicateProperty:
enabled: true enabled: true
severity: error
ElsePlacement: ElsePlacement:
enabled: true enabled: true
style: same_line # or 'new_line' style: same_line # or 'new_line'
severity: error
EmptyLineBetweenBlocks: EmptyLineBetweenBlocks:
enabled: true enabled: true
ignore_single_line_blocks: true ignore_single_line_blocks: true
severity: error
EmptyRule: EmptyRule:
enabled: false enabled: false
@ -48,54 +58,67 @@ linters:
FinalNewline: FinalNewline:
enabled: true enabled: true
present: true present: true
severity: error
HexLength: HexLength:
enabled: true enabled: true
style: short # or 'long' style: short # or 'long'
severity: error
HexNotation: HexNotation:
enabled: true enabled: true
style: lowercase # or 'uppercase' style: lowercase # or 'uppercase'
severity: error
HexValidation: HexValidation:
enabled: true enabled: true
severity: error
IdSelector: IdSelector:
enabled: true enabled: false
severity: warning
ImportantRule: ImportantRule:
enabled: true enabled: false
severity: error
ImportPath: ImportPath:
enabled: true enabled: true
leading_underscore: false leading_underscore: false
filename_extension: false filename_extension: false
severity: error
Indentation: Indentation:
enabled: true enabled: true
allow_non_nested_indentation: false allow_non_nested_indentation: false
character: space # or 'tab' character: space # or 'tab'
width: 2 width: 2
severity: error
LeadingZero: LeadingZero:
enabled: true enabled: true
style: include_zero style: include_zero
severity: error
MergeableSelector: MergeableSelector:
enabled: true enabled: true
force_nesting: true force_nesting: true
severity: error
NameFormat: NameFormat:
enabled: false enabled: false
convention: hyphenated_lowercase # or 'BEM', or a regex pattern
NestingDepth: NestingDepth:
enabled: false enabled: true
max_depth: 3 max_depth: 5
severity: error
PlaceholderInExtend: PlaceholderInExtend:
enabled: false enabled: false
PropertyCount:
enabled: false
PropertySortOrder: PropertySortOrder:
enabled: false enabled: false
ignore_unspecified: true ignore_unspecified: true
@ -273,82 +296,111 @@ linters:
PropertySpelling: PropertySpelling:
enabled: true enabled: true
severity: error
extra_properties: [] extra_properties: []
PropertyUnits:
enabled: false
severity: error
global: ['em', 'rem', '%'] # Allow relative units globally
properties:
border: ['px'] # Only pixels
line-height: [] # No units allowed
margin: ['em', 'rem']
QualifyingElement: QualifyingElement:
enabled: true enabled: false
allow_element_with_attribute: false allow_element_with_attribute: false
allow_element_with_class: false allow_element_with_class: false
allow_element_with_id: false allow_element_with_id: false
severity: warning
SelectorDepth: SelectorDepth:
enabled: true enabled: true
max_depth: 4 max_depth: 4
severity: error
SelectorFormat: SelectorFormat:
enabled: false enabled: true
convention: hyphenated_lowercase # or 'BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern convention: ^((?!js\-))[a-z1-2\-\_]+
severity: error
Shorthand: Shorthand:
enabled: true enabled: true
severity: error
SingleLinePerProperty: SingleLinePerProperty:
enabled: true enabled: true
allow_single_line_rule_sets: true allow_single_line_rule_sets: true
severity: error
SingleLinePerSelector: SingleLinePerSelector:
enabled: true enabled: true
severity: error
SpaceAfterComma: SpaceAfterComma:
enabled: true enabled: true
severity: error
SpaceAfterPropertyColon: SpaceAfterPropertyColon:
enabled: true enabled: true
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned' style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
severity: error
SpaceAfterPropertyName: SpaceAfterPropertyName:
enabled: true enabled: true
severity: error
SpaceBeforeBrace: SpaceBeforeBrace:
enabled: true enabled: true
style: space # or 'new_line' style: space # or 'new_line'
allow_single_line_padding: true allow_single_line_padding: true
severity: error
SpaceBetweenParens: SpaceBetweenParens:
enabled: true enabled: true
spaces: 0 spaces: 0
severity: error
StringQuotes: StringQuotes:
enabled: true enabled: true
style: double_quotes style: double_quotes
severity: error
TrailingSemicolon: TrailingSemicolon:
enabled: true enabled: true
severity: error
TrailingZero: TrailingZero:
enabled: false enabled: true
severity: error
UnnecessaryMantissa: UnnecessaryMantissa:
enabled: true enabled: true
severity: error
UnnecessaryParentReference: UnnecessaryParentReference:
enabled: true enabled: true
severity: error
UrlFormat: UrlFormat:
enabled: true enabled: true
severity: error
UrlQuotes: UrlQuotes:
enabled: true enabled: true
severity: error
VariableForProperty: VariableForProperty:
enabled: false enabled: false
properties: []
VendorPrefix: VendorPrefix:
enabled: true enabled: true
identifier_list: base identifier_list: base
additional_identifiers: [] additional_identifiers: []
excluded_identifiers: [] excluded_identifiers: []
severity: error
ZeroUnit: ZeroUnit:
enabled: true enabled: true
severity: error

View File

@ -85,7 +85,7 @@
// Green primary button // Green primary button
.btn-primary { .btn-primary {
color: #fff; color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.15); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.15);
background-color: #60b044; background-color: #60b044;
background-image: linear-gradient(#8add6d, #60b044); background-image: linear-gradient(#8add6d, #60b044);
border-color: darken(#60b044, 2%); border-color: darken(#60b044, 2%);
@ -104,7 +104,7 @@
&:active, &:active,
&.selected { &.selected {
text-shadow: 0 1px 0 rgba(0,0,0,0.15); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
background-color: darken(#60b044, 5%); background-color: darken(#60b044, 5%);
background-image: none; background-image: none;
border-color: darken(#4a993e, 5%); border-color: darken(#4a993e, 5%);
@ -348,11 +348,11 @@
&:focus { &:focus {
z-index: 3; z-index: 3;
} }
}
// Tuck buttons into one another to prevent double border // Tuck buttons into one another to prevent double border
.btn + .btn { + .btn {
margin-left: -1px; margin-left: -1px;
}
} }
.btn + .button_to, .btn + .button_to,

View File

@ -51,8 +51,7 @@ input.input-contrast,
} }
// Custom styling for HTML5 validation bubbles (WebKit only) // Custom styling for HTML5 validation bubbles (WebKit only)
::-webkit-input-placeholder, ::placeholder {
:-moz-placeholder {
color: #aaa; color: #aaa;
} }
@ -161,12 +160,11 @@ dl.form {
&.is-error { color: $brand-red; } &.is-error { color: $brand-red; }
&.is-success { color: $brand-green; } &.is-success { color: $brand-green; }
}
h4 + p.note { + p.note {
margin-top: 0; margin-top: 0;
}
} }
} }
// //
@ -180,63 +178,11 @@ dl.form {
content: "*"; content: "*";
} }
} }
}
.note { // Form AJAX states
min-height: 17px; //
margin: 4px 0 2px; // Form fields that need feedback for AJAX loading, success
font-size: 12px; // states and errored states.
color: $brand-gray;
.spinner {
margin-right: 3px;
vertical-align: middle;
}
}
// Checkboxes and Radiobuttons
//
// For checkboxes and radio button selections.
.form-checkbox {
padding-left: 20px;
margin: 15px 0;
vertical-align: middle;
label {
em.highlight {
position: relative;
left: -4px;
padding: 2px 4px;
font-style: normal;
background: #fffbdc;
border-radius: 3px;
}
}
input[type=checkbox],
input[type=radio] {
float: left;
margin: 2px 0 0 -20px;
vertical-align: middle;
}
.note {
display: block;
margin: 0;
font-size: 12px;
font-weight: normal;
color: #666;
}
}
// Form AJAX states
//
// Form fields that need feedback for AJAX loading, success
// states and errored states.
dl.form {
.success, .success,
.error, .error,
.indicator { .indicator {
@ -326,6 +272,55 @@ dl.form {
} }
} }
.note {
min-height: 17px;
margin: 4px 0 2px;
font-size: 12px;
color: $brand-gray;
.spinner {
margin-right: 3px;
vertical-align: middle;
}
}
// Checkboxes and Radiobuttons
//
// For checkboxes and radio button selections.
.form-checkbox {
padding-left: 20px;
margin: 15px 0;
vertical-align: middle;
label {
em.highlight {
position: relative;
left: -4px;
padding: 2px 4px;
font-style: normal;
background: #fffbdc;
border-radius: 3px;
}
}
input[type=checkbox],
input[type=radio] {
float: left;
margin: 2px 0 0 -20px;
vertical-align: middle;
}
.note {
display: block;
margin: 0;
font-size: 12px;
font-weight: normal;
color: #666;
}
}
// Field groups // Field groups
// //
@ -339,10 +334,12 @@ dl.form {
float: left; float: left;
margin: 0 30px 0 0; margin: 0 30px 0 0;
& > dt label { > dt {
display: inline-block; label {
margin: 5px 0 0; display: inline-block;
color: #666; margin: 5px 0 0;
color: #666;
}
img { img {
position: relative; position: relative;

View File

@ -22,6 +22,7 @@
@mixin gradient($start: #fafafa, $end: #eaeaea) { @mixin gradient($start: #fafafa, $end: #eaeaea) {
@warn "Gradient mixin is deprecated."; @warn "Gradient mixin is deprecated.";
// scss-lint:disable VendorPrefix
background-color: $end; background-color: $end;
// FF 3.6+ // FF 3.6+
background-image: -moz-linear-gradient($start, $end); background-image: -moz-linear-gradient($start, $end);

View File

@ -8,8 +8,7 @@
html { html {
font-family: sans-serif; /* 1 */ font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */ text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
} }
/** /**

View File

@ -171,8 +171,7 @@ $tooltip-text-color: #fff;
// are always `$multiline-max-width` wide. // are always `$multiline-max-width` wide.
.tooltipped-multiline { .tooltipped-multiline {
&:after { &:after {
width: -moz-max-content; width: max-content;
width: -webkit-max-content;
max-width: $multiline-max-width; max-width: $multiline-max-width;
word-break: break-word; word-break: break-word;
word-wrap: normal; word-wrap: normal;