Skip to content

fix(ui5-li-custom): correct padding for ListItemCustom #11487

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kgogov
Copy link
Member

@kgogov kgogov commented May 8, 2025

This change addresses an issue with padding styles in the ListItemCustom component, ensuring consistent and accurate layout.

Fixes: #11480

padding-inline: 0 1rem;
}

:host([ui5-li][_selection-mode="Multiple"]) .ui5-li-root {
:host([ui5-li][_selection-mode="Multiple"]) .ui5-li-root,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the [ui5-li] selector needed here?

Including this selector allows the parent class to be aware of its child components. However, this approach has a downside: the corresponding CSS will be bundled with all components that extend the ListItem class, even though these selectors may never match in those contexts. This seems unnecessary and potentially inefficient. Please reconsider and revise the implementation accordingly, as the current setup appears conceptually flawed.

Copy link
Member Author

Choose a reason for hiding this comment

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

The selector is currently there to enforce stronger CSS specificity, but I agree it’s worth exploring if we can achieve the same effect with a cleaner setup. I’ll see what can be done to optimize it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The changes are ready for review.
To address the issue, I increased the specificity of the selection mode padding rules by including [wrapping-type] attribute in the selectors. This ensures they override the generic padding rule without relying on [ui5-li] or [ui5-li-custom].

Copy link
Member Author

Choose a reason for hiding this comment

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

Additionally, since ui5-li-custom currently does not have a [wrapping-type] attribute, I included the override styles specifically for it as well to ensure consistent behavior.

@kgogov kgogov marked this pull request as draft May 8, 2025 13:31
kgogov added 2 commits May 15, 2025 16:43
This change addresses an issue with padding styles in the ListItem
component, ensuring consistent and accurate layout.

Fixes: #11480
Increase the specificity of selection mode padding rules by including
[wrapping-type] in the selectors, ensuring they override the generic
[wrapping-type="None"][description] padding rule. Remove unnecessary
[ui5-li] and [ui5-li-custom] selectors to prevent CSS leakage and
unnecessary bundling.

This change keeps the CSS encapsulated and efficient, while maintaining
the intended visual behavior for selection modes.
@kgogov kgogov force-pushed the li-custom-padding branch from 5ea10e1 to d9a2d42 Compare May 15, 2025 13:43
@kgogov kgogov requested a review from nnaydenow May 15, 2025 13:47
@kgogov kgogov marked this pull request as ready for review May 15, 2025 13:47
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.

[ListItemStandard & ListItemCustom]: checkboxes are misaligned
2 participants