Skip to content

Commit

Permalink
fix(item-option): add and document custom properties
Browse files Browse the repository at this point in the history
references #14850
references #14808
closes #14943
  • Loading branch information
camwiegert committed Sep 20, 2018
1 parent 8359444 commit 2a040e0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
8 changes: 8 additions & 0 deletions core/src/components/item-option/item-option.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
font-size: $item-option-button-ios-font-size;
}

:host(.activated) {
background: ion-color(primary, shade);
}

:host(.ion-color.activated) {
background: current-color(shade);
}

:host(.in-list.item-options-end:last-child) {
@include safe-area-padding-horizontal(null, .7em);
}
Expand Down
17 changes: 13 additions & 4 deletions core/src/components/item-option/item-option.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@
// --------------------------------------------------

:host {
--ion-color-base: #{ion-color(primary, base)};
--ion-color-contrast: #{ion-color(primary, contrast)};
/**
* @prop --background: Background of the item option
* @prop --color: Color of the item option
*/
--background: #{ion-color(primary, base)};
--color: #{ion-color(primary, contrast)};

background: #{current-color(base)};
color: #{current-color(contrast)};
background: var(--background);
color: var(--color);

font-family: $font-family-base;
}

:host(.ion-color) {
background: current-color(base);
color: current-color(contrast);
}

.item-option-native {
@include text-inherit();
@include padding(0, .7em);
Expand Down
8 changes: 8 additions & 0 deletions core/src/components/item-option/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ action for the item.
| `mode` | `mode` | The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`. | `Mode` |


## CSS Custom Properties

| Name | Description |
| -------------- | ----------------------------- |
| `--background` | Background of the item option |
| `--color` | Color of the item option |


----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*

0 comments on commit 2a040e0

Please sign in to comment.