|
1 | | -@use '@material/data-table/data-table' as mdc-data-table; |
2 | | -@use '@material/data-table/data-table-cell' as mdc-data-table-cell; |
3 | | -@use '@material/data-table/data-table-header-cell' as mdc-data-table-header-cell; |
4 | | -@use '@material/data-table' as mdc-data-table-theme; |
5 | | -@use '@material/typography/typography' as mdc-typography; |
6 | 1 | @use '../core/mdc-helpers/mdc-helpers'; |
7 | 2 | @use '../core/tokens/token-utils'; |
8 | 3 | @use '../core/tokens/m2/mat/table' as tokens-mat-table; |
| 4 | +@use '../core/style/vendor-prefixes'; |
9 | 5 | @use './table-flex-styles'; |
10 | 6 |
|
11 | 7 | .mat-mdc-table-sticky { |
|
21 | 17 | border-bottom-style: solid; |
22 | 18 | } |
23 | 19 |
|
24 | | -@include mdc-data-table.static-styles($query: mdc-helpers.$mdc-base-styles-query); |
25 | | -@include mdc-data-table-cell.static-styles($query: mdc-helpers.$mdc-base-styles-query); |
26 | | -@include mdc-data-table-header-cell.static-styles($query: mdc-helpers.$mdc-base-styles-query); |
27 | | -@include mdc-data-table-theme.cell-padding( |
28 | | - $leading-padding: mdc-data-table-theme.$cell-leading-padding, |
29 | | - $trailing-padding: mdc-data-table-theme.$cell-trailing-padding, |
30 | | - $query: mdc-helpers.$mdc-base-styles-query |
31 | | -); |
32 | 20 | @include table-flex-styles.private-table-flex-styles(); |
33 | 21 |
|
34 | 22 | .mat-mdc-table { |
35 | | - // MDC Table applies `table-layout: fixed`, but this is a backwards incompatible |
36 | | - // change since the table did not previously apply it. |
37 | | - // TODO: Add a mixin to MDC to set the layout instead of including this override, |
38 | | - // see this issue: https://github.com/material-components/material-components-web/issues/6412 |
| 23 | + min-width: 100%; |
| 24 | + border: 0; |
| 25 | + border-spacing: 0; |
39 | 26 | table-layout: auto; |
40 | | - |
41 | | - // The MDC table does not allow text to wrap within the cell. This allows for text to |
42 | | - // wrap when the cell reaches its maximum width. |
43 | 27 | white-space: normal; |
44 | 28 |
|
45 | 29 | @include token-utils.use-tokens(tokens-mat-table.$prefix, tokens-mat-table.get-token-slots()) { |
46 | 30 | @include token-utils.create-token-slot(background-color, background-color); |
47 | 31 | } |
48 | 32 | } |
49 | 33 |
|
| 34 | +.mdc-data-table__cell { |
| 35 | + box-sizing: border-box; |
| 36 | + overflow: hidden; |
| 37 | + text-align: left; |
| 38 | + text-overflow: ellipsis; |
| 39 | + |
| 40 | + [dir='rtl'] & { |
| 41 | + text-align: right; |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +.mdc-data-table__cell, |
| 46 | +.mdc-data-table__header-cell { |
| 47 | + padding: 0 16px; |
| 48 | +} |
| 49 | + |
50 | 50 | @include mdc-helpers.disable-mdc-fallback-declarations { |
51 | 51 | @include token-utils.use-tokens(tokens-mat-table.$prefix, tokens-mat-table.get-token-slots()) { |
52 | 52 | // TODO(crisbeto): these tokens have default values in order to make the initial token |
53 | 53 | // work easier to land in g3. Eventually we should remove them. |
54 | 54 | .mat-mdc-header-row { |
55 | | - @include mdc-typography.smooth-font(); |
| 55 | + @include vendor-prefixes.smooth-font; |
56 | 56 | @include token-utils.create-token-slot(height, header-container-height, 56px); |
57 | 57 | @include token-utils.create-token-slot(color, header-headline-color, true); |
58 | 58 | @include token-utils.create-token-slot(font-family, header-headline-font, true); |
|
72 | 72 | // letter spacing which leads to a lot of internal screenshot diffs. |
73 | 73 | .mat-mdc-row, |
74 | 74 | .mdc-data-table__content { |
75 | | - @include mdc-typography.smooth-font(); |
| 75 | + @include vendor-prefixes.smooth-font; |
76 | 76 | @include token-utils.create-token-slot(font-family, row-item-label-text-font, true); |
77 | 77 | @include token-utils.create-token-slot(line-height, row-item-label-text-line-height); |
78 | 78 | @include token-utils.create-token-slot(font-size, row-item-label-text-size, 14px); |
79 | 79 | @include token-utils.create-token-slot(font-weight, row-item-label-text-weight); |
80 | 80 | } |
81 | 81 |
|
82 | 82 | .mat-mdc-footer-row { |
83 | | - @include mdc-typography.smooth-font(); |
| 83 | + @include vendor-prefixes.smooth-font; |
84 | 84 | @include token-utils.create-token-slot(height, footer-container-height, 52px); |
85 | 85 | @include token-utils.create-token-slot(color, row-item-label-text-color, true); |
86 | 86 | @include token-utils.create-token-slot(font-family, footer-supporting-text-font, true); |
|
95 | 95 | @include token-utils.create-token-slot(letter-spacing, header-headline-tracking); |
96 | 96 | font-weight: inherit; |
97 | 97 | line-height: inherit; |
| 98 | + box-sizing: border-box; |
| 99 | + text-overflow: ellipsis; |
| 100 | + overflow: hidden; |
| 101 | + outline: none; |
| 102 | + text-align: left; |
| 103 | + |
| 104 | + [dir='rtl'] & { |
| 105 | + text-align: right; |
| 106 | + } |
98 | 107 | } |
99 | 108 |
|
100 | 109 | .mat-mdc-cell { |
|
0 commit comments