blob: b0b099d39bb0ed59c223296ce7d929fc7e3f4bc6 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001@function material-icons-str-replace($string, $search, $replace: '') {
2 $index: str-index($string, $search);
3
4 @if $index {
5 @return str-slice($string, 1, $index - 1) + $replace + material-icons-str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
6 }
7
8 @return $string;
9}
10
11@function material-icons-content($codepoint) {
12 @return unquote('"\\#{$codepoint}"');
13}
14
15@mixin material-icons(
16 $font-size: $material-icons-font-size,
17 $font-family: $material-icons-font-family
18) {
19 font-family: $font-family;
20 font-weight: normal;
21 font-style: normal;
22 font-size: $font-size;
23 display: inline-block;
24 line-height: 1;
25 text-transform: none;
26 letter-spacing: normal;
27 word-wrap: normal;
28 white-space: nowrap;
29 direction: ltr;
30
31 /* Support for all WebKit browsers. */
32 -webkit-font-smoothing: antialiased;
33 /* Support for Safari and Chrome. */
34 text-rendering: optimizeLegibility;
35
36 /* Support for Firefox. */
37 -moz-osx-font-smoothing: grayscale;
38
39 /* Support for IE. */
40 font-feature-settings: 'liga';
41}
42
43@mixin material-icon($name, $pseudo: 'before') {
44 $codepoint: map-get($material-icons-codepoints, $name);
45
46 &:#{$pseudo} {
47 content: material-icons-content($codepoint);
48 }
49}