Skip to content

Commit

Permalink
feat: 修改stylelint规则
Browse files Browse the repository at this point in the history
  • Loading branch information
panyushan-jade committed Apr 24, 2022
1 parent bbc106b commit 9bc70d8
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 97 deletions.
3 changes: 3 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ module.exports = {
// "dollar-variable-empty-line-before": null,
// "max-empty-lines": 100,
// "dollar-variable-empty-line-before": false,
"scss/no-global-function-names": null,
"function-no-unknown": null,
"scss/double-slash-comment-whitespace-inside": null,
},
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@types/sass": "^1.43.1",
"classnames": "^2.3.1",
"husky": "^7.0.4",
"postcss": "^8.4.12",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.0",
Expand Down
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

112 changes: 57 additions & 55 deletions src/components/Button/_style.scss
Original file line number Diff line number Diff line change
@@ -1,66 +1,68 @@
.dui-btn{
position: relative;
display: inline-block;
font-weight: $font-weight-normal;
white-space: nowrap; // 不换行
text-align: center;
vertical-align: middle;
cursor: pointer;
border: $btn-border-width solid $border-color;
// border-radius: $btn-border-radius;
// font-size: $btn-font-size;
// padding: $btn-padding-y $btn-padding-x;
@include button-size($btn-padding-y,$btn-padding-x,$btn-font-size,$btn-border-radius);
user-select: none;
transition: $btn-transition;
box-shadow: $btn-box-shadow;
&[disabled]{
cursor: not-allowed;
box-shadow:none;
> *{
pointer-events: none
}
.dui-btn {
position: relative;
display: inline-block;
font-weight: $font-weight-normal;
white-space: nowrap; // 不换行
text-align: center;
vertical-align: middle;
cursor: pointer;
border: $btn-border-width solid $border-color;

@include button-size($btn-padding-y,$btn-padding-x,$btn-font-size,$btn-border-radius);

user-select: none;
transition: $btn-transition;
box-shadow: $btn-box-shadow;

&[disabled] {
cursor: not-allowed;
box-shadow: none;

> * {
pointer-events: none;
}
}
}

.dui-btn-large{
@include button-size($btn-padding-y-lg,$btn-padding-x-lg,$btn-font-size-lg,$btn-border-radius-lg);
}
.dui-btn-small{
@include button-size($btn-padding-y-sm,$btn-padding-x-sm,$btn-font-size-sm,$btn-border-radius-sm);
.dui-btn-large {
@include button-size($btn-padding-y-lg,$btn-padding-x-lg,$btn-font-size-lg,$btn-border-radius-lg);
}

.dui-btn-default{
@include button-style($white, $gray-400, $body-color, $white, $primary, $primary)
.dui-btn-small {
@include button-size($btn-padding-y-sm,$btn-padding-x-sm,$btn-font-size-sm,$btn-border-radius-sm);
}

.dui-btn-primary{
@include button-style($primary, $primary, $white)
}
.dui-btn-default {
@include button-style($white, $gray-400, $body-color, $white, $primary, $primary); }

.dui-btn-danger{
@include button-style($danger,$danger,$white)
}
.dui-btn-primary {
@include button-style($primary, $primary, $white); }

.dui-btn-danger {
@include button-style($danger,$danger,$white); }

.dui-btn-link{
font-weight: $font-weight-normal;
color: $btn-link-color;
.dui-btn-link {
font-weight: $font-weight-normal;
color: $btn-link-color;
text-decoration: none;
box-shadow: none;
border: none;

&:hover {
color: $btn-link-hover-color;
text-decoration: none;
}

&:focus,
&.focus {
text-decoration: none;
box-shadow: none;
border: none;
&:hover {
color: $btn-link-hover-color;
text-decoration: none;
}
&:focus,
&.focus {
text-decoration: none;
box-shadow: none;
}
&:disabled,
&.dui-btn-disabled {
color: darken($btn-link-disabled-color, $amount: 2%);
pointer-events: none;
cursor: none;
}
}
}

&:disabled,
&.dui-btn-disabled {
color: darken($btn-link-disabled-color, $amount: 2%);
pointer-events: none;
cursor: none;
}
}
20 changes: 17 additions & 3 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Oxygen,
Ubuntu,
Cantarell,
"Fira Sans",
"Droid Sans",
"Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
font-family:
source-code-pro,
Menlo,
Monaco,
Consolas,
"Courier New",
monospace;
}
11 changes: 10 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7861,7 +7861,7 @@ postcss@^7.0.35:
picocolors "^0.2.1"
source-map "^0.6.1"

postcss@^8.3.5, postcss@^8.4.12, postcss@^8.4.4, postcss@^8.4.6, postcss@^8.4.7:
postcss@^8.3.5, postcss@^8.4.4, postcss@^8.4.6, postcss@^8.4.7:
version "8.4.12"
resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.12.tgz"
integrity sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==
Expand All @@ -7870,6 +7870,15 @@ postcss@^8.3.5, postcss@^8.4.12, postcss@^8.4.4, postcss@^8.4.6, postcss@^8.4.7:
picocolors "^1.0.0"
source-map-js "^1.0.2"

postcss@^8.4.12:
version "8.4.12"
resolved "https://registry.npmmirror.com/postcss/-/postcss-8.4.12.tgz#1e7de78733b28970fa4743f7da6f3763648b1905"
integrity sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==
dependencies:
nanoid "^3.3.1"
picocolors "^1.0.0"
source-map-js "^1.0.2"

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz"
Expand Down

0 comments on commit 9bc70d8

Please sign in to comment.