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

fix: Listing block default summary should use ul tag for its listing #6318

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions packages/volto/news/6318.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We should use a <ul> tag for the listing block, rather than hx tags. @ana-oprea
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,28 @@ const SummaryTemplate = ({ items, linkTitle, linkHref, isEditMode }) => {
return (
<>
<div className="items">
{items.map((item) => (
<div className="listing-item" key={item['@id']}>
<ConditionalLink item={item} condition={!isEditMode}>
<Component componentName="PreviewImage" item={item} alt="" />
<div className="listing-body">
<h3>{item.title || item.id}</h3>
<p>{item.description}</p>
<ul className="ui list summary-listing">
{items.map((item) => (
<li key={item['@id']}>
<div
className={`listing-item ${
item.review_state ? `state-${item.review_state}` : ''
}`}
role="listitem"
>
<ConditionalLink item={item} condition={!isEditMode}>
<Component componentName="PreviewImage" item={item} alt="" />
<div className="listing-body">
<div className="listing-item-header">
{item.title ? item.title : item.id}
</div>
{item.description && <p>{item.description}</p>}
</div>
</ConditionalLink>
</div>
</ConditionalLink>
</div>
))}
</li>
))}
</ul>
</div>

{link && <div className="footer">{link}</div>}
Expand Down
15 changes: 15 additions & 0 deletions packages/volto/theme/themes/pastanaga/elements/list.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,18 @@
margin-left: @64px;
}
}

#main .items .ui.list.summary-listing {
padding: 0;
margin: 0;
list-style-type: none;

li::before {
content: none;
}
}

#main .items .ui.list.summary-listing .listing-item-header {
&:extend(h3 all);
color: @linkColor;
}
15 changes: 4 additions & 11 deletions packages/volto/theme/themes/pastanaga/elements/list.variables
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,10 @@
/*-------------------
States
--------------------*/


/*-------------------
Variations
--------------------*/

/* Float */

/* Horizontal */

/* Inverted */
@itemPublishedColor: #007bc1;
@itemPrivateColor: #ed4033;
@itemPendingColor: #f6a808;
@itemSubmitColor: #f4e037;
@invertedItemLinkHoverColor: @white;

/* Link List */
Expand Down
Loading
Loading