- index.html
- style.lessstyle.css
HTML
<!DOCTYPE html>
<html lang="ru">
<head>
<title>Цветовые функции, шаг 5</title>
<meta charset="utf-8">
<link href="course.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body>
<article class="alerts">
<h1>Сообщения</h1>
<section>
<p class="alert alert-primary"><strong>Объявление.</strong> Так оформляется обычное сообщение.</p>
</section>
<section>
<p class="alert alert-error"><strong>Ошибка.</strong> А так выглядит сообщение об ошибке.</p>
</section>
<section>
<p class="alert alert-info"><strong>Сообщение.</strong> Это просто блок информации.</p>
</section>
<section>
<p class="alert alert-warning"><strong>Внимание.</strong> А на это стоит обратить внимание.</p>
</section>
<section>
<p class="alert alert-success"><strong>Успех.</strong> В этом сообщении удача улыбается вам.</p>
</section>
</article>
</body>
</html>
LESSCSS
/*----- Основные цвета -----*/
@base-color: rgb(110, 27, 255);
@error-color: spin(@base-color, 60);
@info-color: spin(@base-color, -60);
@warning-color: spin(@base-color, 120);
@success-color: spin(@base-color, -120);
/*----- Цвета сообщений -----*/
@alert-primary-bg: lighten(@base-color, 35%);
@alert-primary-border: darken(spin(@alert-primary-bg, -10), 5%);
@alert-primary-text: darken(@alert-primary-bg, 50%);
@alert-error-bg: lighten(@base-color, 35%);
@alert-error-border: darken(spin(@alert-error-bg, -10), 5%);
@alert-error-text: darken(@alert-error-bg, 50%);
@alert-info-bg: lighten(@base-color, 35%);
@alert-info-border: darken(spin(@alert-info-bg, -10), 5%);
@alert-info-text: darken(@alert-info-bg, 50%);
@alert-warning-bg: lighten(@base-color, 35%);
@alert-warning-border: darken(spin(@alert-warning-bg, -10), 5%);
@alert-warning-text: darken(@alert-warning-bg, 50%);
/*----- Правила сообщений -----*/
.alert {
&-primary {
border-color: @alert-primary-border;
background-color: @alert-primary-bg;
color: @alert-primary-text;
}
&-error {
border-color: @alert-error-border;
background-color: @alert-error-bg;
color: @alert-error-text;
}
&-info {
border-color: @alert-info-border;
background-color: @alert-info-bg;
color: @alert-info-text;
}
&-warning {
border-color: @alert-warning-border;
background-color: @alert-warning-bg;
color: @alert-warning-text;
}
}
Вы перешли на другую страницу
ЗадачиВыполнено
0
- Замените переменную
@base-color
на@error-color
в функции для расчёта@alert-error-bg
(15 строка). - Замените переменную
@base-color
на@info-color
в функции для расчёта@alert-info-bg
(19 строка). - Замените переменную
@base-color
на@warning-color
в функции для расчёта@alert-warning-bg
(23 строка).
- Раскрасьте оставшееся сообщение