Migrate to stylelint

This commit is contained in:
Mimi 2022-11-18 16:31:43 +08:00
parent 9acfa7e21a
commit 3763e0d588
4 changed files with 32 additions and 56 deletions

20
.stylelintrc Normal file
View File

@ -0,0 +1,20 @@
{
"plugins": [
"stylelint-stylus"
],
"extends": [
"stylelint-stylus/standard"
],
"rules": {
"stylus/semicolon": "always",
"stylus/pythonic": "never",
"stylus/declaration-colon": "always",
"stylus/number-leading-zero": "never",
"stylus/selector-list-comma": "always",
"stylus/selector-list-comma-newline-after": "never-multi-line",
"stylus/media-feature-colon": "always",
"stylus/single-line-comment": false,
"stylus/single-line-comment-no-empty": false,
"stylus/block-closing-brace-newline-after": "never-single-line"
}
}

View File

@ -1,45 +0,0 @@
{
"blocks": false,
"brackets": "always",
"colons": "always",
"colors": "always",
"commaSpace": "always",
"commentSpace": "always",
"cssLiteral": "never",
"customProperties": [],
"depthLimit": false,
"duplicates": true,
"efficient": "always",
"exclude": [],
"extendPref": false,
"globalDupe": false,
"groupOutputByFile": true,
"indentPref": false,
"leadingZero": "never",
"maxErrors": false,
"maxWarnings": false,
"mixed": false,
"mixins": [],
"namingConvention": "lowercase-dash",
"namingConventionStrict": false,
"none": "never",
"noImportant": true,
"parenSpace": false,
"placeholders": "always",
"prefixVarsWithDollar": "always",
"quotePref": false,
"reporterOptions": {
"columns": ["lineData", "severity", "description", "rule"],
"columnSplitter": " ",
"showHeaders": false,
"truncate": true
},
"semicolons": "always",
"sortOrder": "alphabetical",
"stackedProperties": false,
"trailingWhitespace": "never",
"universal": false,
"valid": true,
"zeroUnits": "never",
"zIndexNormalize": false
}

View File

@ -15,7 +15,7 @@
"scripts": { "scripts": {
"eslint": "eslint scripts/ source/js test/", "eslint": "eslint scripts/ source/js test/",
"prepare": "node .githooks/install.js", "prepare": "node .githooks/install.js",
"stylint": "stylint source/css/", "stylint": "stylelint source/css/ --ip source/css/_common/scaffolding/highlight/index.styl",
"test": "mocha test/index.js", "test": "mocha test/index.js",
"test-cov": "c8 npm test" "test-cov": "c8 npm test"
}, },
@ -40,6 +40,7 @@
"hexo-renderer-marked": "6.0.0", "hexo-renderer-marked": "6.0.0",
"js-yaml": "4.1.0", "js-yaml": "4.1.0",
"mocha": "10.1.0", "mocha": "10.1.0",
"stylint": "2.0.0" "stylelint": "14.15.0",
"stylelint-stylus": "0.17.0"
} }
} }

View File

@ -1,39 +1,39 @@
if (hexo-config('disqusjs.enable') and hexo-config('darkmode')) { if (hexo-config('disqusjs.enable') and hexo-config('darkmode')) {
@media (prefers-color-scheme:dark) { @media (prefers-color-scheme:dark) {
html #dsqjs a { html #dsqjs a {
color: var(--link-color) color: var(--link-color);
} }
html #dsqjs a:focus,html #dsqjs a:hover { html #dsqjs a:focus,html #dsqjs a:hover {
color: var(--link-hover-color) color: var(--link-hover-color);
} }
html #dsqjs .dsqjs-nav,html #dsqjs footer { html #dsqjs .dsqjs-nav,html #dsqjs footer {
border-color: var(--card-bg-color) border-color: var(--card-bg-color);
} }
html #dsqjs .dsqjs-load-more,html #dsqjs .dsqjs-load-more:hover,html #dsqjs .dsqjs-nav-tab,html #dsqjs .dsqjs-no-comment,html #dsqjs .dsqjs-post-content { html #dsqjs .dsqjs-load-more,html #dsqjs .dsqjs-load-more:hover,html #dsqjs .dsqjs-nav-tab,html #dsqjs .dsqjs-no-comment,html #dsqjs .dsqjs-post-content {
color: var(--text-color) color: var(--text-color);
} }
html #dsqjs .dsqjs-order-label { html #dsqjs .dsqjs-order-label {
background-color: #3e4b5e background-color: #3e4b5e;
} }
html #dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label { html #dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label {
background-color: var(--content-bg-color) background-color: var(--content-bg-color);
} }
html #dsqjs .dsqjs-tab-active>span:after { html #dsqjs .dsqjs-tab-active>span:after {
background-color: #2e9fff!important background-color: #2e9fff!important;
} }
html #dsqjs .dsqjs-footer,html #dsqjs .dsqjs-meta { html #dsqjs .dsqjs-footer,html #dsqjs .dsqjs-meta {
color: var(--text-color) color: var(--text-color);
} }
html #dsqjs .dsqjs-post-body blockquote { html #dsqjs .dsqjs-post-body blockquote {
border-color: var(--content-bg-color) border-color: var(--content-bg-color);
} }
} }
} }