|
8 | 8 | $warn: map-get($theme, warn); |
9 | 9 |
|
10 | 10 | .mat-progress-bar-background { |
11 | | - background-image: #{_mat-progress-bar-buffer($primary, lighter)}; |
| 11 | + fill: mat-color($primary, lighter); |
12 | 12 | } |
13 | 13 |
|
14 | 14 | .mat-progress-bar-buffer { |
|
21 | 21 |
|
22 | 22 | .mat-progress-bar.mat-accent { |
23 | 23 | .mat-progress-bar-background { |
24 | | - background-image: #{_mat-progress-bar-buffer($accent, lighter)}; |
| 24 | + fill: mat-color($accent, lighter); |
25 | 25 | } |
26 | 26 |
|
27 | 27 | .mat-progress-bar-buffer { |
|
35 | 35 |
|
36 | 36 | .mat-progress-bar.mat-warn { |
37 | 37 | .mat-progress-bar-background { |
38 | | - background-image: #{_mat-progress-bar-buffer($warn, lighter)}; |
| 38 | + fill: mat-color($warn, lighter); |
39 | 39 | } |
40 | 40 |
|
41 | 41 | .mat-progress-bar-buffer { |
|
50 | 50 |
|
51 | 51 | @mixin mat-progress-bar-typography($config) { } |
52 | 52 |
|
53 | | -// TODO(josephperrott): Find better way to inline svgs. |
54 | | -// In buffer mode a repeated SVG object is used as a background. |
55 | | -// Each of the following defines the SVG object for each of the class defined colors. |
56 | | -// |
57 | | -// The string is a URL encoded version of: |
58 | | -// |
59 | | -// <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" |
60 | | -// version="1.1" x="0px" y="0px" enable-background="new 0 0 5 2" |
61 | | -// xml:space="preserve" viewBox="0 0 5 2" preserveAspectRatio="none slice"> |
62 | | -// <circle cx="1" cy="1" r="1" fill="{INJECTED_COLOR}"/> |
63 | | -// </svg> |
64 | | -@function _mat-progress-bar-buffer($palette, $hue) { |
65 | | - $color: mat-color($palette, $hue) + ''; |
66 | | - |
67 | | - // We also need to escape the hash in hex colors, |
68 | | - // otherwise IE will throw an XML error. |
69 | | - @if str-index($color, '#') == 1 { |
70 | | - $color: '%23' + str-slice($color, 2); |
71 | | - } |
72 | | - |
73 | | - $result: '' + |
74 | | - 'data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%271.1%27%20xmlns%3D%27http%3A%2F%2F' + |
75 | | - 'www.w3.org%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%2' + |
76 | | - '7%20x%3D%270px%27%20y%3D%270px%27%20enable-background%3D%27new%200%200%205%202%27%20xml%' + |
77 | | - '3Aspace%3D%27preserve%27%20viewBox%3D%270%200%205%202%27%20preserveAspectRatio%3D%27none' + |
78 | | - '%20slice%27%3E%3Ccircle%20cx%3D%271%27%20cy%3D%271%27%20r%3D%271%27%20fill%3D%27' + |
79 | | - $color + '%27%2F%3E%3C%2Fsvg%3E'; |
80 | | - |
81 | | - @return url($result); |
82 | | -} |
0 commit comments