mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
312 lines
6.8 KiB
SCSS
312 lines
6.8 KiB
SCSS
|
|
// iOS List
|
|
// --------------------------------------------------
|
|
|
|
$list-ios-margin-top: 10px !default;
|
|
$list-ios-margin-right: 0 !default;
|
|
$list-ios-margin-bottom: 32px !default;
|
|
$list-ios-margin-left: 0 !default;
|
|
|
|
$list-inset-ios-margin-top: 16px !default;
|
|
$list-inset-ios-margin-right: 16px !default;
|
|
$list-inset-ios-margin-bottom: 16px !default;
|
|
$list-inset-ios-margin-left: 16px !default;
|
|
$list-inset-ios-border-radius: 4px !default;
|
|
|
|
$list-ios-header-padding: 10px $item-ios-padding-right 10px $item-ios-padding-left !default;
|
|
$list-ios-header-font-size: 1.2rem !default;
|
|
$list-ios-header-font-weight: 500 !default;
|
|
$list-ios-header-letter-spacing: 0.1rem !default;
|
|
$list-ios-header-color: #333 !default;
|
|
|
|
|
|
/****************/
|
|
/* DEFAULT LIST */
|
|
/****************/
|
|
|
|
.list {
|
|
margin: -1px $list-ios-margin-right $list-ios-margin-bottom $list-ios-margin-left;
|
|
|
|
ion-header {
|
|
position: relative;
|
|
padding: $list-ios-header-padding;
|
|
font-size: $list-ios-header-font-size;
|
|
font-weight: $list-ios-header-font-weight;
|
|
letter-spacing: $list-ios-header-letter-spacing;
|
|
text-transform: uppercase;
|
|
color: $list-ios-header-color;
|
|
}
|
|
|
|
// Apply the border to the first item in the list
|
|
// whether there is a header or not
|
|
ion-header,
|
|
ion-item-group-title , {
|
|
border-bottom: 1px solid $item-ios-border-color;
|
|
}
|
|
|
|
.item {
|
|
border-radius: 0;
|
|
// TODO this makes the border not show on sticky
|
|
// margin-top: -1px;
|
|
padding-left: $item-ios-padding-left;
|
|
font-size: $item-ios-font-size;
|
|
}
|
|
|
|
> .item {
|
|
&:first-child {
|
|
border-top: 1px solid $item-ios-border-color;
|
|
}
|
|
|
|
&:last-child {
|
|
border-bottom: 1px solid $item-ios-border-color;
|
|
|
|
.item-inner {
|
|
border-bottom: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
.item {
|
|
|
|
.item-inner {
|
|
padding-right: ($item-ios-padding-right / 2);
|
|
border-bottom: 1px solid $item-ios-border-color;
|
|
}
|
|
|
|
ion-item-content {
|
|
margin: $item-ios-padding-top ($item-ios-padding-right / 2) $item-ios-padding-bottom 0;
|
|
}
|
|
}
|
|
|
|
ion-input.item {
|
|
border-bottom: 1px solid $item-ios-border-color;
|
|
}
|
|
|
|
// If the item has the no-lines attribute remove the border from:
|
|
// the item itself (for first or last-child items)
|
|
// the item-inner class (if it is not first or last)
|
|
// the next item's item-inner after the one with no-lines if there is one
|
|
// .item[no-lines],
|
|
// .item[no-lines] .item-inner, {
|
|
// border-width: 0;
|
|
// }
|
|
|
|
[item-left] {
|
|
margin: ($item-ios-padding-top / 2) $item-ios-padding-right ($item-ios-padding-bottom / 2) 0;
|
|
}
|
|
|
|
[item-right] {
|
|
margin: ($item-ios-padding-top / 2) ($item-ios-padding-right / 2) ($item-ios-padding-bottom / 2) ($item-ios-padding-left / 2);
|
|
}
|
|
|
|
// TODO clean up Sass variables
|
|
icon[item-left],
|
|
icon[item-right] {
|
|
margin-top: $item-ios-padding-icon-top;
|
|
margin-bottom: $item-ios-padding-icon-bottom;
|
|
}
|
|
|
|
ion-avatar[item-left],
|
|
ion-thumbnail[item-left] {
|
|
margin: ($item-ios-padding-right / 2) $item-ios-padding-right ($item-ios-padding-right / 2) 0;
|
|
}
|
|
|
|
ion-avatar[item-right],
|
|
ion-thumbnail[item-right] {
|
|
margin: ($item-ios-padding-right / 2);
|
|
}
|
|
|
|
button[item-left],
|
|
button[item-right],
|
|
[button][item-left],
|
|
[button][item-right] {
|
|
padding: 0 0.5em;
|
|
font-size: 1.3rem;
|
|
min-height: 25px;
|
|
}
|
|
|
|
[item-left].icon-only,
|
|
[item-right].icon-only,
|
|
[item-left].icon-only icon,
|
|
[item-right].icon-only icon,
|
|
[item-left][clear],
|
|
[item-right][clear] {
|
|
padding: 0 1px;
|
|
}
|
|
|
|
[item-left].icon-left icon,
|
|
[item-right].icon-left icon {
|
|
margin-left: 0;
|
|
margin-bottom: 1px;
|
|
padding-right: 0.3em;
|
|
}
|
|
|
|
[item-left].icon-right icon,
|
|
[item-right].icon-right icon {
|
|
margin-right: 0;
|
|
margin-bottom: 1px;
|
|
}
|
|
|
|
ion-avatar {
|
|
min-width: $item-ios-avatar-size;
|
|
min-height: $item-ios-avatar-size;
|
|
|
|
img {
|
|
max-width: $item-ios-avatar-size;
|
|
max-height: $item-ios-avatar-size;
|
|
border-radius: $item-ios-avatar-size / 2;
|
|
}
|
|
}
|
|
|
|
ion-thumbnail {
|
|
min-width: $item-ios-thumbnail-size;
|
|
min-height: $item-ios-thumbnail-size;
|
|
|
|
img {
|
|
max-width: $item-ios-thumbnail-size;
|
|
max-height: $item-ios-thumbnail-size;
|
|
}
|
|
}
|
|
|
|
ion-item-options {
|
|
border-bottom: 1px solid $item-ios-border-color;
|
|
|
|
button, [button] {
|
|
min-height: 100%;
|
|
height: 100%;
|
|
margin: 0;
|
|
|
|
border: none;
|
|
border-radius: 0;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
box-sizing: border-box;
|
|
|
|
&:before{
|
|
margin: 0 auto;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.list,
|
|
ion-card {
|
|
button[ion-item]:not([detail-none]) .item-inner,
|
|
a[ion-item]:not([detail-none]) .item-inner {
|
|
@include ios-detail-push-icon($item-ios-detail-push-color);
|
|
background-repeat: no-repeat;
|
|
background-position: right ($item-ios-padding-right - 2) center;
|
|
background-size: 14px 14px;
|
|
padding-right: 32px;
|
|
}
|
|
}
|
|
|
|
.list + .list {
|
|
margin-top: $list-ios-margin-top + $list-ios-margin-bottom;
|
|
|
|
ion-header {
|
|
margin-top: -$list-ios-margin-top;
|
|
padding-top: 0;
|
|
}
|
|
}
|
|
|
|
&.hairlines .list {
|
|
|
|
ion-item-options {
|
|
border-width: 0.55px;
|
|
//
|
|
// button, [button] {
|
|
// min-height: calc(100% - 1px);
|
|
// height: calc(100% - 1px);
|
|
// margin-top: 0.55px;
|
|
// margin-bottom: 0.55px;
|
|
// }
|
|
}
|
|
|
|
ion-header,
|
|
ion-item-group-title {
|
|
border-bottom-width: 0.55px;
|
|
}
|
|
|
|
.item {
|
|
margin-top: -0.55px;
|
|
|
|
.item-inner {
|
|
border-width: 0.55px;
|
|
}
|
|
}
|
|
|
|
> .item {
|
|
&:first-child {
|
|
border-top-width: 0.55px;
|
|
}
|
|
|
|
&:last-child {
|
|
border-bottom-width: 0.55px;
|
|
margin-bottom: -0.55px;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**************/
|
|
/* INSET LIST */
|
|
/**************/
|
|
|
|
.list[inset] {
|
|
margin: $list-inset-ios-margin-top $list-inset-ios-margin-right $list-inset-ios-margin-bottom $list-inset-ios-margin-left;
|
|
border-radius: $list-inset-ios-border-radius;
|
|
|
|
.item {
|
|
margin-top: 0;
|
|
border-bottom: 1px solid $item-ios-border-color;
|
|
|
|
.item-inner {
|
|
border-bottom: none;
|
|
}
|
|
}
|
|
|
|
> .item:first-child,
|
|
ion-header {
|
|
margin-top: 0;
|
|
border-top-right-radius: $list-inset-ios-border-radius;
|
|
border-top-left-radius: $list-inset-ios-border-radius;
|
|
}
|
|
|
|
> .item:first-child {
|
|
border-top: none;
|
|
}
|
|
|
|
> .item:last-child {
|
|
margin-bottom: 0;
|
|
border-bottom-right-radius: $list-inset-ios-border-radius;
|
|
border-bottom-left-radius: $list-inset-ios-border-radius;
|
|
border-bottom: none;
|
|
}
|
|
}
|
|
|
|
.list[inset] + .list[inset] {
|
|
margin-top: 0;
|
|
}
|
|
|
|
&.hairlines .list[inset] {
|
|
.item {
|
|
border-width: 0.55px;
|
|
}
|
|
}
|
|
|
|
|
|
/*****************/
|
|
/* NO LINES LIST */
|
|
/*****************/
|
|
|
|
.list[no-lines],
|
|
&.hairlines .list[no-lines] {
|
|
ion-header,
|
|
ion-item-group-title,
|
|
.item,
|
|
.item .item-inner {
|
|
border-width: 0;
|
|
}
|
|
}
|