new lint rules with property order

This commit is contained in:
Koen Lageveen 2020-01-10 22:01:07 +01:00
parent 608fc321ab
commit adb1d3b45a
2 changed files with 340 additions and 275 deletions

View File

@ -1,56 +1,123 @@
{ {
"rules": { "plugins": [
"at-rule-semicolon-newline-after": "always", "stylelint-order"
"at-rule-semicolon-space-before": "never", ],
"block-closing-brace-empty-line-before": "never", "rules": {
"block-closing-brace-newline-after": "always", "at-rule-semicolon-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line", "at-rule-semicolon-space-before": "never",
"block-closing-brace-space-before": "always-single-line", "block-closing-brace-empty-line-before": "never",
"block-no-empty": true, "block-closing-brace-newline-after": "always",
"color-hex-case": "lower", "block-closing-brace-newline-before": "always-multi-line",
"color-hex-length": "short", "block-closing-brace-space-before": "always-single-line",
"color-named": "never", "block-no-empty": true,
"color-no-invalid-hex": true, "color-hex-case": ["upper", { "severity": "warning" }],
"comment-no-empty": true, "color-hex-length": ["short", { "severity": "warning" }],
"font-family-name-quotes": "always-unless-keyword", "color-named": "never",
"font-family-no-duplicate-names": true, "color-no-invalid-hex": true,
"font-family-no-missing-generic-family-keyword": true, "comment-no-empty": true,
"function-calc-no-unspaced-operator": true, "font-family-name-quotes": "always-unless-keyword",
"indentation": "tab", "font-family-no-duplicate-names": true,
"length-zero-no-unit": true, "font-family-no-missing-generic-family-keyword": true,
"linebreaks": "unix", "function-calc-no-unspaced-operator": true,
"media-feature-colon-space-after": "always", "indentation": [4, { "severity": "warning" }],
"media-feature-colon-space-before": "never", "length-zero-no-unit": [true, { "severity": "warning" }],
"media-feature-name-no-unknown": true, "linebreaks": "unix",
"no-duplicate-at-import-rules": true, "media-feature-colon-space-after": "always",
"no-duplicate-selectors": true, "media-feature-colon-space-before": "never",
"no-empty-source": true, "media-feature-name-no-unknown": true,
"no-extra-semicolons": true, "no-duplicate-at-import-rules": true,
"no-invalid-double-slash-comments": true, "no-duplicate-selectors": true,
"no-missing-end-of-source-newline": true, "no-empty-source": true,
"number-no-trailing-zeros": true, "no-extra-semicolons": true,
"property-case": "lower", "no-invalid-double-slash-comments": true,
"property-no-unknown": true, "no-missing-end-of-source-newline": true,
"selector-attribute-brackets-space-inside": "never", "number-no-trailing-zeros": true,
"selector-attribute-operator-space-after": "never", "property-case": "lower",
"selector-attribute-operator-space-before": "never", "property-no-unknown": true,
"selector-attribute-quotes": "always", "selector-attribute-brackets-space-inside": "never",
"selector-combinator-space-after": "always", "selector-attribute-operator-space-after": "never",
"selector-combinator-space-before": "always", "selector-attribute-operator-space-before": "never",
"selector-descendant-combinator-no-non-space": true, "selector-attribute-quotes": "always",
"selector-list-comma-newline-after": "always", "selector-combinator-space-after": "always",
"selector-list-comma-space-before": "never", "selector-combinator-space-before": "always",
"selector-pseudo-class-case": "lower", "selector-descendant-combinator-no-non-space": true,
"selector-pseudo-class-no-unknown": true, "selector-list-comma-newline-after": "always",
"selector-pseudo-class-parentheses-space-inside": "never", "selector-list-comma-space-before": "never",
"selector-pseudo-element-case": "lower", "selector-pseudo-class-case": "lower",
"selector-pseudo-element-no-unknown": true, "selector-pseudo-class-no-unknown": true,
"selector-type-case": "lower", "selector-pseudo-class-parentheses-space-inside": "never",
"selector-type-no-unknown": true, "selector-pseudo-element-case": "lower",
"string-no-newline": true, "selector-pseudo-element-no-unknown": true,
"string-quotes": "double", "selector-type-case": "lower",
"unit-case": "lower", "selector-type-no-unknown": true,
"unit-no-unknown": true, "string-no-newline": true,
"value-keyword-case": "lower" "string-quotes": "single",
} "unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": "lower",
"order/properties-order": [
"content",
"list-style",
"display",
"flex-direction",
"align-items",
"justify-content",
"grid-column-gap",
"grid-row-gap",
"grid-row-gap",
"grid-template-columns",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"float",
"position",
"clear",
"top",
"right",
"bottom",
"left",
"z-index",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left",
"border",
"border-top",
"border-right",
"border-bottom",
"border-left",
"border-radius",
"font-family",
"font-weight",
"font-size",
"font-style",
"line-height",
"text-transform",
"text-decoration",
"letter-spacing",
"hyphens",
"background",
"background-color",
"background-image",
"background-repeat",
"background-position",
"background-size",
"color",
"text-shadow",
"box-shadow",
"transform",
"will-change",
"animation",
"transition"
]
}
} }

