-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #921 from takenet/fix/arrows-carousel
fix(carousel): fix arrow erros when wrok with diferents themes
- Loading branch information
Showing
11 changed files
with
552 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:host { | ||
display: block; | ||
box-sizing: border-box; | ||
width: auto; | ||
} | ||
|
||
.carrosel-item-frame { | ||
display: block; | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 8px; | ||
position: relative; | ||
overflow: hidden; | ||
|
||
::slotted(*) { | ||
position: relative; | ||
} | ||
} | ||
|
||
.image-bg { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,41 @@ | ||
import { Component, h } from '@stencil/core'; | ||
|
||
import { Component, h, Host, Prop } from '@stencil/core'; | ||
import { Themes } from '../theme-provider/theme-provider'; | ||
@Component({ | ||
tag: 'bds-carousel-item', | ||
styleUrl: 'carousel.scss', | ||
styleUrl: 'carousel-item.scss', | ||
shadow: true, | ||
}) | ||
export class BdsCarouselItem { | ||
/** | ||
* Set what theme will be aplyed inside the component. | ||
* 'light', 'dark'; | ||
*/ | ||
@Prop() theme?: Themes = 'light'; | ||
|
||
@Prop() bgImage?: string; | ||
|
||
@Prop() bgImageBrightness?: number = 1; | ||
|
||
@Prop() bgColor?: string; | ||
|
||
render(): HTMLElement { | ||
return <slot />; | ||
return ( | ||
<Host class="carrosel-item"> | ||
<bds-theme-provider theme={this.theme} class="carrosel-item-frame" style={{ background: this.bgColor }}> | ||
{this.bgImage && ( | ||
<bds-image | ||
class="image-bg" | ||
alt="Example of a image" | ||
width="100%" | ||
height="100%" | ||
brightness={this.bgImageBrightness} | ||
object-fit="cover" | ||
src={this.bgImage} | ||
/> | ||
)} | ||
<slot /> | ||
</bds-theme-provider> | ||
</Host> | ||
); | ||
} | ||
} |
Oops, something went wrong.