@@ -16,17 +16,38 @@ _Specify a font name, URL where it can be found, font weight and font style._
1616- ` $weight ` - defines the boldness of the font. Default value is "normal".
1717- ` $style ` - defines how the font should be styled. Default value is "normal".
1818
19- ### Usage:
19+ ### Usage:
2020
21- Define font Poppins from ` ../fonts ` folder.
21+ #### Case 1
22+
23+ Define font Poppins from ` ../fonts ` folder.
2224
2325```
2426@include font-face(Poppins, '../fonts/poppins-v3-latin-ext-500', 500, italic);
2527```
26- Each kind of font's file should have the same naming pattern. For example:
28+ Each kind of font's file have to have the same naming pattern. For example:
2729``` javascript
2830poppins- v3- latin- ext- 500 .eot
2931poppins- v3- latin- ext- 500 .woff
3032poppins- v3- latin- ext- 500 .ttf
3133poppins- v3- latin- ext- 500 .svg
34+ ```
35+
36+ #### Case 2 - ** Using mixin along with ` css-modules ` **
37+
38+ ** NOTE:**
39+ While using ` face-font ` mixin along with ` css-modules ` for best optimization you should place it in component which is used in whole application.
40+ Best place for that is inside scss file for CoreLayout component. Thanks to that it will be imported only once and not in every component.
41+ It's very important to place it outside of any class declaration.
42+
43+ Define font Graphik from ` ../fonts ` folder.
44+ ``` javascript
45+ @include font- face (Graphik Regular, ' ../fonts/Graphik-Regular' );
46+ @include font- face (Graphik Light, ' ../fonts/Graphik-Light' );
47+ @include font- face (Graphik Medium, ' ../fonts/Graphik-Medium' );
48+ @include font- face (Graphik Semibold, ' ../fonts/Graphik-Semibold' );
49+
50+ .sampleClass {
51+ ...
52+ }
3253```
0 commit comments