@ionic/core
Version:
Base components for Ionic
162 lines (150 loc) • 3.95 kB
CSS
:host {
/**
* @prop --background: Background of the textarea
*
* @prop --border-radius: Border radius of the textarea
*
* @prop --color: Color of the text
*
* @prop --placeholder-color: Color of the placeholder text
* @prop --placeholder-font-style: Style of the placeholder text
* @prop --placeholder-font-weight: Weight of the placeholder text
* @prop --placeholder-opacity: Opacity of the placeholder text
*
* @prop --padding-top: Top padding of the textarea
* @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the textarea
* @prop --padding-bottom: Bottom padding of the textarea
* @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the textarea
*/
--background: initial;
--color: initial;
--placeholder-color: initial;
--placeholder-font-style: initial;
--placeholder-font-weight: initial;
--placeholder-opacity: .5;
--padding-top: 0;
--padding-end: 0;
--padding-bottom: 0;
--padding-start: 0;
--border-radius: 0;
display: block;
position: relative;
flex: 1;
width: 100%;
background: var(--background);
color: var(--color);
font-family: var(--ion-font-family, inherit);
white-space: pre-wrap;
z-index: 2;
box-sizing: border-box;
}
:host(.ion-color) {
background: initial;
}
:host(.ion-color) {
color: var(--ion-color-base);
}
:host-context(ion-item) {
align-self: baseline;
}
:host-context(ion-item:not(.item-label)) {
--padding-start: 0;
}
.textarea-wrapper {
min-width: inherit;
max-width: inherit;
min-height: inherit;
max-height: inherit;
}
.native-textarea {
border-radius: var(--border-radius);
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
padding-left: var(--padding-start);
padding-right: var(--padding-end);
padding-top: var(--padding-top);
padding-bottom: var(--padding-bottom);
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
letter-spacing: inherit;
text-decoration: inherit;
text-indent: inherit;
text-overflow: inherit;
text-transform: inherit;
text-align: inherit;
white-space: inherit;
color: inherit;
display: block;
width: 100%;
max-width: 100%;
max-height: 100%;
border: 0;
outline: none;
background: transparent;
box-sizing: border-box;
resize: none;
appearance: none;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
.native-textarea {
padding-left: unset;
padding-right: unset;
-webkit-padding-start: var(--padding-start);
padding-inline-start: var(--padding-start);
-webkit-padding-end: var(--padding-end);
padding-inline-end: var(--padding-end);
}
}
.native-textarea::placeholder {
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
color: var(--placeholder-color);
font-family: inherit;
font-style: var(--placeholder-font-style);
font-weight: var(--placeholder-font-weight);
opacity: var(--placeholder-opacity);
}
.native-textarea[disabled] {
opacity: 0.4;
}
.cloned-input {
left: 0;
top: 0;
position: absolute;
pointer-events: none;
}
[dir=rtl] .cloned-input, :host-context([dir=rtl]) .cloned-input {
left: unset;
right: unset;
right: 0;
}
:host-context(.item-label-floating.item-has-placeholder:not(.item-has-value)) {
opacity: 0;
}
:host-context(.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus) {
transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
opacity: 1;
}
:host {
--padding-top: 10px;
--padding-end: 0;
--padding-bottom: 11px;
--padding-start: 8px;
margin-left: 0;
margin-right: 0;
margin-top: 8px;
margin-bottom: 0;
font-size: inherit;
}
:host-context(.item-label-stacked),
:host-context(.item-label-floating) {
--padding-top: 8px;
--padding-bottom: 8px;
--padding-start: 0;
}