440
index.css
View File

@ -1,380 +1,378 @@
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
html { html {
height: 100%; height: 100%;
min-height: 100%; min-height: 100%;
background: #f5f0e6; font-family: -apple-system, BlinkMacSystemFont,
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
"Segoe UI", "Roboto", "Oxygen", 'Ubuntu', 'Cantarell', 'Fira Sans',
"Ubuntu", "Cantarell", "Fira Sans", 'Droid Sans', 'Helvetica Neue', sans-serif;
"Droid Sans", "Helvetica Neue", sans-serif; font-weight: 300;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
font-weight: 300; background: #F5F0E6;
} }
body { body {
color: #2a2a2a; height: 100%;
background: #f5f5f5; min-height: 100%;
height: 100%; background: #F5F5F5;
min-height: 100%; color: #2A2A2A;
} }
h1 { h1 {
font-weight: 700; margin: 0;
font-size: 14px; padding: .25em 0 0 0;
margin: 0; font-weight: 700;
padding: .25em 0 0 0; font-size: 14px;
} }
p { p {
padding: 0; padding: 0;
} }
a, a,
a:link, a:link,
a:visited, a:visited,
a:hover, a:hover,
a:active { a:active {
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;
} }
.no-smooth { .no-smooth {
-webkit-font-smoothing: none; -webkit-font-smoothing: none;
} }
.octicon { .octicon {
fill: currentColor; fill: currentColor;
} }
.article-wrapper { .article-wrapper {
float: left; width: 28em;
border-right: 1px solid #4a4a4a; height: 100%;
height: 100%; max-height: 100%;
max-height: 100%; float: left;
width: 28em; position: relative;
overflow: hidden; z-index: 2;
position: relative; border-right: 1px solid #4A4A4A;
z-index: 2; overflow: hidden;
} }
article { article {
height: 100%; display: flex;
display: flex; flex-direction: column;
flex-direction: column; width: 100%;
width: 100%; height: 100%;
} }
section { section {
flex: 0; flex: 0;
flex-shrink: 0; flex-shrink: 0;
} }
section#filters, section#filters,
section.config { section.config {
font-size: 10px; display: grid;
background: #eee; grid-column-gap: 5px;
padding: 10px; grid-row-gap: 5px;
display: grid; grid-row-gap: 5px;
grid-column-gap: 5px; grid-template-columns: auto auto auto auto;
grid-row-gap: 5px; padding: 10px;
grid-row-gap: 5px; font-size: 10px;
grid-template-columns: auto auto auto auto; background: #EEE;
} }
section#filters { section#filters {
grid-template-columns: auto auto auto auto auto; align-items: stretch;
align-items: stretch; grid-template-columns: auto auto auto auto auto;
} }
section#filters input, section#filters input,
section#filters select { section#filters select {
width: 100%; width: 100%;
margin: 0; margin: 0;
} }
section.config > * { section.config > * {
text-align: center; text-align: center;
padding: 0; padding: 0;
white-space: nowrap; white-space: nowrap;
} }
section.select-list { section.select-list {
flex: 1; flex: 1;
overflow: auto; overflow: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
section.select-list:focus { section.select-list:focus {
outline: none; outline: none;
} }
section.select-list > * { section.select-list > * {
overflow: hidden; overflow: hidden;
} }
section.select-list .entry { section.select-list .entry {
position: relative; display: flex;
display: flex; position: relative;
padding: .5em 1em; padding: .5em 1em;
border-top: 1px solid #eee; border-top: 1px solid #EEE;
} }
section.select-list .entry:last-child { section.select-list .entry:last-child {
border-bottom: 1px solid #eee; border-bottom: 1px solid #EEE;
} }
section.select-list .entry:hover { section.select-list .entry:hover {
background: #fff; background: #FFF;
} }
section.select-list .entry > a { section.select-list .entry > a {
display: block; display: block;
flex: 1; flex: 1;
} }
section.select-list .entry.filtered-out { section.select-list .entry.filtered-out {
display: none; display: none;
} }
section.select-list a[data-value] { section.select-list a[data-value] {
display: block; display: block;
position: relative; width: 66.67%;
overflow: hidden; position: relative;
width: 66.67%; overflow: hidden;
} }
section.select-list a:hover .name, section.select-list a:hover .name,
section.select-list a:active .name { section.select-list a:active .name {
text-decoration: underline; text-decoration: underline;
} }
section.select-list .active .name { section.select-list .active .name {
font-weight: bold; font-weight: bold;
} }
section.select-list a.favoritelink { section.select-list a.favoritelink {
margin-right: .25em; position: absolute;
color: #f5f5f5; top: .5rem;
position: absolute; right: 1rem;
top: .5rem; margin-right: .25em;
right: 1rem; color: #F5F5F5;
cursor: pointer; cursor: pointer;
} }
section.select-list a.favoritelink:hover { section.select-list a.favoritelink:hover {
color: currentColor; color: currentColor;
} }
section.select-list a.website { section.select-list a.website {
position: absolute; position: absolute;
bottom: .5rem; right: 1rem;
right: 1rem; bottom: .5rem;
transition: all .2s ease-in-out; padding: 0 .5rem;
font-size: 10px; font-size: 10px;
padding: 0 .5rem; color: #F5F5F5;
color: #f5f5f5; transition: all .2s ease-in-out;
} }
section.select-list a.website svg { section.select-list a.website svg {
position: relative; position: relative;
top: 2px; top: 2px;
} }
section.select-list a.website span { section.select-list a.website span {
display: inline-block; display: inline-block;
padding-right: 1ex; padding-right: 1ex;
} }
section.select-list .entry:hover a.website, section.select-list .entry:hover a.website,
section.select-list .entry:hover a.favoritelink { section.select-list .entry:hover a.favoritelink {
color: #ccc; color: #CCC;
} }
section.select-list .entry .active a.website, section.select-list .entry .active a.website,
section.select-list .entry a.website:hover, section.select-list .entry a.website:hover,
section.select-list .entry a.website:active { section.select-list .entry a.website:active {
background: #e4e4e4; background: #E4E4E4;
color: #777; color: #777;
} }
section.select-list a.website:active { section.select-list a.website:active {
margin-top: 1px; margin-top: 1px;
} }
section.select-list .pinned + .entry:not(.pinned) { section.select-list .pinned + .entry:not(.pinned) {
border-top-color: #ccc; border-top-color: #CCC;
} }
section.select-list .pinned a.favoritelink, section.select-list .pinned a.favoritelink,
section.select-list .pinned.entry:hover a.favoritelink { section.select-list .pinned.entry:hover a.favoritelink {
color: #777; color: #777;
} }
section.select-list .details { section.select-list .details {
color: #777; display: block;
font-style: italic; width: 60%;
display: block; font-size: 10px;
font-size: 10px; font-style: italic;
text-indent: 2em; text-indent: 2em;
display: block; text-overflow: ellipsis;
width: 60%; white-space: nowrap;
white-space: nowrap; overflow: hidden;
overflow: hidden; color: #777;
text-overflow: ellipsis;
} }
footer { footer {
padding: 5px 10px; padding: 5px 10px;
font-size: 10px; font-size: 10px;
text-align: center; text-align: center;
background: #e4e4e4; line-height: 20px;
color: #777; background: #E4E4E4;
line-height: 20px; color: #777;
} }
footer h1 + p { footer h1 + p {
font-style: italic; font-style: italic;
} }
footer a:hover, footer a:hover,
footer a:active { footer a:active {
color: #2a2a2a; text-decoration: underline;
text-decoration: underline; color: #2A2A2A;
} }
footer p a, footer p a,
footer p a:link, footer p a:link,
footer p a:visited { footer p a:visited {
text-decoration: underline; text-decoration: underline;
} }
label { label {
margin-right: .5ex; margin-right: .5ex;
font-style: italic; font-style: italic;
color: #777; color: #777;
} }
fieldset { fieldset {
all: unset; all: unset;
display: flex; display: flex;
} }
button { button {
all: unset; all: unset;
position: relative; display: flex;
display: flex; align-items: center;
justify-content: center; justify-content: center;
align-items: center; width: 20px;
width: 20px; height: 18px;
height: 18px; position: relative;
margin: 0; margin: 0;
border: 1px solid #e4e4e4; border: 1px solid #E4E4E4;
border-bottom-color: #ccc; border-bottom-color: #CCC;
border-right-color: #ccc; border-right-color: #CCC;
border-radius: 4px; border-radius: 4px;
color: #777; background: linear-gradient(#FFF, #E4E4E4);
color: #777;
background: linear-gradient(#fff, #e4e4e4); cursor: pointer;
cursor: pointer;
} }
button:active { button:active {
box-shadow: none; box-shadow: none;
} }
button.selected { button.selected {
background: #fff; background: #FFF;
border-color: #e4e4e4; border-color: #E4E4E4;
color: #2a2a2a; color: #2A2A2A;
} }
button path, button path,
button rect { button rect {
fill: currentColor; fill: currentColor;
} }
.toggle { .toggle {
display: flex; display: flex;
} }
.toggle button:first-child { .toggle button:first-child {
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-right-color: #e4e4e4; border-right-color: #E4E4E4;
} }
.toggle button:not(:first-child) { .toggle button:not(:first-child) {
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
select { select {
all: unset; all: unset;
width: 9em; width: 9em;
padding: 0 .5ex; padding: 0 .5ex;
border: 1px solid #e4e4e4; border: 1px solid #E4E4E4;
border-radius: 4px; border-radius: 4px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
cursor: pointer; cursor: pointer;
} }
select option { select option {
background: #fff; background: #FFF;
color: #000; color: #000;
} }
input[type="text"] { input[type='text'] {
line-height: 12px; line-height: 12px;
} }
input[type="text"], input[type='text'],
input[type="number"] { input[type='number'] {
all: unset; all: unset;
width: 4em; width: 4em;
margin-left: .5ex; margin-left: .5ex;
padding: 0 .5ex; padding: 0 .5ex;
border: 1px solid #e4e4e4; border: 1px solid #E4E4E4;
border-radius: 4px; border-radius: 4px;
text-align: left; text-align: left;
transition: all .2s ease-in-out; transition: all .2s ease-in-out;
} }
input[type="text"]:hover, input[type='text']:hover,
input[type="text"]:focus, input[type='text']:focus,
input[type="number"]:hover, input[type='number']:hover,
input[type="number"]:focus, input[type='number']:focus,
select:hover, select:hover,
select:focus { select:focus {
border-color: #ccc; border-color: #CCC;
background: #f5f5f5; background: #F5F5F5;
} }
pre, pre,
textarea, textarea,
.CodeMirror { .CodeMirror {
font-family: "Input Mono", monospace; height: auto;
height: auto; font-family: 'Input Mono', monospace;
} }
form { form {
height: 100%; height: 100%;
min-height: 100%; min-height: 100%;
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.nav-button { .nav-button {
all: unset; all: unset;
font-family: inherit; font-family: inherit;
cursor: pointer; cursor: pointer;
} }
label + .nav-button { label + .nav-button {
margin-left: .5ex; margin-left: .5ex;
} }
label[for="select-language"], label[for='select-language'],
label[for="select-theme"] { label[for='select-theme'] {
display: none; display: none;
} }
.CodeMirror { .CodeMirror {
border: none; height: 100%;
font-size: 100%; min-height: 100%;
background: transparent; border: none;
box-shadow: none !important; font-size: 100%;
height: 100%; background: transparent;
min-height: 100%; box-shadow: none !important;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
} }
.CodeMirror .cm-atom { .CodeMirror .cm-atom {
font-style: italic; font-style: italic;
} }
.CodeMirror-gutters { .CodeMirror-gutters {
background: transparent; background: transparent;
} }
.CodeMirror-scroll { .CodeMirror-scroll {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
footer .logo { footer .logo {
display: inline-block; display: inline-block;
margin-left: 1ex; margin-left: 1ex;
} }
footer .logo svg path { footer .logo svg path {
fill: currentColor; fill: currentColor;
} }
@media screen and (max-width: 56em) { @media screen and (max-width: 56em) {
.article-wrapper, .article-wrapper,
form { form {
width: 100%; width: 100%;
height: 50vh; height: 50vh;
min-height: 50vh; min-height: 50vh;
float: none; float: none;
} }
} }
@media screen and (max-width: 56em) and (max-height: 36em) { @media screen and (max-width: 56em) and (max-height: 36em) {
section.select-list a.website { section.select-list a.website {
top: 0; top: 0;
} }
section.select-list .entry { section.select-list .entry {
padding: 0 1em; padding: 0 1em;
} }
footer p:first-of-type, footer p:first-of-type,
footer p:first-of-type + p { footer p:first-of-type + p {
display: none; display: none;
} }
} }