mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
537 lines
11 KiB
SCSS
537 lines
11 KiB
SCSS
|
|
/**
|
|
* Items
|
|
* --------------------------------------------------
|
|
*/
|
|
|
|
.item {
|
|
@include item-style-active($light, $dark, $dark);
|
|
position: relative;
|
|
|
|
z-index: 2; // Make sure the borders and stuff don't get hidden by children
|
|
display: block;
|
|
margin: $item-border-width * -1;
|
|
|
|
padding: $item-padding;
|
|
|
|
border-width: $item-border-width;
|
|
border-style: $item-border-style;
|
|
border-color: $item-border-color;
|
|
background-color: $list-bg;
|
|
font-size: $list-font-size;
|
|
|
|
-webkit-transition: margin-left 0.2s ease-in-out, margin-right 0.2s ease-in-out, left 0.2s ease-in-out;
|
|
|
|
h2 {
|
|
margin: 0 0 4px 0;
|
|
font-size: 16px;
|
|
}
|
|
h3 {
|
|
margin: 0 0 4px 0;
|
|
font-size: 14px;
|
|
}
|
|
h4 {
|
|
margin: 0 0 4px 0;
|
|
font-size: 12px;
|
|
}
|
|
h5, h6 {
|
|
margin: 0 0 3px 0;
|
|
font-size: 10px;
|
|
}
|
|
p {
|
|
color: #666;
|
|
font-size: 14px;
|
|
}
|
|
|
|
h1:last-child,
|
|
h2:last-child,
|
|
h3:last-child,
|
|
h4:last-child,
|
|
h5:last-child,
|
|
h6:last-child,
|
|
p:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
// Align badges within list items
|
|
.badge {
|
|
float: right;
|
|
}
|
|
.badge + .badge {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
// Active class on item itself, not parent
|
|
&.active,
|
|
&.active:hover,
|
|
&.active:focus {
|
|
z-index: 2;
|
|
|
|
// Force color to inherit for custom content
|
|
.item-heading {
|
|
color: inherit;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Different themes for list items
|
|
.item-primary { @include item-style-active($primary, $dark, #fff); }
|
|
.item-secondary { @include item-style-active($secondary, $dark, $dark); }
|
|
.item-tertiary { @include item-style-active($tertiary, $dark, $dark); }
|
|
.item-positive { @include item-style-active($positive, $dark, #fff); }
|
|
.item-calm { @include item-style-active($calm, $dark, #fff); }
|
|
.item-balanced { @include item-style-active($balanced, $dark, #fff); }
|
|
.item-energized { @include item-style-active($energized, $dark, #fff); }
|
|
.item-royal { @include item-style-active($royal, $dark, #fff); }
|
|
.item-light { @include item-style-active($light, $dark, #fff); }
|
|
.item-stable { @include item-style-active($stable, $dark, #fff); }
|
|
.item-dark { @include item-style-active($dark, $dark, #fff); }
|
|
|
|
// Handle text overflow
|
|
.item,
|
|
.item h1,
|
|
.item h2,
|
|
.item h3,
|
|
.item h4,
|
|
.item h5,
|
|
.item h6,
|
|
.item p,
|
|
.item-content,
|
|
.item-content h1,
|
|
.item-content h2,
|
|
.item-content h3,
|
|
.item-content h4,
|
|
.item-content h5,
|
|
.item-content h6,
|
|
.item-content p {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
// Linked list items
|
|
a.item {
|
|
color: inherit;
|
|
text-decoration: none;
|
|
|
|
&:hover,
|
|
&:focus {
|
|
text-decoration: none;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* Complex Items
|
|
* --------------------------------------------------
|
|
* Adding .item-complex allows the .item to be slidable and
|
|
* have options underneath the button, but also requires an
|
|
* additional .item-content element inside .item.
|
|
* Basically .item-complex removes any default settings which
|
|
* .item added, so that .item-content looks them as just .item.
|
|
*/
|
|
|
|
.item-complex,
|
|
a.item.item-complex,
|
|
button.item.item-complex {
|
|
padding: 0;
|
|
}
|
|
.item-complex .item-content,
|
|
.item-radio .item-content {
|
|
/**
|
|
* The content area of a complex list item. This area can
|
|
* Slide left and right and be dragged to support different
|
|
* UI interactions.
|
|
*/
|
|
position: relative;
|
|
|
|
z-index: 2;
|
|
padding: $item-padding (($item-padding * 3) - 5) $item-padding $item-padding;
|
|
|
|
border: none;
|
|
background-color: $list-bg;
|
|
|
|
-webkit-transition: margin-left 0.2s ease-in-out, margin-right 0.2s ease-in-out, left 0.2s ease-in-out;
|
|
}
|
|
|
|
.item-text-wrap,
|
|
.item-text-wrap h1,
|
|
.item-text-wrap h2,
|
|
.item-text-wrap h3,
|
|
.item-text-wrap h4,
|
|
.item-text-wrap h5,
|
|
.item-text-wrap h6,
|
|
.item-text-wrap p,
|
|
.item-complex.item-text-wrap .item-content,
|
|
.item-body h1,
|
|
.item-body h2,
|
|
.item-body h3,
|
|
.item-body h4,
|
|
.item-body h5,
|
|
.item-body h6,
|
|
.item-body p {
|
|
overflow: auto;
|
|
white-space: normal;
|
|
}
|
|
.item-complex.item-text-wrap,
|
|
.item-complex.item-text-wrap h1,
|
|
.item-complex.item-text-wrap h2,
|
|
.item-complex.item-text-wrap h3,
|
|
.item-complex.item-text-wrap h4,
|
|
.item-complex.item-text-wrap h5,
|
|
.item-complex.item-text-wrap h6,
|
|
.item-complex.item-text-wrap p {
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
|
|
/**
|
|
* Item Icons
|
|
* --------------------------------------------------
|
|
*/
|
|
|
|
.item-icon-left .icon,
|
|
.item-icon-right .icon {
|
|
@include display-flex();
|
|
@include align-items(center);
|
|
position: absolute;
|
|
top: 0;
|
|
height: 100%;
|
|
font-size: $item-icon-font-size;
|
|
}
|
|
|
|
.item .fill-icon {
|
|
min-width: $item-icon-fill-font-size + 2;
|
|
min-height: $item-icon-fill-font-size + 2;
|
|
font-size: $item-icon-fill-font-size;
|
|
}
|
|
|
|
.item-icon-left {
|
|
padding-left: ($item-padding * 3);
|
|
|
|
.icon {
|
|
left: $item-padding / 2;
|
|
}
|
|
}
|
|
.item-complex.item-icon-left {
|
|
padding-left: 0;
|
|
|
|
.item-content {
|
|
padding-left: ($item-padding * 3);
|
|
}
|
|
}
|
|
|
|
.item-icon-right .icon {
|
|
right: $item-padding / 2;
|
|
}
|
|
|
|
.item-icon-left.item-icon-right .icon:first-child {
|
|
right: auto;
|
|
}
|
|
.item-icon-left.item-icon-right .icon:last-child {
|
|
left: auto;
|
|
}
|
|
|
|
|
|
/**
|
|
* Item Button
|
|
* --------------------------------------------------
|
|
* An item button is a child button inside an .item (not the entire .item)
|
|
*/
|
|
|
|
.item-button-left {
|
|
padding-left: $item-padding * 5;
|
|
}
|
|
|
|
.item-button-left > .button,
|
|
.item-button-left .item-content > .button {
|
|
@include display-flex();
|
|
@include align-items(center);
|
|
position: absolute;
|
|
top: $item-padding / 2;
|
|
left: $item-padding / 2;
|
|
min-height: $item-icon-font-size;
|
|
font-size: $item-icon-font-size;
|
|
|
|
.icon {
|
|
position: relative;
|
|
left: auto;
|
|
line-height: $item-icon-font-size - 1;
|
|
}
|
|
}
|
|
|
|
.item-button-right,
|
|
a.item.item-button-right,
|
|
button.item.item-button-right {
|
|
padding-right: $item-padding * 5;
|
|
}
|
|
|
|
.item-button-right > .button,
|
|
.item-button-right .item-content > .button {
|
|
@include display-flex();
|
|
@include align-items(center);
|
|
position: absolute;
|
|
top: $item-padding / 2;
|
|
right: $item-padding;
|
|
min-height: $item-icon-font-size;
|
|
font-size: $item-icon-font-size;
|
|
|
|
.icon {
|
|
position: relative;
|
|
left: auto;
|
|
line-height: $item-icon-font-size - 1;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* Auto Right Arrow Icon
|
|
* --------------------------------------------------
|
|
* By default, if an .item is created out of an <a> or <button>
|
|
* then a arrow will be added to the right side of the item.
|
|
*/
|
|
|
|
a.item,
|
|
button.item {
|
|
padding-right: (($item-padding * 3) - 5);
|
|
}
|
|
|
|
a.item:after,
|
|
button.item:after {
|
|
/* By default, both <a> and <button> have right side arrow icons */
|
|
@include display-flex();
|
|
@include align-items(center);
|
|
position: absolute;
|
|
top: 0;
|
|
right: $item-padding - 4;
|
|
height: 100%;
|
|
color: #ccc;
|
|
content: "\f125"; // ion-chevron-right
|
|
text-transform: none;
|
|
font-weight: normal;
|
|
font-style: normal;
|
|
font-variant: normal;
|
|
font-size: 16px;
|
|
font-family: 'Ionicons';
|
|
line-height: 1;
|
|
speak: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
// do not show the default right arrow when they want their own right side icon
|
|
a.item-icon-right:after,
|
|
button.item-icon-right:after,
|
|
a.item-button-right:after,
|
|
button.item-button-right:after {
|
|
display: none;
|
|
}
|
|
|
|
|
|
// Item Avatar
|
|
// -------------------------------
|
|
|
|
.item-avatar {
|
|
padding-left: $item-avitar-width + ($item-padding * 2);
|
|
min-height: $item-avitar-width + ($item-padding * 2);
|
|
|
|
img:first-child, .item-img {
|
|
position: absolute;
|
|
top: $item-padding;
|
|
left: $item-padding;
|
|
max-width: $item-avitar-width;
|
|
max-height: $item-avitar-height;
|
|
width: 100%;
|
|
border-radius: 4px;
|
|
}
|
|
}
|
|
|
|
|
|
// Item Thumbnails
|
|
// -------------------------------
|
|
|
|
.item-thumbnail-left {
|
|
padding-left: $item-thumbnail-width + $item-thumbnail-margin + $item-padding;
|
|
min-height: $item-thumbnail-height + ($item-thumbnail-margin * 2);
|
|
|
|
img:first-child, .item-image {
|
|
position: absolute;
|
|
top: $item-thumbnail-margin;
|
|
left: $item-thumbnail-margin;
|
|
max-width: $item-thumbnail-width;
|
|
max-height: $item-thumbnail-height;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
.item-thumbnail-right {
|
|
padding-right: $item-thumbnail-width + $item-thumbnail-margin + $item-padding;
|
|
min-height: $item-thumbnail-height + ($item-thumbnail-margin * 2);
|
|
|
|
img:first-child, .item-image {
|
|
position: absolute;
|
|
top: $item-thumbnail-margin;
|
|
right: $item-thumbnail-margin;
|
|
max-width: $item-thumbnail-width;
|
|
max-height: $item-thumbnail-height;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
|
|
// Item Image
|
|
// -------------------------------
|
|
|
|
.item-image {
|
|
padding: 0;
|
|
text-align: center;
|
|
|
|
img:first-child, .list-img {
|
|
width: 100%;
|
|
vertical-align: middle;
|
|
}
|
|
}
|
|
|
|
|
|
// Item Body
|
|
// -------------------------------
|
|
|
|
.item-body {
|
|
overflow: auto;
|
|
padding: $item-padding;
|
|
text-overflow: inherit;
|
|
white-space: normal;
|
|
|
|
h1, h2, h3, h4, h5, h6, p {
|
|
margin-top: $item-padding;
|
|
margin-bottom: $item-padding;
|
|
}
|
|
}
|
|
|
|
|
|
// Item Divider
|
|
// -------------------------------
|
|
|
|
.item-divider {
|
|
padding-top: $item-padding / 2;
|
|
padding-bottom: $item-padding / 2;
|
|
min-height: 30px;
|
|
background-color: $item-divider-bg;
|
|
color: $item-divider-color;
|
|
font-weight: bold;
|
|
}
|
|
|
|
|
|
// Item Note
|
|
// -------------------------------
|
|
|
|
.item-note {
|
|
float: right;
|
|
color: #aaa;
|
|
font-size: 14px;
|
|
}
|
|
|
|
|
|
// Item Animations
|
|
// -------------------------------
|
|
|
|
.item-sliding {
|
|
-webkit-transition: -webkit-transform 0.1s ease-in-out;
|
|
}
|
|
|
|
.item-reordering {
|
|
position: absolute;
|
|
width: 100%;
|
|
}
|
|
|
|
.item-placeholder {
|
|
opacity: 0.7;
|
|
}
|
|
|
|
/**
|
|
* The left-side edit area of a complex list item. This area shows
|
|
* whe the list item is in edit mode.
|
|
*/
|
|
.item-edit {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 8px;
|
|
z-index: 0;
|
|
width: 48px;
|
|
height: 100%;
|
|
line-height: 100%;
|
|
|
|
-webkit-transition: left 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
|
|
|
.button {
|
|
height: 100%;
|
|
.icon, i {
|
|
@include display-flex();
|
|
@include align-items(center);
|
|
position: absolute;
|
|
top: 0;
|
|
height: 100%;
|
|
color: $assertive;
|
|
font-size: 24px;
|
|
}
|
|
}
|
|
|
|
&.ng-enter {
|
|
left: -48px;
|
|
opacity: 0;
|
|
-webkit-transition: left 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
|
}
|
|
&.ng-enter-active {
|
|
left: 8px;
|
|
opacity: 1;
|
|
}
|
|
&.ng-leave {
|
|
left: 0px;
|
|
opacity: 1;
|
|
-webkit-transition: left 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
|
}
|
|
&.ng-leave-active {
|
|
left: -48px;
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
.item-drag {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
z-index: 0;
|
|
height: 100%;
|
|
|
|
.button {
|
|
height: 100%;
|
|
border: none;
|
|
border-radius: 0;
|
|
.icon, i {
|
|
@include display-flex();
|
|
@include align-items(center);
|
|
position: absolute;
|
|
top: 0;
|
|
height: 100%;
|
|
font-size: 24px;
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* The hidden right-side buttons that can be exposed under a list item
|
|
* with dragging.
|
|
*/
|
|
.item-options {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
z-index: 1;
|
|
height: 100%;
|
|
|
|
.button {
|
|
height: 100%;
|
|
border: none;
|
|
border-radius: 0;
|
|
}
|
|
}
|