Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Правит нейминг классов #989

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/includes/articles-gallery.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<section class="articles-gallery">
<h2 class="visually-hidden">Избранные статьи</h2>

<ul class="featured-artices-list base-list">
<ul class="featured-articles-list base-list">
{% for article in featuredArticles %}
{% set isLazyLoading = loop.index > lazyLoadingIndexThreshold %}
<li class="featured-artices-list__item">
<li class="featured-articles-list__item">
{{ featuredArticle(article=article, isLazyLoading=isLazyLoading) }}
</li>
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions src/includes/related-articles-gallery.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<section class="articles-gallery">
<h2 class="articles-gallery__title">Читайте также</h2>

<ul class="related-articles-list featured-artices-list base-list">
<ul class="related-articles-list featured-articles-list base-list">
{% for article in relatedArticles %}
<li class="related-articles-list__item featured-artices-list__item">
<li class="related-articles-list__item featured-articles-list__item">
{{ featuredArticle(article=article, class="related-articles-list__article") }}
</li>
{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/modules/articles-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ function init() {
return
}

const list = gallery.querySelector('.featured-artices-list')
const items = Array.from(list?.querySelectorAll('.featured-artices-list__item') || [])
const list = gallery.querySelector('.featured-articles-list')
const items = Array.from(list?.querySelectorAll('.featured-articles-list__item') || [])

if (items.length === 0) {
return
}

const activeClass = 'featured-artices-list__item--active'
const activeClass = 'featured-articles-list__item--active'

const pageSize = parseInt(getComputedStyle(list).getPropertyValue('--page-size'), 10) || 1
let lastItemIndex = pageSize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
.featured-artices-list {
.featured-articles-list {
--page-size: 6;
--columns: 1;
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(var(--columns), 1fr);
}

.featured-artices-list__item {
.featured-articles-list__item {
display: grid;
}

.featured-artices-list__item:not(.featured-artices-list__item--active):nth-child(n + 7) {
.featured-articles-list__item:not(.featured-articles-list__item--active):nth-child(n + 7) {
display: none;
}

@media not all and (min-width: 1200px) {
.featured-artices-list {
.featured-articles-list {
--page-size: 4;
}

.featured-artices-list__item:not(.featured-artices-list__item--active):nth-child(n + 5) {
.featured-articles-list__item:not(.featured-articles-list__item--active):nth-child(n + 5) {
display: none;
}
}

@media not all and (min-width: 768px) {
.featured-artices-list {
.featured-articles-list {
--page-size: 3;
}

.featured-artices-list__item:not(.featured-artices-list__item--active):nth-child(n + 4) {
.featured-articles-list__item:not(.featured-articles-list__item--active):nth-child(n + 4) {
display: none;
}
}

@media (min-width: 768px) {
.featured-artices-list {
.featured-articles-list {
--columns: 2;
}
}

@media (min-width: 1200px) {
.featured-artices-list {
.featured-articles-list {
--columns: 3;
grid-gap: 20px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@import 'blocks/snow.css';
@import 'blocks/intro.css';
@import 'blocks/featured-article.css';
@import 'blocks/featured-artices-list.css';
@import 'blocks/featured-articles-list.css';
@import 'blocks/articles-gallery.css';
@import 'blocks/index-group-list.css';
@import 'blocks/article-indexes-list.css';
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.sc.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@import 'blocks/theme-toggle.css';
@import 'blocks/intro.css';
@import 'blocks/featured-article.css';
@import 'blocks/featured-artices-list.css';
@import 'blocks/featured-articles-list.css';
@import 'blocks/articles-gallery.css';
@import 'blocks/index-group-list.css';
@import 'blocks/article-indexes-list.css';
Expand Down