Skip to content

Commit

Permalink
fix(input): add and document custom properties
Browse files Browse the repository at this point in the history
references #14850
  • Loading branch information
camwiegert committed Oct 5, 2018
1 parent 4fd817c commit 23df042
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
20 changes: 18 additions & 2 deletions core/src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
// --------------------------------------------------

:host {
/**
* @prop --background: Background of the input
* @prop --color: Color of the input text
* @prop --padding-top: Top padding of the input
* @prop --padding-end: End padding of the input
* @prop --padding-bottom: Bottom padding of the input
* @prop --padding-start: Start padding of the input
* @prop --placeholder-color: Color of the input placeholder text
* @prop --placeholder-font-style: Font style of the input placeholder text
* @prop --placeholder-font-weight: Font weight of the input placeholder text
* @prop --placeholder-opacity: Opacity of the input placeholder text
*/
--placeholder-color: currentColor;
--placeholder-font-style: inherit;
--placeholder-font-weight: inherit;
Expand All @@ -12,7 +24,8 @@
--padding-end: 0;
--padding-bottom: 0;
--padding-start: 0;
--border-radius: 0;
--background: transparent;
--color: inherit;

display: flex;
position: relative;
Expand All @@ -22,6 +35,9 @@

width: 100%;

background: var(--background);
color: var(--color);

/* stylelint-disable */
/* TODO: find a better solution in padding.css, that does not require !important, */
padding: 0 !important;
Expand All @@ -31,7 +47,7 @@
}

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

// Native Text Input
Expand Down
16 changes: 16 additions & 0 deletions core/src/components/input/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ It is meant for text `type` inputs only, such as `"text"`, `"password"`, `"email
| `setFocus` | |


## CSS Custom Properties

| Name | Description |
| --------------------------- | ----------------------------------------- |
| `--background` | Background of the input |
| `--color` | Color of the input text |
| `--padding-bottom` | Bottom padding of the input |
| `--padding-end` | End padding of the input |
| `--padding-start` | Start padding of the input |
| `--padding-top` | Top padding of the input |
| `--placeholder-color` | Color of the input placeholder text |
| `--placeholder-font-style` | Font style of the input placeholder text |
| `--placeholder-font-weight` | Font weight of the input placeholder text |
| `--placeholder-opacity` | Opacity of the input placeholder text |


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

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

0 comments on commit 23df042

Please sign in to comment.