framework7-without-localstorage
Version:
Full featured mobile HTML framework for building iOS & Android apps
307 lines (302 loc) • 8.08 kB
text/less
.data-table {
overflow-x: auto;
table {
width: 100%;
border: none;
padding: 0;
margin: 0;
border-collapse: collapse;
text-align: left;
}
thead {
font-size: 12px;
th, td {
font-weight: 500;
height: 56px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
line-height: 16px;
&:not(.sortable-active) {
color: rgba(0,0,0,0.54);
}
}
i.icon, i.material-icons {
font-size: 16px;
width: 16px;
height: 16px;
vertical-align: top;
}
}
tbody {
font-size: 13px;
tr.data-table-row-selected {
background: #f5f5f5;
}
td {
height: 48px;
.hairline(top, rgba(0,0,0,0.12));
}
}
html:not(.ios):not(.android) & {
tbody tr:hover {
background: #f5f5f5;
}
}
th, td {
padding: 0;
position: relative;
padding-left: 28px;
padding-right: 28px;
&.label-cell {
padding-left: 24px;
padding-right: 24px;
}
&:first-child {
padding-left: 24px;
}
&:last-child {
padding-right: 24px;
}
&.numeric-cell {
text-align: right;
}
&.checkbox-cell {
padding-left: 24px;
padding-right: 12px;
width: 18px;
overflow: visible;
& + td, & + th {
padding-left: 12px;
}
label {
& + span{
padding-left:8px;
}
}
}
&.actions-cell {
text-align: right;
white-space: nowrap;
a.link {
color: rgba(0,0,0,0.54);
position: relative;
z-index: 1;
cursor: pointer;
+ a.link {
margin-left: 24px;
}
}
a.icon-only {
width: 24px;
height: 24px;
display: inline-block;
vertical-align: middle;
font-size: 18px;
line-height: 24px;
text-align: center;
font-size: 0;
i {
font-size: 18px;
vertical-align: middle;
}
}
}
}
// Sortable
.sortable-cell {
cursor: pointer;
position: relative;
}
.sortable-cell:not(.numeric-cell):after, .sortable-cell.numeric-cell:before {
content: '';
display: inline-block;
vertical-align: top;
width: 16px;
height: 16px;
.encoded-svg-background("<svg fill='#000000' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M0 0h24v24H0V0z' fill='none'/><path d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z' fill='#000000'/></svg>");
background-size: 100% auto;
background-position: center;
background-repeat: no-repeat;
font-size: 0;
.transition(300ms);
.transform(rotate(0));
opacity: 0;
}
html:not(.ios):not(.android) & {
.sortable-cell:not(.sortable-active):hover {
&:after, &:before {
opacity: 0.54;
}
}
}
.sortable-cell.sortable-active {
&:after, &:before {
opacity: 0.87;
}
}
.sortable-cell.sortable-asc {
}
.sortable-cell.sortable-desc {
&:after, &:before {
.transform(rotate(180deg));
}
}
.sortable-cell:not(.numeric-cell):after {
margin-left: 8px;
}
.sortable-cell.numeric-cell:before {
margin-right: 8px;
}
// Cards
&.card, .card & {
.card-header, .card-footer {
padding-left: 24px;
padding-right: 14px;
}
.card-header {
height: 64px;
}
.card-footer {
height: 56px;
}
.card-content {
overflow-x: auto;
}
}
.data-table-title {
font-size: 20px;
}
.data-table-links, .data-table-actions {
.flexbox();
.justify-content(space-between);
a.link {
cursor: pointer;
}
a.link + a.link {
margin-left: 24px;
}
}
.data-table-actions {
margin-left: auto;
.align-items(center);
a.link {
cursor: pointer;
min-width: 0;
color: rgba(0,0,0,0.54);
}
a.link.icon-only {
width: 24px;
height: 24px;
line-height: 1;
overflow: visible;
&.active-state, html:not(.watch-active-state) &:active {
background: none;
}
}
}
.data-table-header, .data-table-header-selected {
.flexbox();
.justify-content(space-between);
.align-items(center);
width: 100%;
}
.card-header {
> .data-table-header, > .data-table-header-selected {
padding-left: 24px;
padding-right: 14px;
margin-left: -24px;
margin-right: -14px;
height: 100%;
padding-top: 4px;
padding-bottom: 4px;
}
}
.data-table-header-selected {
display: none;
background: rgba(red(@themeColor), green(@themeColor), blue(@themeColor), 0.1);
}
&.data-table-has-checked {
.data-table-header {
display: none;
}
.data-table-header-selected {
.flexbox();
}
}
.data-table-title-selected {
color: @themeColor;
font-size: 14px;
}
// Collapsible
@media (max-width:480px) and (orientation:portrait) {
&.data-table-collapsible {
thead {
display: none;
}
tbody, tr, td {
display: block;
}
tr {
position: relative;
.hairline(top, rgba(0,0,0,0.12));
}
tr:hover {
background-color: inherit;
}
td {
text-align: left;
padding-left: 16px;
padding-right: 16px;
.hairline-remove(top);
.flexbox();
.align-content(center);
.align-items(center);
.justify-content(flex-start);
}
td:not(.checkbox-cell) {
font-size: 16px;
&:before {
width: 40%;
display: block;
content: attr(data-collapsible-title);
position: relative;
height: auto;
background: none;
.transform(none) !important;
color: rgba(0,0,0,0.54);
font-weight: 500;
font-size: 12px;
margin-right: 16px;
line-height: 16px;
.flex-shrink(0);
}
}
td.checkbox-cell {
position: absolute;
left: 0;
top: 0;
+ td {
padding-left: 16px;
}
~ td {
margin-left: 16px + 16px;
}
}
}
}
// Responsive queries
.tablet-only, .tablet-landscape-only {
display: none;
}
@media (min-width: 768px) {
.tablet-only {
display: table-cell;
}
}
@media (min-width: 768px) and (orientation:landscape) {
.tablet-landscape-only {
display: table-cell;
}
}
}