Skip to content

Commit bd5bf36

Browse files
committed
Updated usage of face-font mixins
1 parent 80d1153 commit bd5bf36

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55
:bug: Fixed:
66
- [Issue #98](https://github.com/7ninjas/scss-mixins/issues/98) included `border-radius` mixins
77
- [Issue #100](https://github.com/7ninjas/scss-mixins/issues/100), [Issue #101](https://github.com/7ninjas/scss-mixins/issues/101) changed `$gutter` variable
8+
- [Issue #103](https://github.com/7ninjas/scss-mixins/issues/103) Updated description of `mixin @font-face` usage along with `css-modules`
89

910
## [v1.0.0] - 2018-04-12
1011
:rocket: New feature:

docs/fonts.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2830
poppins-v3-latin-ext-500.eot
2931
poppins-v3-latin-ext-500.woff
3032
poppins-v3-latin-ext-500.ttf
3133
poppins-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

Comments
 (0)