Skip to content

feat(main-page): redesign using new components#24

Open
oostap1985 wants to merge 3 commits into
mainfrom
feat/65099006_main-page
Open

feat(main-page): redesign using new components#24
oostap1985 wants to merge 3 commits into
mainfrom
feat/65099006_main-page

Conversation

@oostap1985

Copy link
Copy Markdown
Collaborator
  • add redesigned base layout and includes
  • add new navigation and external links data
  • add art slider script
  • update arts JSON and templates (exploding-head, mushroom)
  • add new icons and fonts
  • update global styles

- add redesigned base layout and includes
- add new navigation and external links data
- add art slider script
- update arts JSON and templates (exploding-head, mushroom)
- add new icons and fonts
- update global styles
@oostap1985 oostap1985 force-pushed the feat/65099006_main-page branch from e7e4a2e to b81a3ff Compare June 2, 2026 10:10
Comment thread src/_data/arts.json Outdated
Comment thread src/_data/extLinksRedesign.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет смысла создавать подобные отдельный файлы на редизайн, может только в некоторых местах. Тут просто ссылки: их набор никак не влияет

contentContainer: "D-f Jc-c Ai-c"
}

href=`href=${it.url}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут что-то странное: переменная без let/const

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/assets/style/style.scss Outdated
--ml-blueGray:rgb(236, 240, 246,0.5);
--ml-gray200:#d1d5db;
--ml-gray350:#cacacaa0;
// redesign

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В таких переменных нет смысла - меняем существующией

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пока не понял, зачем новый базовый шаблон

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отдельный базовый шаблон не нужен. Можно просто пока часть старых переменных оставить, чтобы другие страницы совсем не сломались

Comment thread src/assets/style/fonts/fonts.css Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Шрифты лучше с google fonts подключать, по крайне мере пока

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/arts/exploding-head.ejs Outdated
}
%>
<div class="Ctnt-s M7u;a;0 H100p Apcr1 Plci-c;c Plcc-c D-f -ExplodingOrangeA#ee980d -ExplodingOrangeB#f8c829 -ExplodingBrownA#662800 -ExplodingBrownB#6f2810 -ExplodingBrownC#9c2a00 -ExplodingBrownD#934800 -ExplodingBrownE#9b3c18 -ExplodingBrownF#a24b0b -ExplodingBrownG#f7ae48 -ExplodingBrownH#d2a55a -ExplodingBrownI#efd3ac">
<!-- изменил у первого div M7u;a;0 -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Комменты для ревьювера надо тут писать, а не в коде)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил)

@@ -0,0 +1,28 @@
<%
const css = {
buttonShape:"-Sz100p D-f Jc-c Ai-c P10 Fns16 Bdrd8 Ts-$shortTs Bd1;s;$brand",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pixel perfect нам не нужен, поэтому в большинстве мест лучше u использовать для размеров

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

<%
const css = {
buttonShape:"-Sz100p D-f Jc-c Ai-c P10 Fns16 Bdrd8 Ts-$shortTs Bd1;s;$brand",
contentContainer: "D-f Jc-c Ai-c"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не используется

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

%>
<<%= it.tag %> <%= href %>
class="btn <%= css.buttonShape %> <%= css.buttonColors %>">
<span class="<%= css.span %>">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем этот span?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил


<a
href="<%= it.link %>"
alt="Link to <%= it.name %>"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ссылке не нужен alt

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

:c:+_Bgc-$brand :c:+_Bdc-$brand :c:+_Bgc-$reAccent900_af,b :c:+_Bxsd0;1.5u;0;0;$reAccent900_af :c:+_Bdc-n">
</label>

<label id="overlay" for="menu-toggle"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 лейбла на 1 инпут - это что-то странное

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не исправлено

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Меняем основной хедер, отдельный шаблон не нужен

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На мобильном не соответствует макету + логотип надо чуть побольше: 64px хотя бы

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

<header class=" D-f Jc-sb Ai-c P15u;4u;2u md_P0;5.5p Bgc-$core950 Bcf -Blr0.4 Ps-f H-$headerH W100p C-$headerC Zi20">

<%# Logo %>
<div class="W40 H16 md_W83 md_H34">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это наоборот делается: указываем размеры изображения, от которых зависит контейнер

@mr150 mr150 Jun 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ширину логотипа сделать 116, высоту: auto

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

<%# Logo %>
<div class="W40 H16 md_W83 md_H34">
<a href="/" id="header-logo" class="D-f Jc-c Ai-c -Sz100p <%= it.cssHeaderLogoVisibility %> Ts-O;$shortTs">
<svg class="-Sz100p" alt="mlut logo">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если логотип не перекрашивается, то его лучше просто img делать. И посмотри как сейчас href у лого реализован - надо так же

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

%>

<header class=" D-f Jc-sb Ai-c P15u;4u;2u md_P0;5.5p Bgc-$core950 Bcf -Blr0.4 Ps-f H-$headerH W100p C-$headerC Zi20">

@mr150 mr150 Jun 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Много пустых строк - не надо так. Пусть будут только между крупными блоками

</li>
<% }%>
</ul>
<script type="module">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это легаси - убираем)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Убрал

Comment thread src/assets/script/art-slider.js Outdated
document.head.appendChild(link);
}

class ArtsSliderComponent extends HTMLElement {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тогда уж просто ArtsSlider

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/index-redesign.ejs Outdated
<div class="D-f Fld-c Ai-c Gap4u W100p md_W80p md_Mxw350 lg_Mxw504">
<div class="<%= heroCSS.gradient %> md_D-n"></div>

<h1 class="D Fnf-SNPro Fns6u Fnw-b Lnh100p Lts0 M3.5u;0 Txt C-$brand Ps Zi2 md_D-n">Make CSS exciting again!</h1>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не h1. Посмотри, какая сейчас разметка в hero секции

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И отступы (margin) по дефолту только с 1 стороны делаем: низ или верх

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/index-redesign.ejs Outdated
<use href="/assets/img/icons.svg#twoTriangle"></use>
</svg>
<div class="D-n md_D-f md_Fld-c Gap8">
<h1 class="Fnf-SNPro Fns48 M17;0 Fnw-b Lnh100p Lts0 Txt C-$brand">Make CSS exciting again!</h1>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо попробовать сверстать без дублирования контента. Такое только в крайнем случае делается

Comment thread src/index-redesign.ejs Outdated
<div class="D-n Ps-a W80p H150p T-195 L50p Tf -Tr-50p;0 <%= heroCSS.dradientDescTop %> <%= heroCSS.dradientDescBot %> md_D-f">
<div class="Ps-a W80p Apcr1 T0 L10p Bdrd100p -Gdl180d,$reCore400;0,$reCore450;100p Ft -Blr100"></div>
</div>
<div class="D-f Fld-c Ai-c Gap4u W100p md_W80p md_Mxw350 lg_Mxw504">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, что тут часть декора можно псевдоэлементами сделать

Comment thread src/index-redesign.ejs
<arts-slider class="D-f Ai-fs Fl1 W100p">
<button class="prev W48 Apcr1 Mr40 As-c Bgc-tp Bd-n P0 Cs lg_Mr80">
<svg class="Tf -Rt180d C-$brand C-$reBrand500_h C-$reBrand600_a Ts-$shortTs" width="17" height="29">
<use href="/assets/img/icons.svg#arrow-slider"></use>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для декоративных svg лучше отдельный спрайт сделать

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделал

Comment thread src/index-redesign.ejs Outdated
</svg>
</button>
</arts-slider>
<span class="Fns16 Fnw-l Lnh150p Lts0 C-$reAccent850 md_Ps-a md_L50p md_B-43 md_Tf md_-Tr-50p;0">Yes, this is CSS</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<span class="Fns16 Fnw-l Lnh150p Lts0 C-$reAccent850 md_Ps-a md_L50p md_B-43 md_Tf md_-Tr-50p;0">Yes, this is CSS</span>
<span class="Fns16 Fnw-l Lnh150p Lts0 C-$reAccent850 md_Ps-a md_L50p md_B-43 md_Tf md_-Tr-50p;0">Yes, this is pure CSS</span>

Comment thread src/index-redesign.ejs Outdated

<h1 class="D Fnf-SNPro Fns6u Fnw-b Lnh100p Lts0 M3.5u;0 Txt C-$brand Ps Zi2 md_D-n">Make CSS exciting again!</h1>
<div class="D-f Fld-c Ai-c Gap2u Bgc-tp W100p Ps Zi2">
<arts-slider class="D-f Ai-fs Fl1 W100p">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Декоративные элементы лучше не в сам art-slider, а в контейнер выше

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

@mr150 mr150 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чуть позже будут еще комменты


<%- include('./burger.ejs') %>

<div class="Bgc-$core950 Ps-a R0 T-$headerH Ts-$longTs Tf -Trx101p Bd1;s;$brand Bdr-n Bdtlr3u Bdblr3u Mxw50u ^burger:c:~_-Trx0 W50vw P10u;0 md_All-ust @:h<420_P3u;0">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@:h<420 странное решение, при чем тут высота?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

md_All-ust тоже выглядит сомнительно

Comment thread src/index-redesign.ejs Outdated
</div>
</div>
<button class="next W48 Apcr1 Ml40 As-c Bgc-tp Bd-n P0 Cs lg_Ml80">
<svg class="C-$brand C-$reBrand500_h C-$reBrand600_a Ts-$shortTs" width="17" height="29">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кнопки надо чуть покрупнее на десктопе, а то они местами сливаются с декором

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/index-redesign.ejs Outdated
<% for (let decor of Object.values(decorCSSArts)) { %>
<div class="D-n md_D <%= decor %>"></div>
<% } %>
<div class="W100p P0 Bxz-bb md_P16 md_Bdrd1u md_Bgc-$artFrameColorSmall md_Bxsd0;0;0;0.5u;$artFrameBorderSmall">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему тут рамка через box-shadow, а не border?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bxz-bb - нет смысла, он уже у всех стоит. border-radius тут у рамки не нужен. padding пусть 2u будет, больше не надо

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Border "толстый" и забирал много пространства внутри блока, поэтому сделал через box-shadow.

Comment thread src/_data/extLinksRedesign.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Еще раз: отдельные файлы с данными для редизайна не нужны

@oostap1985

Copy link
Copy Markdown
Collaborator Author

Привет. Со следующим коммитом конфликт исправлю.
Не понял в макете (для мобилки) кнопки переключения темы. Сделал три.
Пока оставил еще один базовый шаблон, потом уберу.
В scss файле пока порядок не наводил, позже уберу лишние переменные.

@oostap1985

Copy link
Copy Markdown
Collaborator Author

некоторые прошлые комменты по header и "бургер" меню (несколько label):
-изначально я там практически ничего не менял. Взял готовое, изменил цвет, шрифт, по мелочи. В основном утилиты все остались как и были.
-по поводу нескольких label на один input: изначально так и было, сам такого не придумал) Но почитал, в принципе нормальная практика вешать несколько label на один input, главное не наоборот, один label на несколько input). Если все же не пойдет так, могу вместо чекбокса просто кнопку сделать и скрипт добавить.

<% } %>
</<%= it.tag %>>

<<%= it.tag %> class="btn <%= css.buttonShape %> <%= css.buttonColors %> <%= css.textColor %>" href="<%= it.url %>">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В текущем варианте у кнопки всегда будет href, хотя и ссылка и button могут быть без href

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил

<%# Menu %>
<div class="D-f Fld-r Jc-fe Ai-c md_D-f md_Jc-e md_Gap8u md_Fns-$headerFns">
<%- include('./burger.ejs') %>
<div class="Ps-a R0 T-$headerH W100p H91vh Ov-h P6u;4u Bgc-$core820 Ts-$longTs Tf -Trx101p Mxw420 ^burger:c:~_-Trx0 md_All-ust">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем Ts-$longTs? Это кастомное свойство даже нигде не объявляется

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

оно объявлялось в базовом шаблоне в class для html.
Убрал.


<%
const card = it.item;
let styles;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эти стили должны быть в data части карточек

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

</div>
<p class="M0 Fns4u Fnst-n Fnw300 Lnh150p Lts0 C-$accent900 lg_P0;2.5u"><%= card.text %></p>
</div>
<% if (card.title === "Rich syntax") { %>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Так не делается. Более грамотный вариант: в data карточки можно сделать поле, типа "дополнительный контент", где id шаблона указываем. Если поле с доп контентом есть, то загружаем шаблон с этим id

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил. Сделал отдельный шаблон

<span class="Fns4u Fnst-n Fnw600 Lnh140p Lts0 C-$tertiary800">Standard CSS </span>
</div>
<code class="P0;2.5u Fnf-Fira;Code Fns3u Fnst-n Fnw400 Lnh150p Lts0 C-$tertiary750 Gc1">
<span class=""><span class="C#00ac4d">@:ah</span>_<span class="C#f04">0</span>1_<span class="P0;0.5u Bgc-$tertiary700 Bdrd0.75u C#9e54ff">h</span></span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выделять кусок, прямо как на исходном скрине - ненужно

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убрал

<use href="/assets/img/icons.svg#arrow-code"></use>
</svg>
</div>
<code class="P0;2.5u D-f Fld-c Fnf-Fira;Code Fns3u Fnst-n Fnw400 Lnh150p Lts0 C-$tertiary750 Gc3">

@mr150 mr150 Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эту часть надо сверстать, примерно как блоки кода с highlight.js, но чтобы раскраска наша кастомная осталась. Можно даже попробовать растянуть блок кода на оставшуюся часть ширины, а то сейчас там пусто

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил, если правильно тебя понял (единственное, фон блоков кода меняется). Посмотри, если что, переделаю.

Comment thread src/_includes/footer.ejs
<div class="P10;12 xl_P10;20">
<span>Community:</span>
</div>
<div class="D-f Ai-c Gap32">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это тоже лучше списком сделать

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил. И в header тоже заодно

Comment thread src/_includes/footer.ejs
<% }%>
</ul>
<theme-switcher class="md_Od3">
<div class="P5;12 D-f Ai-c Gap8u xl_P10;20" role="group" aria-label="Select theme">

@mr150 mr150 Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо aira атрибутов, лучше просто сделать список с невидимой (-D-vh) подписью. И по дефолту: такая невидимая подпись лучше aria

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И кнопка не хватает hover состояния

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил


button.addEventListener("click", async () => {
const text = codeSlot.textContent.trim();
try {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше использовать вместо try ... catch, синтаксис с промисами для обработки ошибок: .catch()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему 2 компонента в 1 модуле? Пусть каждый в отдельном будет

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил


connectedCallback() {
const button = this.querySelector(".copy-btn");
const codeSlot = this.querySelector("code");

@mr150 mr150 Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут лучше по pre искать - надежнее

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил

tabs.forEach((tab) => {
tab.addEventListener("click", () => {

tabs.forEach((t) => t.classList.remove("Bdbc#394EB6"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Стили выделения активности сюда не зашиваем - передаем в атрибутах из разметки

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

constructor() {
super();

const theme = localStorage.getItem('theme');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше более уникальное имя сделать, типа mlut-theme

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил

localStorage.setItem('theme', theme);
}

getCurrentTheme() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Состояние лучше хранить в самом классе, а не в разметке. Разметка - его отражение

return 'auto';
}

setActiveButton(buttons, theme) {

@mr150 mr150 Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут много лишних действий делается

  • зачем каждый раз передавать кнопки, если их можно записать (сразу как массив) в поле инстанса
  • цвет svg должно получать сверху (через currentColor, например), чтобы нам не лезть внутрь и не назначать руками
  • зачем 2 раза ходить по коллекции кнопок, если можно все сделать за 1 проход
  • и опять же: стилизующие классы сверху передаем

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Полностью переписал компонент.

--ml-artFunnyCake: #6295e3;
--ml-artCat: #dea3e3;
}
// Базовая светлая тема

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пусть темная будет базовой

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

}
// Базовая светлая тема
html {
@include light-theme;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

При таком подходе в лоб слишком много кода дублируется. Надо множественные селекторые использовать. Ну и нет смысла compound с html делать - у класса специфичность все равно больше

Comment thread src/index-redesign.ejs

<%
const comparisonCss = {
marker: "Ps-a_b Ct_b L0_b T0.25u_b -Sz16_b Msi-url('/assets/img/marker.svg')_b Mss8_b Msr-nr_b Msp-c_b",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем маркер у списков делается маской? Есть же много способов проще

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне нужно было менять цвет у маркера, почему-то решил попробовать svg и маской. Переделал просто - псевдоэлемент с фоном, без использования svg (пока старый маркер не удалял)

Comment thread src/index-redesign.ejs
<%# Strong naming %>

<h3 class="M9u;0;0 Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$accent900 Txa-c Ps Zi1">Strong naming</h3>
<div class="D-f Fld-c Ai-c Gap16 M4.5u;0;0 P4u;3u W100p Bdrd8 Bgc-$core810 -Gdl90d,$brand50;0p,$brand100;100p md_Fld-r md_Ai-str xl_P24 xl_Gap32 xl_M26;0;0 Ps Zi1">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут тоже карточки являются списком

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/index-redesign.ejs
<h3 class="D-n xl_D M11u;0;0 Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$accent900 Txa-c">Shorter class names and convenient syntax</h3>

<div class="D-f Fld-c W100p xl_Gap32 xl_Fld-r xl_Jc-sb xl_M26;0;0">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Слишком много пустых строк

Comment thread src/index-redesign.ejs
<div class="P4u;3u W100p Bdrd8 Bgc-$core830 Mnw0 Mxw-mc xl_P16">
<h4 class="M0 Txa-c Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$tertiary800">Tailwind CSS</h4>
<div class="Mt3u P2.5u;0">
<%- include('./_includes/components/code-block.ejs',{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут блоки кода должны быть не в 1 строку, а переносится без выхода за границу, чтобы визуально было видно, насколько с mlut меньше кода

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/index-redesign.ejs
<h3 class="D xl_D-n M8u;0;0 Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$accent900 Txa-c">Convenient syntax</h3>
<div class="D-f Fld-c Ai-c Gap16 M4.5u;0;0 P4u;3u W100p Bdrd8 Bgc-$core810 -Gdl90d,$brand50;0p,$brand100;100p md_Fld-r md_Ai-str md_Jc-sb md_Gap20 lg_Fx1 lg_Mnw0 xl_M0 xl_P24">

<%# Tachyons card %>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это тоже tailwind - в макете опечатка

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

Comment thread src/index-redesign.ejs
</div>
</div>

<%# decor %>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут декор должен быть на десктопе ощутимо больше, чем сейчас - смотри макет

Comment thread src/index-redesign.ejs

<h2 class="M3u;0;0 Fnf-SN;Pro Fns6u Fnw700 Fnst-n Lnh100p Lts0 Txt C-$brand Txa-c Zi1">Installation</h2>

<toggle-tab class="W100p M5.5u;0;0 Zi1 xl_M50;0;0">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Табам не хватает состояния при наведении. Если нет в макете - спроси у дизайнера

@mr150

mr150 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

В адаптиве тоже не все исправленно

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants