Заголовок секции с 3 вариантами отображения и 4 размерами.
→ Дизайн-гайд: ../page-specs/01-design-guide.md
→ Код: src/components/ui/SectionTitle.astro
→ Showcase: /styleguide
center (по умолчанию)Центрированный заголовок. text-align: center, margin-bottom: var(--spacing-2xl).
underlineЗаголовок с подчёркиванием (border-bottom: 3px solid --color-accent-warm). display: block; width: fit-content. Можно центрировать комбинацией variant="underline" + class="section-title--center".
leftЗаголовок с выравниванием влево. text-align: left, margin-bottom: var(--spacing-2xl).
as)Проп as |
Элемент | Размер | Шрифт | Вес | Цвет |
|---|---|---|---|---|---|
h1 |
<h1> |
--font-size-4xl (2.25rem) |
Playfair Display | bold | --color-primary |
h2 |
<h2> |
--font-size-3xl (1.875rem) |
Playfair Display | semibold | --color-primary |
h3 |
<h3> |
--font-size-xl (1.25rem) |
Inter | semibold | --color-text |
h4 |
<h4> |
--font-size-lg (1.125rem) |
Inter | semibold | --color-text |
Мобильные размеры (≤768px): h1→3xl, h2→2xl, h3→lg.
---
import SectionTitle from '../components/ui/SectionTitle.astro';
---
<!-- Центрированный h2 (по умолчанию) -->
<SectionTitle>Почему выбирают РКШ</SectionTitle>
<!-- Центрированный h1 -->
<SectionTitle as="h1">Цены</SectionTitle>
<!-- Подчёркнутый h3 (подраздел) -->
<SectionTitle variant="underline" as="h3">Кулинарный курс</SectionTitle>
<!-- Подчёркнутый h2, по центру -->
<SectionTitle variant="underline" as="h2" class="section-title--center">Курсы для школьников</SectionTitle>
<!-- Выравнивание влево -->
<SectionTitle variant="left">Принципы обучения</SectionTitle>
| Проп | Тип | По умолчанию | Описание |
|---|---|---|---|
variant |
'center' | 'underline' | 'left' |
'center' |
Вариант отображения |
as |
'h1' | 'h2' | 'h3' | 'h4' |
'h2' |
Уровень заголовка и размер |
class |
string |
'' |
Дополнительные CSS-классы |
Это справочник. Единая точка правды —
src/components/ui/SectionTitle.astro. Стили глобальные (<style is:global>) — динамические имена классов не работают со scoped CSS.
.section-title /* корень: heading font, bold, primary, tight line-height */
.section-title--center /* text-align: center, margin-bottom: 2xl */
.section-title--underline /* display: block, width: fit-content, border-bottom: 3px accent-warm, padding-bottom: sm */
.section-title--left /* text-align: left, margin-bottom: 2xl */
.section-title--h1 /* font-size: 4xl */
.section-title--h2 /* font-size: 3xl, font-weight: semibold */
.section-title--h3 /* font-size: xl, Inter, semibold, color: text */
.section-title--h4 /* font-size: lg, Inter, semibold, color: text */
Ключевые токены:
border-bottom: 3px solid var(--color-accent-warm), padding-bottom: var(--spacing-sm):first-child сбрасывает margin-top: 0| Страница | Контекст |
|---|---|
| Главная (/) | Все заголовки секций |
| Цены (/czeny) | h1 «Цены», h2 «0 класс»/«Курсы», h3 подразделы |
| Отзывы (/otzyvy) | h2 «Отзывы на Яндекс Картах» |
| Преподаватели (/prepodavateli) | h1 «Наши преподаватели» |
| Сведения (/sveden) | h2 разделы |
| Styleguide | Все варианты |