mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
340 lines
6.9 KiB
SCSS
340 lines
6.9 KiB
SCSS
.list {
|
|
// No need to set list-style: none; since .list-item is block level
|
|
margin-bottom: 20px;
|
|
padding-left: 0; // reset padding because ul and ol
|
|
|
|
position: relative;
|
|
overflow: hidden;
|
|
|
|
@include list-style($list-default-background, $list-default-border, $gray-dark);
|
|
|
|
&.list-success {
|
|
@include list-style($list-success-background, $list-success-border, $white);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* An individual list item.
|
|
*/
|
|
.list-item {
|
|
position: relative;
|
|
display: block;
|
|
// Place the border on the list items and negative margin up for better styling
|
|
margin-bottom: $list-item-border-width * -1;
|
|
margin-left: $list-item-border-width * -1;
|
|
margin-right: $list-item-border-width * -1;
|
|
border-top: $list-item-border-width solid $list-item-border-color;
|
|
|
|
|
|
// Make sure the borders and stuff don't get hidden
|
|
// by children
|
|
z-index: 2;
|
|
|
|
background-color: $list-default-background;
|
|
|
|
&: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
|
|
.list-item-heading {
|
|
color: inherit;
|
|
}
|
|
}
|
|
|
|
// Different themes for list items
|
|
&.list-item-default { @include list-item-style-active($brand-default, $gray-dark, $gray-dark); }
|
|
&.list-item-secondary { @include list-item-style-active($brand-default, $gray-dark, $gray-dark); }
|
|
&.list-item-primary { @include list-item-style-active($brand-primary, $gray-dark, $white); }
|
|
&.list-item-info { @include list-item-style-active($brand-info, $gray-dark, $white); }
|
|
&.list-item-success { @include list-item-style-active($brand-success, $gray-dark, $white); }
|
|
&.list-item-warning { @include list-item-style-active($brand-warning, $gray-dark, $white); }
|
|
&.list-item-danger { @include list-item-style-active($brand-danger, $gray-dark, $white); }
|
|
&.list-item-dark { @include list-item-style-active($brand-dark, $gray-dark, $white); }
|
|
}
|
|
|
|
// Linked list items
|
|
a.list-item {
|
|
color: $gray-dark;
|
|
text-decoration: none;
|
|
|
|
// Hover state
|
|
&:hover,
|
|
&:focus {
|
|
text-decoration: none;
|
|
//background-color: $list-group-hover-bg;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* List editing styles. These trigger when the entire list goes into
|
|
* "edit mode"
|
|
*/
|
|
.list-editing {
|
|
.list-item-content {
|
|
margin-left: 30px;
|
|
margin-right: 30px;
|
|
}
|
|
.list-item-edit {
|
|
left: 0px;
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* The content area of a complex list item. This area can
|
|
* Slide left and right and be dragged to support different
|
|
* UI interactions.
|
|
*/
|
|
.list-item-content {
|
|
position: relative;
|
|
background-color: #fff;
|
|
border: $list-item-border-width solid $list-item-border-color;
|
|
|
|
z-index: 2;
|
|
margin-top: $list-item-border-width * -1;
|
|
padding: $list-item-padding ($list-item-padding * 3) $list-item-padding $list-item-padding;
|
|
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;
|
|
}
|
|
|
|
.list-item-content i {
|
|
position: absolute;
|
|
top: 0;
|
|
display: flex;
|
|
height: 100%;
|
|
font-size: $list-icon-font-size;
|
|
align-items: center;
|
|
}
|
|
|
|
.list-icon-left .list-item-content {
|
|
padding-left: ($list-item-padding * 3);
|
|
|
|
i {
|
|
left: $list-item-padding / 2;
|
|
}
|
|
}
|
|
|
|
.list-icon-right .list-item-content i {
|
|
right: $list-item-padding / 2;
|
|
}
|
|
|
|
.list-icon-left.list-icon-right .list-item-content i:last-child {
|
|
left: auto;
|
|
}
|
|
|
|
a .list-item-content:after,
|
|
button .list-item-content:after {
|
|
position: absolute;
|
|
top: 0;
|
|
right: $list-item-padding;
|
|
display: flex;
|
|
height: 100%;
|
|
color: #ccc;
|
|
content: "\e0fc"; // icon-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;
|
|
align-items: center;
|
|
}
|
|
|
|
// do not show the default right arrow when they want their own right side icon
|
|
a.list-icon-right,
|
|
button.list-icon-right {
|
|
.list-item-content:after {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
|
|
.list-thumbnail h2 {
|
|
overflow: hidden;
|
|
margin: 0 0 8px 0;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.list-thumbnail p {
|
|
overflow: hidden;
|
|
margin-bottom: 0;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.list-thumbnail .list-item-content {
|
|
padding-left: $list-thumbnail-width + $list-item-padding;
|
|
min-height: $list-thumbnail-width;
|
|
|
|
img {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
max-width: $list-thumbnail-width;
|
|
max-height: $list-thumbnail-width;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
.list-item-sliding {
|
|
-webkit-transition: -webkit-transform 0.1s ease-in-out;
|
|
}
|
|
|
|
.list-item-reordering {
|
|
position: absolute;
|
|
width: 100%;
|
|
}
|
|
|
|
.list-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.
|
|
*/
|
|
.list-item-edit {
|
|
position: absolute;
|
|
z-index: 0;
|
|
left: -48px;
|
|
top: 0;
|
|
width: 48px;
|
|
height: 100%;
|
|
line-height: 100%;
|
|
opacity: 0;
|
|
|
|
-webkit-transition: left 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
|
|
|
.button {
|
|
height: 100%;
|
|
}
|
|
|
|
i {
|
|
color: $brand-danger;
|
|
font-size: 24px;
|
|
}
|
|
|
|
|
|
&.ng-enter {
|
|
-webkit-transition: left 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
|
left: -48px;
|
|
opacity: 0;
|
|
}
|
|
&.ng-enter-active {
|
|
opacity: 1;
|
|
left: 0;
|
|
}
|
|
&.ng-leave {
|
|
-webkit-transition: left 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
|
left: 0px;
|
|
opacity: 1;
|
|
}
|
|
&.ng-leave-active {
|
|
opacity: 0;
|
|
left: -48px;
|
|
}
|
|
}
|
|
|
|
.list-item-drag {
|
|
position: absolute;
|
|
z-index: 0;
|
|
right: 0;
|
|
top: 0;
|
|
height: 100%;
|
|
|
|
.button {
|
|
height: 100%;
|
|
border-radius: 0;
|
|
border: none;
|
|
}
|
|
}
|
|
/**
|
|
* The hidden right-side buttons that can be exposed under a list item
|
|
* with dragging.
|
|
*/
|
|
.list-item-buttons {
|
|
position: absolute;
|
|
z-index: 1;
|
|
right: 0;
|
|
top: 0;
|
|
height: 100%;
|
|
|
|
.button {
|
|
height: 100%;
|
|
border-radius: 0;
|
|
border: none;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* A list header.
|
|
*/
|
|
.list-header {
|
|
padding: $list-header-padding;
|
|
margin-top: $list-header-margin-top;
|
|
background-color: $list-header-bg;
|
|
color: $list-header-color;
|
|
font-weight: bold;
|
|
}
|
|
|
|
|
|
/**
|
|
* A list divider.
|
|
*/
|
|
.list-divider {
|
|
padding: $list-divider-padding;
|
|
background-color: $list-divider-bg;
|
|
color: $list-divider-color;
|
|
font-weight: bold;
|
|
}
|
|
|
|
// inset so they layout the same as list items
|
|
.list-divider,
|
|
.list-header {
|
|
margin-left: $list-item-border-width * -1;
|
|
margin-right: $list-item-border-width * -1;
|
|
}
|
|
|
|
// make sure these have left/right borders when inset
|
|
.padding .list-divider,
|
|
.padding .list-heading {
|
|
border-left: $list-item-border-width solid $list-item-border-color;
|
|
border-right: $list-item-border-width solid $list-item-border-color;
|
|
}
|
|
|
|
/**
|
|
* List refreser elements
|
|
*/
|
|
.list-refresher {
|
|
background-color: red;
|
|
height: 0;
|
|
overflow: hidden;
|
|
}
|
|
.list-refreshing {
|
|
}
|