mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(item): sticky items
This commit is contained in:
@ -21,6 +21,24 @@
|
|||||||
color: $list-text-color;
|
color: $list-text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-group {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-group-title {
|
||||||
|
display: block;
|
||||||
|
min-height: 30px;
|
||||||
|
font-weight: 500;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
z-index: 1000;
|
||||||
|
&.sticky {
|
||||||
|
position: -webkit-sticky;
|
||||||
|
position: sticky;
|
||||||
|
top: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
a.item,
|
a.item,
|
||||||
button.item.item {
|
button.item.item {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -22,9 +22,30 @@ $item-ios-thumbnail-size: 5.6rem !default;
|
|||||||
$item-ios-note-color: darken($item-ios-border-color, 10%) !default;
|
$item-ios-note-color: darken($item-ios-border-color, 10%) !default;
|
||||||
$item-ios-forward-icon-color: $item-ios-border-color !default;
|
$item-ios-forward-icon-color: $item-ios-border-color !default;
|
||||||
|
|
||||||
|
$item-ios-divider-bg: #f5f5f5 !default;
|
||||||
|
$item-ios-divider-color: #222 !default;
|
||||||
|
$item-ios-divider-padding: 5px 15px !default;
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
|
|
||||||
|
|
||||||
|
.item-group-title {
|
||||||
|
padding: $item-ios-padding-top $item-ios-padding-right $item-ios-padding-bottom $item-ios-padding-left;
|
||||||
|
background-color: $item-ios-divider-bg;
|
||||||
|
color: $item-ios-divider-color;
|
||||||
|
//padding-top: ceil($item-padding / 2);
|
||||||
|
//padding-bottom: ceil($item-padding / 2);
|
||||||
|
}
|
||||||
|
.item-group {
|
||||||
|
// Make sure the first and last items don't have borders
|
||||||
|
> .item:first-of-type:before {
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
|
> .item:last-of-type:after {
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
padding-right: ($item-ios-padding-right / 2);
|
padding-right: ($item-ios-padding-right / 2);
|
||||||
|
@ -25,9 +25,27 @@ $item-md-thumbnail-size: 8rem !default;
|
|||||||
$item-md-note-color: darken($item-md-border-color, 10%) !default;
|
$item-md-note-color: darken($item-md-border-color, 10%) !default;
|
||||||
$item-md-forward-icon-color: $item-md-border-color !default;
|
$item-md-forward-icon-color: $item-md-border-color !default;
|
||||||
|
|
||||||
|
$item-md-divider-bg: #fff !default;
|
||||||
|
$item-md-divider-color: #222 !default;
|
||||||
|
$item-md-divider-padding: 5px 15px !default;
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
|
|
||||||
|
.item-group-title {
|
||||||
|
padding: $item-md-padding-top $item-md-padding-right $item-md-padding-bottom $item-md-padding-left;
|
||||||
|
background-color: $item-md-divider-bg;
|
||||||
|
color: $item-md-divider-color;
|
||||||
|
}
|
||||||
|
.item-group {
|
||||||
|
// Make sure the first and last items don't have borders
|
||||||
|
> .item:first-of-type:before {
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
|
> .item:last-of-type:after {
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
padding-right: ($item-md-padding-right / 2);
|
padding-right: ($item-md-padding-right / 2);
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.list[inset] {
|
.list[inset] {
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
ion-header {
|
ion-header {
|
||||||
background-color: $list-background-color;
|
background-color: $list-background-color;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
|
||||||
<ion-list inset>
|
<ion-list>
|
||||||
<ion-item-group *ng-for="#group of groups">
|
<ion-item-group *ng-for="#group of groups">
|
||||||
<ion-item-group-title>{{group.title}}</ion-item-group-title>
|
<ion-item-group-title>{{group.title}}</ion-item-group-title>
|
||||||
<ion-item *ng-for="#item of group.items">
|
<ion-item *ng-for="#item of group.items">
|
||||||
|
Reference in New Issue
Block a user