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

Add lines property to d2l-collapsible-panel-summary-item. #3792

Merged
merged 3 commits into from
Jun 28, 2023

Conversation

dbatiste
Copy link
Contributor

US154543

This PR adds an optional lines property to d2l-collapsible-panel-summary-item that enables consumers to specify the number of lines to display before truncating with ellipsis. If no value, or a value less than 1 is specified, it will not truncate as consistent with previous behaviour.

Example: lines="2"
image

@dbatiste dbatiste requested a review from a team as a code owner June 28, 2023 20:06
@github-actions
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://pr-3792-brightspace-ui-core.d2l.dev/

Note
The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

'd2l-skeletize': true,
'truncate': this.lines > 0
};
const styles = (this.lines > 0) ? { '-webkit-line-clamp': this.lines } : {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't we adding this rule in the truncate definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just because the value is coming from the consumer-specified attribute. We could set a CSS variable in one of the life cycle methods to use in CSS, but seems unnecessary complexity for this one property. It would be amazing if we could just use attr, but it would not work in this context... maybe one day.

@github-actions
Copy link
Contributor

Visual diff tests failed - pull request #3793 has been opened with the updated goldens.

@dbatiste dbatiste merged commit d8a1dd9 into main Jun 28, 2023
@dbatiste dbatiste deleted the dbatiste/collapsible-panel-summary-item-lines branch June 28, 2023 21:40
@ghost
Copy link

ghost commented Jun 28, 2023

🎉 This PR is included in version 2.132.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants