Corp/backend/static/scss/components/_comments.scss

153 lines
3.4 KiB
SCSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// =============================================================================
// Comments Component
// =============================================================================
// Единый стиль для комментариев во всех местах приложения:
// - В карточках постов (_feed_cards.html)
// - На странице деталей поста (post_detail.html)
// - В модальном окне (postDetailModal.js)
.comment-item {
padding: 0.5rem 0; // py-2
display: flex;
flex-direction: column;
align-items: flex-start;
.comment-header {
font-size: 0.875rem; // small
margin-bottom: 0.25rem;
display: flex;
align-items: center;
flex-wrap: wrap;
.comment-author {
font-weight: 600; // fw-semibold
text-decoration: none;
color: inherit;
&:hover {
text-decoration: underline;
}
}
.comment-separator {
color: var(--bs-secondary);
margin: 0 0.25rem;
}
.comment-date {
color: var(--bs-secondary);
}
.badge {
font-size: 0.7rem;
padding: 0.15rem 0.4rem;
}
}
.comment-body {
font-size: 0.875rem; // small
line-height: 1.5;
white-space: pre-wrap;
word-wrap: break-word;
background: var(--bs-tertiary-bg);
padding: 0.5rem 0.75rem;
border-radius: 12px;
max-width: 80%;
}
// Комментарии автора поста справа
&.comment-item--author {
align-items: flex-end;
.comment-header {
flex-direction: row-reverse;
.comment-separator {
order: 0;
}
.comment-date {
order: -1;
}
}
.comment-body {
background: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.1));
border: 1px solid var(--bs-primary-border-subtle, rgba(13, 110, 253, 0.2));
}
}
}
// Контейнер для списка комментариев
.comments-list {
margin-bottom: 1rem;
}
// Заголовок секции комментариев
.comments-section-header {
display: flex;
align-items: center;
margin-bottom: 0.5rem;
.comments-icon {
font-size: 1.5rem;
color: var(--bs-primary);
margin-right: 0.5rem;
}
.comments-title {
margin-bottom: 0;
}
.comments-count {
font-size: 0.875rem;
color: var(--bs-secondary);
margin-left: 0.5rem;
}
}
// Обёртка для комментариев с sticky формой
.comments-section-wrapper {
position: relative;
}
// Скроллируемая область с комментариями
.comments-scrollable {
max-height: 400px;
overflow-y: auto;
overflow-x: hidden;
padding-bottom: 1rem;
// Firefox скроллбар
scrollbar-width: thin;
scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
// Стилизация скроллбара (Chrome, Safari, Edge)
&::-webkit-scrollbar {
width: 8px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.15);
border-radius: 4px;
&:hover {
background: rgba(0, 0, 0, 0.25);
}
}
}
// Sticky форма для комментариев
.comment-form-sticky {
position: sticky;
bottom: 0;
background: var(--bs-body-bg);
z-index: 10;
border-top: 1px solid var(--bs-border-color);
padding-top: 1rem;
}