feat: Добавлен переиспользуемый компонент кнопки с задаваемыми размерами, вариантами и цветовыми схемами. Добавлен декоратор стилей для сторибука, установлена библиотека для работы с классами

This commit is contained in:
Ilia Mashkov
2025-11-20 09:26:01 +03:00
parent e440005e60
commit 5c869eb215
12 changed files with 281 additions and 2 deletions

View File

@@ -0,0 +1,78 @@
.button {
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
background: transparent;
cursor: pointer;
transition: all 0.3s ease;
padding: 0;
outline: none;
font-family: var(--font-family-main);
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
// Variants
&.round {
border-radius: 50%;
aspect-ratio: 1;
}
&.regular {
border-radius: 1em;
padding: 0.5em 1em;
}
// Sizes
&.small {
height: 40px;
font-size: 14px;
}
&.medium {
height: 50px;
font-size: 18px;
}
&.large {
height: 60px;
font-size: 24px;
}
// Color Schemes
&.primary {
$color-primary: var(--color-primary);
background-color: transparent;
color: $color-primary;
border: 1px solid $color-primary;
&:hover:not(:disabled) {
background-color: var(--color-white);
}
}
&.secondary {
$color-blue: var(--color-blue);
background-color: var(--color-white);
color: $color-blue;
box-shadow: 0px 0px 15px rgb($color-blue / 10%);
}
// Icon handling
.icon {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
svg {
width: 40%;
height: 40%;
object-fit: contain;
}
}
}