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(structured-list, pricing-table): correct coloration, spacing & alignment #12101

Merged
merged 6 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,16 @@

.#{$prefix}--structured-list-cell[icon],
:host(#{$c4d-prefix}-structured-list-cell[icon]) {
&[icon='checkmark'] {
&[icon='checkmark'] svg {
color: $support-success;
}

svg {
margin-inline-end: $spacing-03;
}
}

.#{$prefix}--structured-list-cell-icon-text-container {
display: flex;
m4olivei marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import CDSStructuredListCell from '@carbon/web-components/es/components/structured-list/structured-list-cell.js';
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined';
import Info16 from '@carbon/web-components/es/icons/information/16.js';
import Checkmark20 from '@carbon/web-components/es/icons/checkmark/20.js';
import Error20 from '@carbon/web-components/es/icons/error/20.js';
Expand All @@ -24,9 +25,11 @@ const { prefix, stablePrefix: c4dPrefix } = settings;
* StructuredListCell
*
* @element c4d-structured-list-cell
* @csspart icon-text-container - Text wrapping element. Usage `c4d-structured-list-cell::part(icon-text)`
* @csspart icon-text - Descriptive text of the cell. Usage `c4d-structured-list-cell::part(icon-text)`
* @csspart tag - Tags of the cell. Usage `c4d-structured-list-cell::part(tag)`
* @csspart icon - An icon. Usage `c4d-structured-list-cell::part(icon)`
* @csspart tooltip - CDSTooltip. Usage `c4d-structured-list-cell::part(icon)`
*/
@customElement(`${c4dPrefix}-structured-list-cell`)
class C4DStructuredListCell extends CDSStructuredListCell {
Expand Down Expand Up @@ -59,10 +62,14 @@ class C4DStructuredListCell extends CDSStructuredListCell {
private _renderIcon() {
const { icon, _iconsAllowed: iconMap } = this;

return html`${iconMap[icon!.toLowerCase()].call()}
return html` <div
class="${prefix}--structured-list-cell-icon-text-container"
part="icon-text-container">
${iconMap[icon!.toLowerCase()].call(null, { part: 'icon' })}
<span class="${prefix}--structured-list-cell-icon-text" part="icon-text">
<slot></slot>
</span>`;
</span>
</div>`;
}

private _renderTags() {
Expand All @@ -85,9 +92,9 @@ class C4DStructuredListCell extends CDSStructuredListCell {

return html`
<cds-tooltip-icon
part="icon"
part="tooltip"
alignment="start"
body-text="${tooltip}"
body-text="${ifDefined(tooltip)}"
direction="right">
${Info16()}
</cds-tooltip-icon>
Expand Down
Loading