-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(cxl-ui): cxl-card-grid component, light and course card examples #370
base: master
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
Task linked: CU-86ayk4p69 Completed course section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide better description in the commit message and PR + show an example. It's not clear at the first glance why this is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, I think we don't have a wrapper that would easily achieve the grid design (assuming you checked), and we can reuse this in the future. But it can use some improvements. See my other comments.
::slotted(.grid) { | ||
display: grid; | ||
grid-template-columns: repeat(1, 1fr); | ||
gap: var(--lumo-space-m); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the need to slot in a .grid
element? If we style the host itself to be the grid container, we achieve the same result and allow parent elements to adapt the style if needed. That's important in our setup, to be able to easily re-use the element in wp and make changes by applying desired classes. Just slot the cards directly.
cxl-card-grid { | ||
cxl-light-card, | ||
cxl-course-card { | ||
width: 100%; | ||
max-width: none; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem. By styling the component :host
directly, we avoid unnecessary complexity with global stylesheets. We should only use global styles when there's no other way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://app.clickup.com/t/86ayk4p69
To add a title (for e, wrap it inside the card-grid section and insert the title
To use as a section with a title, wrap cxl-card-grid inside the cxl-section. Example:
<cxl-section> <h3 style="margin: var(--lumo-space-xl) 0">Completed Courses</h3> <cxl-card-grid></cxl-card-grid> </cxl-section>