Перейти к основному содержимому
← 🎨 CSS as a design system·Модуль B9 · Урок 10
ЗаданиеRefactor the legacy CSS. Old uses float, hex colors, fixed widths, 3 media queries, !important. Replace with: *, *::before, *::after { box-sizing: border-box; }. :root tokens. .card with flex column gap 16px, padding clamp(16px, 4vw, 24px), bg var(--surface), border 1px solid var(--border), border-radius 12px. .card img with aspect-ratio 16/9, width 100%, object-fit cover, border-radius 8px 8px 0 0 (top corners). .card h3 with margin 0 0 8px. .card p color var(--text-muted), margin 0. .card .cta as button with padding 10px 20px, background var(--primary), color white, border-radius 8px, border none, align-self start, transition. .card .cta:hover background darker. Same HTML stays.

Capstone 10: Legacy → современный рефакторинг CSS

200 XP14 min
Теория

Migrate a Bootstrap-3-era card to 2026 CSS

Given: a card built with float-based layout, hex colors, manual media queries, inline styles, !important wars.

Task: refactor it to use:

  • Modern reset (box-sizing).
  • Custom-property tokens.
  • Flexbox / grid layout.
  • OKLCH colors.
  • clamp() for fluid sizing.
  • :hover transitions.
  • No !important.
  • Logical properties.

Same visual output, ~40% fewer lines.

🔒

Зарегистрируйся чтобы кодить

Теория открыта всем. Интерактивный редактор, живой превью и проверка открываются с 7-дневным бесплатным trial — нужна карта, отмена в любое время.

Регистрация — бесплатный trial →

Первые 10 уроков в каждом треке — бесплатные. Карта не нужна.

← НазадСледующий урок →

Получай один совет по Python или веб-разработке — каждый день в почте

Коротко, без воды, без спама. Отписаться — в один клик.