UNPKG

framework7

Version:

Full featured mobile HTML framework for building iOS & Android apps

282 lines (275 loc) 6.3 kB
.md { @import (multiple) '../../less/colors-md.less'; @import (multiple) '../../less/vars-md.less'; .data-table { thead { th, td { font-weight: 500; height: 56px; box-sizing: border-box; &:not(.sortable-cell-active) { color: rgba(0,0,0,0.54); } } i.icon, i.material-icons { font-size: 16px; width: 16px; height: 16px; } } tbody { font-size: 13px; tr.data-table-row-selected { background: #f5f5f5; } td { height: 48px; } } th, td { padding-left: 28px; padding-right: 28px; &.label-cell { padding-left: 24px; padding-right: 24px; } &:first-child { .ltr({ padding-left: 24px; }); .rtl({ padding-right: 24px; }); } &:last-child { .ltr({ padding-right: 24px; }); .rtl({ padding-left: 24px; }); } &.checkbox-cell { width: 18px; .ltr({ padding-left: 24px; padding-right: 12px; + td, + th { padding-left: 12px; } }); .rtl({ padding-right: 24px; padding-left: 12px; + td, + th { padding-right: 12px; } }); } &.actions-cell { a.link { color: rgba(0,0,0,0.54); + a.link { .ltr({ margin-left: 24px; }); .rtl({ margin-right: 24px; }); } } a.icon-only { width: 24px; height: 24px; line-height: 24px; } } } } .sortable-cell:not(.numeric-cell):after { .ltr({ margin-left: 8px; }); .rtl({ margin-right: 8px; }); } .sortable-cell.numeric-cell:before { .ltr({ margin-right: 8px; }); .rtl({ margin-left: 8px; }); } .data-table.card, .card .data-table { .card-header, .card-footer { .ltr({ padding-left: 24px; padding-right: 14px; }); .rtl({ padding-right: 24px; padding-left: 14px; }); } .card-footer { height: 56px; } } .data-table-title { font-size: 20px; } .data-table-links, .data-table-actions { a.link + a.link { .ltr({ margin-left: 24px; }); .rtl({ margin-right: 24px; }); } } .data-table-actions { a.link { color: rgba(0,0,0,0.54); } a.link.icon-only { width: 24px; height: 24px; overflow: visible; &.active-state { background: none; } } } .data-table .card-header { > .data-table-header, > .data-table-header-selected { .ltr({ padding-left: 24px; padding-right: 14px; margin-left: -24px; margin-right: -14px; }); .rtl({ padding-right: 24px; padding-left: 14px; margin-right: -24px; margin-left: -14px; }); padding-top: 4px; padding-bottom: 4px; height: 100%; } } .data-table-header-selected { background: rgba(red(@themeColor), green(@themeColor), blue(@themeColor), 0.1); } .data-table-title-selected { color: @themeColor; } .hairline-root('.data-table tbody td', top, rgba(0,0,0,0.12)); &.device-desktop .data-table { tbody tr:hover { background: #f5f5f5; } } // Footer .data-table-footer { height: 56px; color: rgba(0,0,0,0.54); } .data-table-rows-select, .data-table-pagination { a.link { width: 48px; height: 48px; .md-link-highlight(rgba(0,0,0,0.1)); } } .data-table-rows-select { + .data-table-pagination { .ltr({ margin-left: 32px; }); .rtl({ margin-right: 32px; }); } .input { .ltr({ margin-left: 24px; }); .rtl({ margin-right: 24px; }); } } .data-table-pagination-label { .ltr({ margin-right: 20px; }); .rtl({ margin-left: 20px; }); } .hairline-root('.data-table-footer', top, rgba(0,0,0,0.12)); // Inputs .input-cell { padding-top: 8px; padding-bottom: 8px; height: auto; vertical-align: top; .table-head-label + .input { margin-top: 4px; } .input { height: 24px; input, textarea, select { height: 24px; color: #212121; font-size: 14px; } .input-clear-button { transform: scale(0.8); } } } // Collapsible @media (max-width:480px) and (orientation:portrait) { .data-table.data-table-collapsible { td { padding-left: 16px; padding-right: 16px; } td:not(.checkbox-cell) { &:before { color: rgba(0,0,0,0.54); font-weight: 500; line-height: 16px; } } } .hairline-root('.data-table-collapsible tr', top, rgba(0,0,0,0.12)); } // Dark Theme & when (@includeDarkTheme) { .theme-dark { .data-table, .data-table& { thead th:not(.sortable-cell-active), thead td:not(.sortable-cell-active), .data-table-actions a.link, td.actions-cell a.link, th.actions-cell a.link { color: rgba(255,255,255,0.54); } .data-table-links a.link { .md-link-highlight(rgba(255,255,255,0.15)); } tbody td { .hairline-color(top, @blockBorderColorDark); } &.data-table-collapsible tr { .hairline-color(top, @blockBorderColorDark); } tbody { tr.data-table-row-selected { background-color: rgba(255,255,255,0.05); } } } } &.device-desktop .theme-dark .data-table, &.device-desktop .theme-dark.data-table { tbody tr:hover { background-color: rgba(255,255,255,0.05); } } } .color-theme-loop({ .color-theme-@{colorThemeName} .data-table-header-selected, .data-table-header-selected.color-@{colorThemeName} { background: rgba(red(@colorThemeValue), green(@colorThemeValue), blue(@colorThemeValue), 0.1); } .color-theme-@{colorThemeName} .data-table-title-selected, .color-@{colorThemeName} .data-table-title-selected { color: @colorThemeValue; } }); }