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

[Duplicate div in Toast notiication]: Doubles intended margin #11885

Open
2 tasks done
cordesmj opened this issue Jun 21, 2024 · 0 comments
Open
2 tasks done

[Duplicate div in Toast notiication]: Doubles intended margin #11885

cordesmj opened this issue Jun 21, 2024 · 0 comments
Labels
bug Something isn't working dev Needs some dev work

Comments

@cordesmj
Copy link

cordesmj commented Jun 21, 2024

Description

The notification content is wrapped with two nested <div class="cds--toast-notification__details"> elements. This results in margin-inline-end: 1rem; being applied twice, doubling the actual margin.

Component(s) impacted

https://web-components.carbondesignsystem.com/?path=/docs/components-notifications-toast--default

Renders as
image

The error is here:

render() {
const { _type: type } = this;
return html`
${this._renderIcon()}
<div class="${prefix}--${type}-notification__details">
${this._renderText()}
</div>
${this._renderButton()}
`;
}

Lines 61 and 63 are not needed because the div is already added here:

protected _renderText() {
const { caption, subtitle, title, _type: type } = this;
return html`
<div class="${prefix}--${type}-notification__details">
<div class="${prefix}--${type}-notification__title">
${title}<slot name="title"></slot>
</div>
<div class="${prefix}--${type}-notification__subtitle">
${subtitle}<slot name="subtitle"></slot>
</div>
<div class="${prefix}--${type}-notification__caption">
${caption}<slot name="caption"></slot>
</div>
<slot></slot>
</div>
`;
}

in lines 36 and 47

(Tried to create a pull request but had trouble getting through the checks gauntlet)

Browser

Chrome

Carbon for IBM.com version

v2.10.0

Severity

Severity 3 = The problem is visible or noticeable to users but does not impede the usability or functionality. Affects minor functionality, has a workaround.

Application/website

w3 publisher

Package

@carbon/web-components

CodeSandbox example

you can see it right in the storybook

Steps to reproduce the issue (if applicable)

Inspect the storybook: https://web-components.carbondesignsystem.com/?path=/story/components-notifications-toast--default

Release date (if applicable)

No response

Code of Conduct

@cordesmj cordesmj added bug Something isn't working dev Needs some dev work labels Jun 21, 2024
@cordesmj cordesmj changed the title [Duplicate div in Toast notiication]: Brief description [Duplicate div in Toast notiication]: Doubles intended margin Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Needs some dev work
Projects
Status: No status
Development

No branches or pull requests

1 participant