carbon-web-components icon indicating copy to clipboard operation
carbon-web-components copied to clipboard

Feature: Notification panel

Open asudoh opened this issue 6 years ago • 6 comments

https://www.carbondesignsystem.com/patterns/notification-pattern/#notification-panel

asudoh avatar Jan 28 '20 23:01 asudoh

hi @asudoh, can i contribute this component ?

xxxle0 avatar Jan 31 '20 08:01 xxxle0

Definitely, thank you for jumping in @xxxle0! Great if you can read the coding convention doc beforehand. Also there are some coding conventions I haven't been able to document yet, so if you can read some of the existing code and take cues from there it'll be great. Please don't hesitate to ask any time if you have any questions!

asudoh avatar Jan 31 '20 09:01 asudoh

ok. thanks 👍

xxxle0 avatar Jan 31 '20 11:01 xxxle0

hi @asudoh, i read the codebase and this repo will inherit css from carbon package component. Just convert the presentational component to Web component. Is it right ?

xxxle0 avatar Feb 05 '20 09:02 xxxle0

Thanks you for asking @xxxle0 - Let's take <bx-dropdown-item> as an example. It has static styles property that dictates the style set to shadow DOM, coming from dropdown.scss from the same directory. The dropdown.scss file imports several styles from Carbon as you may have alluded to, but it also has styles for :host(#{$prefix}-dropdown-item) selector. This is because <bx-dropdown-item> is an actual DOM element unlike React component node (e.g. carbon-components-react's <ListBoxMenuItem>) which is not a DOM element. That means the style of <bx-dropdown-item> has to be mapped to the top-level element <ListBoxItem> renders, which is, <div className="bx--list-box__menu-item">. Fortunately many cases for <bx-dropdown-item> it's as simple as using Sass @extend along with fixing display where we want block but browser's default style for unknown element is inline. But as you see in some style rules there (e.g. one for disabled dropdown item) we may need more manual styling depending on how the corresponding Carbon style is defined.

Other than that, it's mostly about having lit-element define properties, render the contents, and handling events. Don't hesitate to ask any other questions. Thanks!

asudoh avatar Feb 05 '20 12:02 asudoh

I have definitely seen a request for this or something similar to this before from someone attending Design Office Hours.

However I'm unclear if this is a feature or a Pattern that Carbon is showing as an example.

oliviaflory avatar Jan 10 '22 16:01 oliviaflory