Browse Source

💄 Enable some stylelint rules

pull/14603/head
afc163 6 years ago
committed by 偏右
parent
commit
0bbc46da37
  1. 12
      .stylelintrc
  2. 72
      site/theme/static/colors.less

12
.stylelintrc

@ -3,20 +3,8 @@
"rules": {
"comment-empty-line-before": null,
"declaration-empty-line-before": null,
"function-comma-newline-after": null,
"function-name-case": null,
"function-parentheses-newline-inside": null,
"function-max-empty-lines": null,
"function-whitespace-after": null,
"indentation": null,
"number-leading-zero": null,
"number-no-trailing-zeros": null,
"rule-empty-line-before": null,
"selector-combinator-space-after": null,
"selector-list-comma-newline-after": null,
"selector-pseudo-element-colon-notation": null,
"unit-no-unknown": null,
"value-list-max-empty-lines": null,
"no-invalid-double-slash-comments": null,
"no-descending-specificity": null
}

72
site/theme/static/colors.less

@ -1,4 +1,23 @@
/* stylelint-disable no-duplicate-selectors */
.make-palette(@color, @index: 1) when (@index <= 10) {
.palette-@{color}-@{index} {
@background: '@{color}-@{index}';
background: @@background;
}
.make-palette(@color, (@index + 1)); // next iteration
}
@grey-1: #fff;
@grey-2: #fafafa;
@grey-3: #f5f5f5;
@grey-4: #e8e8e8;
@grey-5: #d9d9d9;
@grey-6: #bfbfbf;
@grey-7: #8c8c8c;
@grey-8: #595959;
@grey-9: #262626;
@grey-10: #000;
@border-color: rgba(229, 231, 235, 100);
.color-palettes {
margin: 0 1%;
}
@ -31,7 +50,21 @@
}
.main-color {
.make-palette(blue);
.make-palette(purple);
.make-palette(cyan);
.make-palette(green);
.make-palette(magenta);
.make-palette(red);
.make-palette(volcano);
.make-palette(orange);
.make-palette(gold);
.make-palette(yellow);
.make-palette(lime);
.make-palette(geekblue);
.make-palette(grey);
text-align: left;
&-item {
cursor: pointer;
height: 44px;
@ -140,40 +173,3 @@
}
}
}
.make-palette(@color, @index: 1) when (@index <= 10) {
.palette-@{color}-@{index} {
@background: '@{color}-@{index}';
background: @@background;
}
.make-palette(@color, (@index + 1)); // next iteration
}
@grey-1: #fff;
@grey-2: #fafafa;
@grey-3: #f5f5f5;
@grey-4: #e8e8e8;
@grey-5: #d9d9d9;
@grey-6: #bfbfbf;
@grey-7: #8c8c8c;
@grey-8: #595959;
@grey-9: #262626;
@grey-10: #000;
@border-color: rgba(229, 231, 235, 100);
.main-color {
.make-palette(blue);
.make-palette(purple);
.make-palette(cyan);
.make-palette(green);
.make-palette(magenta);
.make-palette(red);
.make-palette(volcano);
.make-palette(orange);
.make-palette(gold);
.make-palette(yellow);
.make-palette(lime);
.make-palette(geekblue);
.make-palette(grey);
}

Loading…
Cancel
Save