Skip to content

Commit

Permalink
feat(leadspace): added ::part pseudo-element to component (#4752)
Browse files Browse the repository at this point in the history
### Description

Added `::part` pseudo-element to `leadspace`

### Changelog

**New**

- `::part` pseudo element in `leadspace.ts`
  • Loading branch information
guilhermelMoraes authored Dec 18, 2020
1 parent b6ecacb commit 0a7a6a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const { stablePrefix: ddsPrefix } = ddsSettings;
* The LeadSpace component.
*
* @element dds-leadspace
* @csspart section The first DOM node inside the shadow-root
*/
@customElement(`${ddsPrefix}-leadspace`)
class DDSLeadSpace extends StableSelectorMixin(LitElement) {
Expand Down Expand Up @@ -136,7 +137,7 @@ class DDSLeadSpace extends StableSelectorMixin(LitElement) {
render() {
const { gradientStyleScheme, type } = this;
return html`
<section style="${this._getBackgroundImage()}" class="${this._getTypeClass()}">
<section style="${this._getBackgroundImage()}" class="${this._getTypeClass()}" part="section">
<div class="${prefix}--leadspace__container">
<div class="${this._getGradientClass()}">
${gradientStyleScheme === LEADSPACE_GRADIENT_STYLE_SCHEME.NONE
Expand Down
12 changes: 12 additions & 0 deletions packages/web-components/tests/snapshots/dds-leadspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
```
<section
class="bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -45,6 +46,7 @@
```
<section
class="bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -85,6 +87,7 @@
```
<section
class="bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -123,6 +126,7 @@
```
<section
class="bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -163,6 +167,7 @@
```
<section
class="bx--leadspace--centered bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -208,6 +213,7 @@
```
<section
class="bx--leadspace--centered bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -255,6 +261,7 @@
```
<section
class="bx--leadspace--centered bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -300,6 +307,7 @@
```
<section
class="bx--leadspace--centered bx--leadspace--centered__image bx--leadspace__section"
part="section"
style="background-image: url(http://fpoimg.com/1056x480?bg_color=ee5396&text_color=161616)"
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -347,6 +355,7 @@
```
<section
class="bx--leadspace--productive bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -385,6 +394,7 @@
```
<section
class="bx--leadspace--productive bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -425,6 +435,7 @@
```
<section
class="bx--leadspace--productive bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down Expand Up @@ -463,6 +474,7 @@
```
<section
class="bx--leadspace--productive bx--leadspace__section"
part="section"
style=""
>
<div class="bx--leadspace__container">
Expand Down

0 comments on commit 0a7a6a7

Please sign in to comment.