@drivy/cobalt 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/styles/core/fonts.scss +3 -1
- package/styles/fonts/BrandFont.woff +0 -0
- package/styles/fonts/README.md +15 -10
package/package.json
CHANGED
package/styles/core/fonts.scss
CHANGED
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
font-style: normal;
|
|
4
4
|
font-weight: bold;
|
|
5
5
|
font-display: swap;
|
|
6
|
-
|
|
6
|
+
// path here is related to the root file (here ../core.scss) for the sass resolver
|
|
7
|
+
// https://webpack.js.org/loaders/sass-loader/
|
|
8
|
+
src: url("fonts/BrandFont.woff") format("woff");
|
|
7
9
|
}
|
|
Binary file
|
package/styles/fonts/README.md
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
Our official font
|
|
1
|
+
Our official branding font is a licensed paid web font, meaning that we can't distribute it through our NPM package (which uses the MIT license). So you won't find it in our design system, instead we put an [open font licensed](https://en.wikipedia.org/wiki/SIL_Open_Font_License) one as a placeholder ([source](https://fonts.google.com/specimen/Poppins)). If you want to use a diffrent brand font, you can alias that placeholder to use a font on your side instead.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
```javascript
|
|
5
|
-
const path = require("path")
|
|
6
|
-
const fs = require("fs-extra")
|
|
3
|
+
Here how we did it using our builder `Webpack`:
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
```javascript
|
|
6
|
+
{
|
|
7
|
+
resolve: {
|
|
8
|
+
alias: {
|
|
9
|
+
// alias the path used in the url() in the core/fonts.scss file
|
|
10
|
+
["fonts/BrandFont.woff"]: path.resolve(
|
|
11
|
+
__dirname,
|
|
12
|
+
"our/path/to/fonts/OurOfficialBrandFont.woff"
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
You can use another builder as long as it provides a way to alias an asset when importing it or just use the placeholder font.
|