164 lines
4.0 KiB
CSS
164 lines
4.0 KiB
CSS
/**
|
||
* Custom Button Styles
|
||
*
|
||
* Расширение стандартных кнопок Bootstrap с дополнительными вариантами:
|
||
* - .btn-circle - круглая кнопка (квадратная с border-radius: 50%)
|
||
* - .btn-icon - кнопка только с иконкой без текста
|
||
* - Размеры: .btn-circle-sm, .btn-circle-md (default), .btn-circle-lg
|
||
*/
|
||
|
||
/* ===== КРУГЛЫЕ КНОПКИ ===== */
|
||
|
||
/* Базовый класс для круглых кнопок */
|
||
.btn-circle {
|
||
border-radius: 50% !important;
|
||
padding: 0 !important;
|
||
display: inline-flex !important;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
aspect-ratio: 1 / 1;
|
||
overflow: hidden;
|
||
line-height: 1;
|
||
}
|
||
|
||
/* Размеры круглых кнопок */
|
||
.btn-circle.btn-sm,
|
||
.btn-circle-sm {
|
||
width: 32px !important;
|
||
height: 32px !important;
|
||
min-width: 32px !important;
|
||
max-width: 32px !important;
|
||
min-height: 32px !important;
|
||
max-height: 32px !important;
|
||
font-size: 0.875rem;
|
||
}
|
||
|
||
.btn-circle:not(.btn-sm):not(.btn-lg),
|
||
.btn-circle-md {
|
||
width: 36px !important;
|
||
height: 36px !important;
|
||
min-width: 36px !important;
|
||
max-width: 36px !important;
|
||
min-height: 36px !important;
|
||
max-height: 36px !important;
|
||
font-size: 1rem;
|
||
}
|
||
|
||
.btn-circle.btn-lg,
|
||
.btn-circle-lg {
|
||
width: 44px !important;
|
||
height: 44px !important;
|
||
min-width: 44px !important;
|
||
max-width: 44px !important;
|
||
min-height: 44px !important;
|
||
max-height: 44px !important;
|
||
font-size: 1.25rem;
|
||
}
|
||
|
||
/* Иконка внутри круглой кнопки */
|
||
.btn-circle i {
|
||
line-height: 1;
|
||
display: inline-block;
|
||
}
|
||
|
||
/* ===== КНОПКИ С ИКОНКАМИ ===== */
|
||
|
||
/* Кнопка с иконкой и текстом */
|
||
.btn-icon {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 0.5rem;
|
||
}
|
||
|
||
.btn-icon i {
|
||
line-height: 1;
|
||
}
|
||
|
||
/* Только иконка на мобильных */
|
||
@media (max-width: 767.98px) {
|
||
.btn-icon .btn-text {
|
||
display: none;
|
||
}
|
||
|
||
/* Если это не круглая кнопка, делаем её круглой на мобильных */
|
||
.btn-icon:not(.btn-circle) {
|
||
border-radius: 50% !important;
|
||
padding: 0.5rem !important;
|
||
width: 36px;
|
||
height: 36px;
|
||
justify-content: center;
|
||
}
|
||
}
|
||
|
||
/* ===== ДОПОЛНИТЕЛЬНЫЕ ВАРИАНТЫ ===== */
|
||
|
||
/* Кнопка-призрак (без фона, только border при hover) */
|
||
.btn-ghost {
|
||
background: transparent;
|
||
border: 1px solid transparent;
|
||
color: var(--bs-body-color);
|
||
transition: all 0.2s ease;
|
||
}
|
||
|
||
.btn-ghost:hover {
|
||
background: color-mix(in srgb, var(--bs-body-color), transparent 90%);
|
||
border-color: var(--bs-border-color);
|
||
color: var(--bs-body-color);
|
||
}
|
||
|
||
.btn-ghost:active {
|
||
background: color-mix(in srgb, var(--bs-body-color), transparent 85%);
|
||
}
|
||
|
||
/* Pill-кнопки (максимально скругленные) */
|
||
.btn-pill {
|
||
border-radius: 999px !important;
|
||
}
|
||
|
||
/* ===== СОСТОЯНИЯ ===== */
|
||
|
||
/* Активное состояние для toggle-кнопок */
|
||
.btn-circle[aria-expanded="true"],
|
||
.btn-circle.active {
|
||
background-color: var(--bs-primary) !important;
|
||
border-color: var(--bs-primary) !important;
|
||
color: white !important;
|
||
}
|
||
|
||
/* Анимация вращения для toggle-кнопок */
|
||
.btn-circle[aria-expanded="true"] {
|
||
transform: rotate(180deg);
|
||
transition: transform 0.3s ease;
|
||
}
|
||
|
||
.btn-circle[aria-expanded="false"] {
|
||
transform: rotate(0deg);
|
||
transition: transform 0.3s ease;
|
||
}
|
||
|
||
/* ===== ГРУППЫ КРУГЛЫХ КНОПОК ===== */
|
||
|
||
/* Группа круглых кнопок с небольшим отступом */
|
||
.btn-circle-group {
|
||
display: flex;
|
||
gap: 0.5rem;
|
||
align-items: center;
|
||
}
|
||
|
||
.btn-circle-group .btn-circle {
|
||
margin: 0;
|
||
}
|
||
|
||
/* ===== ТЕМНАЯ ТЕМА ===== */
|
||
|
||
@media (prefers-color-scheme: dark) {
|
||
.btn-ghost {
|
||
color: var(--bs-body-color);
|
||
}
|
||
|
||
.btn-ghost:hover {
|
||
background: color-mix(in srgb, var(--bs-body-color), transparent 92%);
|
||
}
|
||
}
|