Skip to content

Commit

Permalink
fix(list-header): add and document custom properties
Browse files Browse the repository at this point in the history
references #14850
references #14853
references #14808
  • Loading branch information
camwiegert committed Sep 7, 2018
1 parent bf486e2 commit 5ccc1fd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/src/components/list-header/list-header.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// --------------------------------------------------

:host {
--ion-color-base: #{$list-ios-header-background-color};
--ion-color-contrast: #{$list-ios-header-color};
--background: #{$list-ios-header-background-color};
--color: #{$list-ios-header-color};

@include padding-horizontal($list-ios-header-padding-start, null);

Expand Down
4 changes: 2 additions & 2 deletions core/src/components/list-header/list-header.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// --------------------------------------------------

:host {
--ion-color-base: transparent;
--ion-color-contrast: #{$list-md-header-color};
--background: transparent;
--color: #{$list-md-header-color};

@include padding-horizontal($list-md-header-padding-start, null);
@include margin(null, null, $list-md-header-margin-bottom, null);
Expand Down
14 changes: 12 additions & 2 deletions core/src/components/list-header/list-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
// --------------------------------------------------

:host {
/**
* @prop --background: Background of the list header
* @prop --color: Color of the list header text
*/

@include font-smoothing();
@include margin(0);
@include padding(0);
Expand All @@ -17,8 +22,13 @@
width: 100%;
min-height: 40px;

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

overflow: hidden;
}

:host(.ion-color) {
background: current-color(base);
color: current-color(contrast);
}
8 changes: 8 additions & 0 deletions core/src/components/list-header/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ Unlike ItemDivider, ListHeaders are styled to be stand-out from the rest of the
| `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 list header |
| `--color` | Color of the list header text |


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

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

0 comments on commit 5ccc1fd

Please sign in to comment.