-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from NJUPT-SAST/dev-refactor
refactor style
- Loading branch information
Showing
65 changed files
with
2,220 additions
and
2,144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,67 @@ | ||
@use '../variables' as *; | ||
|
||
@mixin color-badge($color-name) { | ||
background-color: $color-name; | ||
color: $white-color; | ||
font-weight: bold; | ||
} | ||
|
||
.base { | ||
border-radius: $radius-5; | ||
display: inline-flex; | ||
@include shadow; | ||
transition: all $duration-100 $cubic-bezier; | ||
&:hover { | ||
opacity: 0.8; | ||
} | ||
@mixin badge-color { | ||
&.info { | ||
@include color-badge($primary-color); | ||
@include color-badge($info-color); | ||
} | ||
|
||
&.success { | ||
@include color-badge($success-color); | ||
} | ||
|
||
&.warning { | ||
@include color-badge($warning-color); | ||
} | ||
|
||
&.error { | ||
@include color-badge($danger-color); | ||
} | ||
|
||
&.ghost { | ||
@include color-badge($pale-white-color); | ||
color: $black-color; | ||
} | ||
} | ||
|
||
@mixin badge-size { | ||
&.medium { | ||
font-size: 14px; | ||
padding: 2px 11px; | ||
font-size: 1rem; | ||
padding: 0px 12px; | ||
height: 28px; | ||
border-radius: 14px; | ||
} | ||
|
||
&.large { | ||
font-size: 18px; | ||
padding: 3px 14px; | ||
font-size: 1.2rem; | ||
padding: 0px 16px; | ||
height: 32px; | ||
border-radius: 16px; | ||
} | ||
|
||
&.small { | ||
font-size: 10px; | ||
padding: 2px 8px; | ||
padding: 0px 8px; | ||
height: 24px; | ||
border-radius: 12px; | ||
font-size: 0.8rem; | ||
} | ||
} | ||
|
||
.base { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
border: solid 1px $default-color; | ||
cursor: pointer; | ||
|
||
@include shadow; | ||
@include badge-color; | ||
@include badge-size; | ||
|
||
span { | ||
display: inline; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,42 @@ | ||
@use '../variables' as *; | ||
|
||
.base { | ||
background-color: $primary-color; | ||
color: $white-color; | ||
padding: 10px; | ||
border-radius: 5px; | ||
display: block; | ||
border-radius: 4px; | ||
border: none; | ||
cursor: pointer; | ||
font-size: 16px; | ||
font-weight: 400; | ||
transition: all 0.15s ease-in-out; | ||
@include shadow; | ||
|
||
&:hover { | ||
backdrop-filter: brightness(0.85); | ||
} | ||
transition: box-shadow $animation-time-regular $cubic-bezier; | ||
|
||
&:active { | ||
transform: scale(0.98); | ||
filter: blur(0.1px); | ||
} | ||
|
||
&.primary { | ||
background-color: $primary-color; | ||
} | ||
|
||
&.secondary { | ||
background-color: $white-color; | ||
color: $primary-color; | ||
border: 1px solid $primary-color; | ||
&.small { | ||
padding: 6px 12px; | ||
font-size: 0.8rem; | ||
} | ||
|
||
&.border { | ||
border: solid 1px $border-white-color; | ||
background-color: $white-color; | ||
color: $black-color; | ||
font-weight: 500; | ||
&.medium { | ||
font-size: 1rem; | ||
padding: 8px 16px; | ||
} | ||
|
||
&.ghost { | ||
background-color: transparent; | ||
color: $primary-color; | ||
font-weight: 600; | ||
|
||
&:hover:not(.disabled) { | ||
filter: brightness(1); | ||
backdrop-filter: brightness(0.97); | ||
} | ||
&.large { | ||
padding: 10px 20px; | ||
font-size: 1.2rem; | ||
} | ||
|
||
&.danger { | ||
background-color: $danger-color; | ||
} | ||
@include color; | ||
|
||
&.disabled { | ||
cursor: not-allowed; | ||
|
||
&:hover { | ||
backdrop-filter: none; | ||
} | ||
|
||
&:active { | ||
transform: none; | ||
} | ||
} | ||
|
||
&.disabledShadow { | ||
filter: grayscale(1); | ||
} | ||
|
||
&.small { | ||
padding: 6px 7px; | ||
font-size: 12px; | ||
// all: unset; | ||
@include disabled; | ||
// background-color: $white-color; | ||
} | ||
|
||
&.medium { | ||
padding: 8px 10px; | ||
font-size: 16px; | ||
} | ||
|
||
&.large { | ||
padding: 15px 18px; | ||
font-size: 20px; | ||
&:hover { | ||
@include shadow; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.