| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- //
- // Copyright 2020 Google Inc.
- //
- // Permission is hereby granted, free of charge, to any person obtaining a copy
- // of this software and associated documentation files (the "Software"), to deal
- // in the Software without restriction, including without limitation the rights
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- // copies of the Software, and to permit persons to whom the Software is
- // furnished to do so, subject to the following conditions:
- //
- // The above copyright notice and this permission notice shall be included in
- // all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- // THE SOFTWARE.
- //
- // stylelint-disable selector-class-pattern --
- // NOTE: We disable `selector-class-pattern` above to allow using `mdc-` class
- // selectors.
- @use 'sass:list';
- @use '@material/animation/functions';
- @use '@material/checkbox/mixins' as checkbox-mixins;
- @use '@material/density/functions' as density-functions;
- @use '@material/dom/mixins' as dom;
- @use '@material/elevation/mixins';
- @use '@material/feature-targeting/feature-targeting';
- @use '@material/rtl/rtl';
- @use '@material/shape/mixins' as shape-mixins;
- @use '@material/theme/theme';
- @use '@material/theme/theme-color';
- @use '@material/typography/typography';
- @use './data-table-cell';
- @use './data-table-header-cell';
- @use './data-table-pagination';
- @use './data-table-progress-indicator';
- @use './data-table-theme';
- @mixin core-styles($query: feature-targeting.all()) {
- @include table-styles($query: $query);
- @include data-table-theme.sort-icon-color(
- data-table-theme.$sort-icon-color,
- $query: $query
- );
- @include data-table-theme.sort-icon-active-color(
- data-table-theme.$sort-icon-active-color,
- $query: $query
- );
- @include data-table-progress-indicator.static-styles($query: $query);
- @include data-table-pagination.core-styles($query: $query);
- }
- @mixin static-styles($query: feature-targeting.all()) {
- $feat-structure: feature-targeting.create-target($query, structure);
- .mdc-data-table {
- @include feature-targeting.targets($feat-structure) {
- // Makes the table scroll smoothly in iOS.
- // NOTE: Root element should not be scrollable, added this for backward
- // compatibility.
- -webkit-overflow-scrolling: touch;
- display: inline-flex;
- flex-direction: column;
- box-sizing: border-box;
- position: relative;
- }
- }
- .mdc-data-table__table-container {
- @include feature-targeting.targets($feat-structure) {
- // Makes the table scroll smoothly in iOS.
- -webkit-overflow-scrolling: touch;
- overflow-x: auto;
- width: 100%;
- }
- }
- .mdc-data-table__table {
- @include feature-targeting.targets($feat-structure) {
- min-width: 100%; // Makes table full-width of its container (Firefox / IE11)
- border: 0;
- white-space: nowrap;
- border-spacing: 0;
- /**
- * With table-layout:fixed, table and column widths are defined by the width
- * of the first row of cells. Cells in subsequent rows do not affect column
- * widths. This results in a predictable table layout and may also speed up
- * rendering.
- */
- table-layout: fixed;
- }
- }
- }
- // This API includes only the table styles without the sorting, pagination and
- // loading styles. It is intended to be used by frameworks that only need the
- // table styles.
- @mixin table-styles($query: feature-targeting.all()) {
- $feat-structure: feature-targeting.create-target($query, structure);
- $feat-typography: feature-targeting.create-target($query, typography);
- $feat-animation: feature-targeting.create-target($query, animation);
- // postcss-bem-linter: define data-table
- .mdc-data-table__content {
- @include typography.typography(body2, $query: $query);
- }
- .mdc-data-table {
- @include data-table-theme.fill-color(
- data-table-theme.$fill-color,
- $query: $query
- );
- @include data-table-theme.shape-radius(
- data-table-theme.$shape-radius,
- $query: $query
- );
- @include data-table-theme.stroke-size(
- data-table-theme.$stroke-size,
- $query: $query
- );
- @include data-table-theme.stroke-color(
- data-table-theme.$stroke-color,
- $query: $query
- );
- }
- // Note that we don't output the color styles inside the `@at-root`,
- // because it makes it difficult to consume by projects that wrap their
- // themes in a class (e.g. `.my-theme { @include mdc-data-table-core-style() }`).
- @include data-table-theme.row-fill-color(
- data-table-theme.$row-fill-color,
- $query: $query
- );
- @include data-table-theme.header-row-fill-color(
- data-table-theme.$header-row-fill-color,
- $query: $query
- );
- @include data-table-theme.selected-row-fill-color(
- data-table-theme.$selected-row-fill-color,
- $query: $query
- );
- @include data-table-theme.divider-color(
- data-table-theme.$divider-color,
- $query: $query
- );
- @include data-table-theme.divider-size(
- data-table-theme.$divider-size,
- $query: $query
- );
- @include data-table-theme.row-hover-fill-color(
- data-table-theme.$row-hover-fill-color,
- $query: $query
- );
- @include data-table-theme.header-row-text-color(
- data-table-theme.$header-row-text-color,
- $query: $query
- );
- @include data-table-theme.row-text-color(
- data-table-theme.$row-text-color,
- $query: $query
- );
- @include data-table-theme.density(
- data-table-theme.$default-density-scale,
- $query: $query
- );
- @include data-table-theme.cell-padding(
- $leading-padding: data-table-theme.$cell-leading-padding,
- $trailing-padding: data-table-theme.$cell-trailing-padding,
- $query: $query
- );
- @include data-table-cell.core-styles($query: $query);
- @include data-table-header-cell.core-styles($query: $query);
- .mdc-data-table--sticky-header {
- @include data-table-header-cell.header-cell-sticky($query: $query);
- }
- @include static-styles($query);
- @include data-table-header-cell.static-styles($query);
- @include data-table-cell.static-styles($query);
- @include data-table-pagination.static-styles($query);
- @include data-table-progress-indicator.static-styles($query);
- }
- @mixin theme-baseline($query: feature-targeting.all()) {
- @include data-table-theme.checked-icon-color(
- data-table-theme.$checked-icon-color,
- $query: $query
- );
- }
|