|
1 | | -@use 'sass:map'; |
2 | 1 | @use 'sass:meta'; |
3 | | -@use '@material/density' as mdc-density; |
4 | | -@use '@material/typography' as mdc-typography; |
5 | | - |
| 2 | +@use '../core/tokens/m2/mat/paginator' as tokens-mat-paginator; |
| 3 | +@use '../core/style/sass-utils'; |
6 | 4 | @use '../core/typography/typography'; |
7 | | -@use '../core/typography/typography-utils'; |
8 | | -@use '../core/mdc-helpers/mdc-helpers'; |
9 | 5 | @use '../core/theming/theming'; |
| 6 | +@use '../core/tokens/token-utils'; |
10 | 7 | @use '../form-field/form-field-density'; |
11 | | -@use './paginator-variables'; |
12 | 8 |
|
13 | 9 | @mixin color($config-or-theme) { |
14 | 10 | $config: theming.get-color-config($config-or-theme); |
15 | | - $background: map.get($config, background); |
16 | | - $foreground: map.get($config, foreground); |
17 | | - $icon-color: rgba(theming.get-color-from-palette($foreground, base), 0.54); |
18 | | - $disabled-color: rgba(theming.get-color-from-palette($foreground, base), 0.12); |
19 | | - |
20 | | - .mat-mdc-paginator { |
21 | | - background: theming.get-color-from-palette($background, card); |
22 | | - color: rgba(theming.get-color-from-palette($foreground, base), 0.87); |
23 | | - } |
24 | | - |
25 | | - .mat-mdc-paginator-icon { |
26 | | - fill: $icon-color; |
27 | | - } |
28 | | - |
29 | | - .mat-mdc-paginator-decrement, |
30 | | - .mat-mdc-paginator-increment { |
31 | | - border-top: 2px solid $icon-color; |
32 | | - border-right: 2px solid $icon-color; |
33 | | - } |
34 | | - |
35 | | - .mat-mdc-paginator-first, |
36 | | - .mat-mdc-paginator-last { |
37 | | - border-top: 2px solid $icon-color; |
38 | | - } |
39 | 11 |
|
40 | | - .mat-mdc-icon-button[disabled] { |
41 | | - .mat-mdc-paginator-decrement, |
42 | | - .mat-mdc-paginator-increment, |
43 | | - .mat-mdc-paginator-first, |
44 | | - .mat-mdc-paginator-last { |
45 | | - border-color: $disabled-color; |
46 | | - } |
47 | | - |
48 | | - .mat-mdc-paginator-icon { |
49 | | - fill: $disabled-color; |
50 | | - } |
| 12 | + @include sass-utils.current-selector-or-root() { |
| 13 | + @include token-utils.create-token-values(tokens-mat-paginator.$prefix, |
| 14 | + tokens-mat-paginator.get-color-tokens($config)); |
51 | 15 | } |
52 | 16 | } |
53 | 17 |
|
54 | 18 | @mixin typography($config-or-theme) { |
55 | 19 | $config: typography.private-typography-to-2018-config( |
56 | 20 | theming.get-typography-config($config-or-theme)); |
57 | 21 |
|
58 | | - @include mdc-helpers.using-mdc-typography($config) { |
59 | | - .mat-mdc-paginator { |
60 | | - @include mdc-typography.typography(caption, $query: mdc-helpers.$mdc-typography-styles-query); |
61 | | - } |
62 | | - |
63 | | - .mat-mdc-paginator .mat-mdc-select-value { |
64 | | - font-size: typography-utils.font-size($config, caption); |
65 | | - } |
| 22 | + @include sass-utils.current-selector-or-root() { |
| 23 | + @include token-utils.create-token-values(tokens-mat-paginator.$prefix, |
| 24 | + tokens-mat-paginator.get-typography-tokens($config)); |
66 | 25 | } |
67 | 26 | } |
68 | 27 |
|
69 | 28 | @mixin density($config-or-theme) { |
70 | 29 | $density-scale: theming.get-density-config($config-or-theme); |
71 | | - $height: mdc-density.prop-value( |
72 | | - paginator-variables.$density-config, $density-scale, height); |
73 | 30 |
|
| 31 | + @include sass-utils.current-selector-or-root() { |
| 32 | + @include token-utils.create-token-values(tokens-mat-paginator.$prefix, |
| 33 | + tokens-mat-paginator.get-density-tokens($density-scale)); |
| 34 | + } |
| 35 | + |
| 36 | + // TODO: this should be done through tokens once the form field has been switched over. |
74 | 37 | .mat-mdc-paginator { |
75 | 38 | // We need the form field to be narrower in order to fit into the paginator, |
76 | 39 | // so we set its density to be -4 or denser. |
|
82 | 45 | @include form-field-density.private-form-field-density($density-scale); |
83 | 46 | } |
84 | 47 | } |
85 | | - |
86 | | - .mat-mdc-paginator-container { |
87 | | - min-height: $height; |
88 | | - } |
89 | 48 | } |
90 | 49 |
|
91 | 50 | @mixin theme($theme-or-color-config) { |
|
0 commit comments