siyuan/app/src/assets/scss/_button.scss

110 lines
2.2 KiB
SCSS

.b3-button {
cursor: pointer;
color: var(--b3-theme-on-primary);
border-radius: 4px;
line-height: 20px;
padding: 4px 8px;
background-color: var(--b3-theme-primary);
white-space: nowrap;
display: inline-flex;
align-items: center;
justify-content: center;
transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
border: 0;
box-sizing: border-box;
text-align: center;
svg {
height: 16px;
width: 16px;
margin-right: 4px;
}
&:hover,
&:focus,
&--progress {
text-decoration: none;
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, .12);
}
&:active {
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, .12);
}
&--progress {
position: relative;
background-color: transparent;
height: 28px;
& > span {
position: absolute;
content: " ";
height: 100%;
left: 0;
top: 0;
width: 50%;
background-color: var(--b3-theme-primary);
border-radius: 4px;
}
}
&--small {
padding: 0 4px;
font-size: 12px;
}
&--text,
&--cancel {
color: var(--b3-theme-primary);
background-color: transparent;
&:hover,
&:focus {
background-color: var(--b3-theme-primary-lightest);
box-shadow: none;
}
&:active {
background-color: var(--b3-theme-primary-lighter);
box-shadow: none;
}
}
&--cancel {
color: var(--b3-theme-on-surface);
}
&--outline {
color: var(--b3-theme-primary);
box-shadow: inset 0 0 0 1px var(--b3-theme-primary);
background-color: transparent;
&:hover,
&:focus {
background-color: var(--b3-theme-primary-lightest);
box-shadow: inset 0 0 0 1px var(--b3-theme-primary);
}
&:active {
background-color: var(--b3-theme-primary-lighter);
box-shadow: inset 0 0 0 1px var(--b3-theme-primary);
}
}
&--white {
padding: 4px 8px;
font-size: 12px;
background-color: #fafbfc;
color: var(--b3-theme-primary);
&:hover,
&:focus {
background-color: #f3f4f6;
}
}
&:disabled {
opacity: 0.37;
cursor: not-allowed;
}
}