🌐 AI搜索 & 代理 主页
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions src/components/Button/Button.module.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
@import "~common/stylesheet/index";

// Variables for maintainability
$button-padding-horizontal: 12px;
$button-margin: 0;
$icon-margin-right: 4px;
$icon-size: 1.6em;
$icon-border-radius: 2px;
$hover-bg-color: $color-overlay;
$primary-hover-bg-color: $color-shadow;
$primary-active-box-shadow: 0px 0px 10px 3px #1a1a1a inset;
$disabled-opacity: 0.6;
$selected-hover-color: rgba($color-font, .8);
$confirming-color: $color-alert;

.button {
display: flex;
align-items: center;
cursor: pointer;
padding: 0 12px;
margin: 0;
padding: 0 $button-padding-horizontal;
margin: $button-margin;

.icon {
margin-right: 4px;
margin-right: $icon-margin-right;

&.image {
width: 1.6em;
height: 1.6em;
width: $icon-size;
height: $icon-size;
background-position: center;
background-size: cover;
border-radius: 2px;
border-radius: $icon-border-radius;
}
}

Expand All @@ -24,33 +37,32 @@

.icon {
margin-right: 0;
margin-left: 4px;
margin-left: $icon-margin-right;
}
}

&.icon_only {
.icon {
margin-left: 0;
margin-right: 0;
margin: 0;
}
}

&:hover {
background-color: $color-overlay;
background-color: $hover-bg-color;
}

&.primary {
&:hover {
background-color: $color-shadow;
background-color: $primary-hover-bg-color;

&:active {
box-shadow: 0px 0px 10px 3px #1a1a1a inset;
box-shadow: $primary-active-box-shadow;
}
}

&.active {
background-color: $color-shadow;
box-shadow: 0px 0px 10px 3px #1a1a1a inset;
background-color: $primary-hover-bg-color;
box-shadow: $primary-active-box-shadow;
font-weight: bold;

.icon {
Expand All @@ -60,20 +72,20 @@
}

&.selected {
background-color: $color-shadow;
background-color: $primary-hover-bg-color;

&:hover {
color: rgba($color-font, .8);
color: $selected-hover-color;
}
}

&.disabled {
cursor: not-allowed;
background-color: $color-shadow;
opacity: 0.6;
background-color: $primary-hover-bg-color;
opacity: $disabled-opacity;
}

&.confirming {
color: $color-alert;
color: $confirming-color;
}
}