@ionic/core
Version:
Base components for Ionic
462 lines (402 loc) • 13.9 kB
CSS
:host {
/**
* @prop --background: Background of the item
* @prop --background-activated: Background of the activated item
* @prop --border-color: Color of the item border
* @prop --border-radius: Radius of the item border
* @prop --border-style: Style of the item border
* @prop --border-width: Width of the item border
* @prop --box-shadow: Box shadow of the item
* @prop --color: Color of the item
*
* @prop --detail-icon-color: Color of the item detail icon
* @prop --detail-icon-opacity: Opacity of the item detail icon
* @prop --detail-icon-font-size: Font size of the item detail icon
* @prop --inner-border-width: Width of the item inner border
* @prop --inner-box-shadow: Box shadow of the item inner
* @prop --inner-padding-bottom: Bottom padding of the item inner
* @prop --inner-padding-end: End padding of the item inner
* @prop --inner-padding-start: Start padding of the item inner
* @prop --inner-padding-top: Top padding of the item inner
*
* @prop --min-height: Minimum height of the item
* @prop --padding-bottom: Bottom padding of the item
* @prop --padding-end: End padding of the item
* @prop --padding-start: Start padding of the item
* @prop --padding-top: Top padding of the item
* @prop --transition: Transition of the item
*
* @prop --highlight-height: The height of the highlight on the item
* @prop --highlight-color-focused: The color of the highlight on the item when focused
* @prop --highlight-color-valid: The color of the highlight on the item when valid
* @prop --highlight-color-invalid: The color of the highlight on the item when invalid
*/
--border-radius: 0px;
--border-width: 0px;
--border-style: solid;
--padding-top: 0px;
--padding-bottom: 0px;
--padding-end: 0px;
--padding-start: 0px;
--box-shadow: none;
--inner-border-width: 0px;
--inner-padding-top: 0px;
--inner-padding-bottom: 0px;
--inner-padding-start: 0px;
--inner-padding-end: 0px;
--inner-box-shadow: none;
--show-full-highlight: 0;
--show-inset-highlight: 0;
--detail-icon-color: initial;
--detail-icon-font-size: 20px;
--detail-icon-opacity: 0.25;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: block;
position: relative;
outline: none;
color: var(--color);
font-family: var(--ion-font-family, inherit);
text-align: initial;
text-decoration: none;
box-sizing: border-box; }
:host(.ion-color) .item-native {
background: var(--ion-color-base);
color: var(--ion-color-contrast); }
:host(.ion-color) .item-native,
:host(.ion-color) .item-inner {
border-color: var(--ion-color-shade); }
:host(.ion-focused) .item-native {
background: var(--background-focused); }
:host(.activated) .item-native {
background: var(--background-activated); }
:host(.ion-color.activated) .item-native {
background: var(--ion-color-tint); }
:host(.item-disabled) {
cursor: default;
opacity: .3;
pointer-events: none; }
.item-native {
border-radius: var(--border-radius);
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
padding-left: calc(var(--padding-start) + var(--ion-safe-area-left, 0px));
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-overflow: inherit;
text-transform: inherit;
text-align: inherit;
white-space: inherit;
color: inherit;
display: flex;
position: relative;
align-items: center;
justify-content: space-between;
width: 100%;
min-height: var(--min-height);
transition: var(--transition);
border-width: var(--border-width);
border-style: var(--border-style);
border-color: var(--border-color);
outline: none;
background: var(--background);
box-shadow: var(--box-shadow);
overflow: hidden;
box-sizing: border-box; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
.item-native {
padding-left: unset;
padding-right: unset;
-webkit-padding-start: calc(var(--padding-start) + var(--ion-safe-area-left, 0px));
padding-inline-start: calc(var(--padding-start) + var(--ion-safe-area-left, 0px));
-webkit-padding-end: var(--padding-end);
padding-inline-end: var(--padding-end); } }
.item-native::-moz-focus-inner {
border: 0; }
button, a {
cursor: pointer;
user-select: none;
-webkit-user-drag: none; }
.item-inner {
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
padding-left: var(--inner-padding-start);
padding-right: calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));
padding-top: var(--inner-padding-top);
padding-bottom: var(--inner-padding-bottom);
display: flex;
flex: 1;
flex-direction: inherit;
align-items: inherit;
align-self: stretch;
min-height: inherit;
border-width: var(--inner-border-width);
border-style: var(--border-style);
border-color: var(--border-color);
box-shadow: var(--inner-box-shadow);
overflow: hidden;
box-sizing: border-box; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
.item-inner {
padding-left: unset;
padding-right: unset;
-webkit-padding-start: var(--inner-padding-start);
padding-inline-start: var(--inner-padding-start);
-webkit-padding-end: calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));
padding-inline-end: calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end)); } }
.item-detail-icon {
color: var(--detail-icon-color);
font-size: var(--detail-icon-font-size);
opacity: var(--detail-icon-opacity); }
::slotted(ion-icon) {
font-size: 1.6em; }
::slotted(ion-button) {
--margin-top: 0;
--margin-bottom: 0;
--margin-start: 0;
--margin-end: 0;
z-index: 1; }
::slotted(ion-label) {
flex: 1; }
:host([vertical-align-top]),
:host(.item-input) {
align-items: flex-start; }
.input-wrapper {
display: flex;
flex: 1;
flex-direction: inherit;
align-items: inherit;
align-self: stretch;
text-overflow: ellipsis;
overflow: hidden;
box-sizing: border-box; }
:host(.item-label-stacked) .input-wrapper,
:host(.item-label-floating) .input-wrapper {
flex: 1;
flex-direction: column; }
.item-highlight,
.item-inner-highlight {
left: 0;
right: 0;
bottom: 0;
position: absolute;
background: var(--highlight-background); }
.item-highlight {
height: var(--full-highlight-height); }
.item-inner-highlight {
height: var(--inset-highlight-height); }
:host(.item-interactive.item-has-focus),
:host(.item-interactive.ion-touched.ion-invalid) {
--full-highlight-height: calc(var(--highlight-height) * var(--show-full-highlight));
--inset-highlight-height: calc(var(--highlight-height) * var(--show-inset-highlight)); }
:host(.item-interactive.item-has-focus) {
--highlight-background: var(--highlight-color-focused); }
:host(.item-interactive.ion-valid) {
--highlight-background: var(--highlight-color-valid); }
:host(.item-interactive.ion-invalid) {
--highlight-background: var(--highlight-color-invalid); }
:host(.item-label-stacked) ::slotted(ion-select),
:host(.item-label-floating) ::slotted(ion-select) {
--padding-start: 0;
align-self: stretch;
width: 100%;
max-width: 100%; }
:host(.item-label-stacked) ::slotted(ion-datetime),
:host(.item-label-floating) ::slotted(ion-datetime) {
--padding-start: 0;
width: 100%; }
:host(.item-multiple-inputs) ::slotted(ion-datetime),
:host(.item-multiple-inputs) ::slotted(ion-select) {
position: relative; }
:host(.item-textarea) {
align-items: stretch; }
::slotted(ion-reorder[slot]) {
margin-top: 0;
margin-bottom: 0; }
:host {
--min-height: 48px;
--background: var(--ion-item-background, var(--ion-background-color, #fff));
--background-activated: var(--background);
--background-focused: var(--ion-item-background-activated, #f1f1f1);
--border-color: var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));
--color: var(--ion-item-color, var(--ion-text-color, #000));
--transition: background-color 300ms cubic-bezier(.4, 0, .2, 1);
--padding-start: 16px;
--color: var(--ion-item-color, var(--ion-text-color, #000));
--border-color: var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));
--inner-padding-end: 16px;
--inner-border-width: 0 0 1px 0;
--highlight-height: 2px;
--highlight-color-focused: var(--ion-color-primary, #3880ff);
--highlight-color-valid: var(--ion-color-success, #10dc60);
--highlight-color-invalid: var(--ion-color-danger, #f04141);
font-size: 16px;
font-weight: normal;
text-transform: none; }
:host(.item-interactive) {
--border-width: 0 0 1px 0;
--inner-border-width: 0;
--show-full-highlight: 1;
--show-inset-highlight: 0; }
:host(.item-lines-full) {
--border-width: 0 0 1px 0;
--show-full-highlight: 1;
--show-inset-highlight: 0; }
:host(.item-lines-inset) {
--inner-border-width: 0 0 1px 0;
--show-full-highlight: 0;
--show-inset-highlight: 1; }
:host(.item-lines-inset),
:host(.item-lines-none) {
--border-width: 0;
--show-full-highlight: 0; }
:host(.item-lines-full),
:host(.item-lines-none) {
--inner-border-width: 0;
--show-inset-highlight: 0; }
:host(.item-multi-line) ::slotted([slot="start"]),
:host(.item-multi-line) ::slotted([slot="end"]) {
margin-top: 16px;
margin-bottom: 16px;
align-self: flex-start; }
::slotted([slot="start"]) {
margin-right: 32px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted([slot="start"]) {
margin-right: unset;
-webkit-margin-end: 32px;
margin-inline-end: 32px; } }
::slotted([slot="end"]) {
margin-left: 32px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted([slot="end"]) {
margin-left: unset;
-webkit-margin-start: 32px;
margin-inline-start: 32px; } }
::slotted(ion-icon) {
color: rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);
font-size: 24px; }
::slotted(ion-icon[slot]) {
margin-top: 12px;
margin-bottom: 12px; }
::slotted(ion-icon[slot="start"]) {
margin-right: 32px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted(ion-icon[slot="start"]) {
margin-right: unset;
-webkit-margin-end: 32px;
margin-inline-end: 32px; } }
::slotted(ion-icon[slot="end"]) {
margin-left: 16px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted(ion-icon[slot="end"]) {
margin-left: unset;
-webkit-margin-start: 16px;
margin-inline-start: 16px; } }
::slotted(ion-toggle[slot="start"]),
::slotted(ion-toggle[slot="end"]) {
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0; }
::slotted(ion-note) {
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
align-self: flex-start;
font-size: 11px; }
::slotted(ion-note[slot]) {
padding-left: 0;
padding-right: 0;
padding-top: 18px;
padding-bottom: 10px; }
::slotted(ion-note[slot="start"]) {
padding-right: 16px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted(ion-note[slot="start"]) {
padding-right: unset;
-webkit-padding-end: 16px;
padding-inline-end: 16px; } }
::slotted(ion-note[slot="end"]) {
padding-left: 16px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted(ion-note[slot="end"]) {
padding-left: unset;
-webkit-padding-start: 16px;
padding-inline-start: 16px; } }
::slotted(ion-avatar) {
width: 40px;
height: 40px; }
::slotted(ion-thumbnail) {
width: 56px;
height: 56px; }
::slotted(ion-avatar),
::slotted(ion-thumbnail) {
margin-top: 8px;
margin-bottom: 8px; }
::slotted(ion-avatar[slot="start"]),
::slotted(ion-thumbnail[slot="start"]) {
margin-right: 16px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted(ion-avatar[slot="start"]),
::slotted(ion-thumbnail[slot="start"]) {
margin-right: unset;
-webkit-margin-end: 16px;
margin-inline-end: 16px; } }
::slotted(ion-avatar[slot="end"]),
::slotted(ion-thumbnail[slot="end"]) {
margin-left: 16px; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
::slotted(ion-avatar[slot="end"]),
::slotted(ion-thumbnail[slot="end"]) {
margin-left: unset;
-webkit-margin-start: 16px;
margin-inline-start: 16px; } }
::slotted(ion-label) {
margin-left: 0;
margin-right: 0;
margin-top: 11px;
margin-bottom: 10px; }
:host(.item-label-stacked) ::slotted([slot="end"]),
:host(.item-label-floating) ::slotted([slot="end"]) {
margin-top: 7px;
margin-bottom: 7px; }
:host(.item-toggle) ::slotted(ion-label),
:host(.item-radio) ::slotted(ion-label) {
margin-left: 0; }
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
:host(.item-toggle) ::slotted(ion-label),
:host(.item-radio) ::slotted(ion-label) {
margin-left: unset;
-webkit-margin-start: 0;
margin-inline-start: 0; } }
::slotted(.button-small) {
--padding-top: 0;
--padding-bottom: 0;
--padding-start: .6em;
--padding-end: .6em;
height: 25px;
font-size: 12px; }
:host(.item-label-floating),
:host(.item-label-stacked) {
--min-height: 65px; }
:host(.item-label-stacked) ::slotted(ion-select),
:host(.item-label-floating) ::slotted(ion-select) {
--padding-top: 8px;
--padding-bottom: 8px;
--padding-start: 0; }
:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked),
:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating) {
color: var(--ion-color-primary, #3880ff); }