Skip to content

feat(djangocms_blog): article 'has-blog-tag-...' class names#593

Merged
wesleyboar merged 4 commits intotask/redirect-blog-articles-without-pluginfrom
task/propagate-tag-classes-to-articles
Feb 6, 2023
Merged

feat(djangocms_blog): article 'has-blog-tag-...' class names#593
wesleyboar merged 4 commits intotask/redirect-blog-articles-without-pluginfrom
task/propagate-tag-classes-to-articles

Conversation

@wesleyboar
Copy link
Copy Markdown
Member

@wesleyboar wesleyboar commented Feb 6, 2023

Overview

For every li a.blog-tag-... an article has (in its metadata), add has-blog-tag-... class on the <article>.

Related

Changes

  • add script to post_list.html

Testing

  1. Load News list that has articles with tags.
  2. Match each article.post-item > header > ul.tags > li > a[class*="blog-tag-"] class to article.post-item classes of the pattern .has-blog-tag-…* i.e.
    1. given a news article with tag test,
    2. then article has metadata tag link with class blog-tag-test,
    3. and article has class has-blog-tag-test*.

* The has- prefix is added to replicate CSS :has() selector, so that CSS can select via article:has(.blog-tag-test) (if browser supports :has()) and article.has-blog-tag-test (if browser does not support :has()).

UI

has-blog-tag-___

@wesleyboar wesleyboar changed the base branch from main to task/redirect-blog-articles-without-plugin February 6, 2023 02:25
@wesleyboar wesleyboar merged commit fad1137 into task/redirect-blog-articles-without-plugin Feb 6, 2023
@wesleyboar wesleyboar deleted the task/propagate-tag-classes-to-articles branch February 6, 2023 02:26
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.

1 participant