blob: ee33f89f07f271175b5a96ac4b7fe5e50c8d5221 [file] [log] [blame]
Renovate botf591dcf2023-12-30 14:13:54 +00001// @see https://github.com/twbs/bootstrap/blob/main/scss/_functions.scss
2@function material-icons-str-replace($string, $search, $replace: '') {
3 $index: str-index($string, $search);
4 @if $index {
5 @return str-slice($string, 1, $index - 1) + $replace +
6 material-icons-str-replace(
7 str-slice($string, $index + str-length($search)),
8 $search,
9 $replace
10 );
11 }
12 @return $string;
13}
14
15@mixin material-icons-font-class($font-family) {
16 font-family: $font-family;
17 font-weight: normal;
18 font-style: normal;
19 font-size: $material-icons-font-size;
20 line-height: 1;
21 letter-spacing: normal;
22 text-transform: none;
23 display: inline-block;
24 white-space: nowrap;
25 word-wrap: normal;
26 direction: ltr;
27 -webkit-font-smoothing: antialiased; // Support for all WebKit browsers
28 -moz-osx-font-smoothing: grayscale; // Support for Firefox
29 text-rendering: optimizeLegibility; // Support for Safari and Chrome
30 font-feature-settings: 'liga'; // Support for IE
31}
32
33@mixin material-icons-font($font-family) {
34 $class-name: to-lower-case($font-family);
35 $class-name: material-icons-str-replace($class-name, ' ', '-');
36 $font-file: $material-icons-font-path + $class-name;
37
38 @font-face {
39 font-family: $font-family;
40 font-style: normal;
41 font-weight: 400;
42 font-display: $material-icons-font-display;
43 src: url('#{$font-file}.woff2') format('woff2'),
44 url('#{$font-file}.woff') format('woff');
45 }
46
47 .#{$class-name} {
48 @include material-icons-font-class($font-family);
49 }
50}
51
52@mixin material-icons() {
Renovate bot650e6672024-02-09 00:15:10 +000053 @warn "material-icons() Sass mixin has been deprecated as of 1.0. Use '@extend .material-icons;' instead of '@include material-icons();'.";
Renovate botf591dcf2023-12-30 14:13:54 +000054 @include material-icons-font-class('Material Icons');
55}