@drivy/cobalt 0.23.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivy/cobalt",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Opinionated design system for Drivy's projects.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -68,6 +68,7 @@
68
68
  "core-js": "3.26.1",
69
69
  "css-loader": "6.7.2",
70
70
  "eslint": "8.28.0",
71
+ "file-loader": "6.2.0",
71
72
  "jest": "29.3.1",
72
73
  "jest-environment-jsdom": "29.3.1",
73
74
  "nested-object-access": "^0.2.5",
@@ -133,7 +134,7 @@
133
134
  },
134
135
  "files": [
135
136
  "tokens/**/*",
136
- "**/*.{scss,css,d.ts,js,js.map,svg,png,woff,woff2}",
137
+ "**/*.{scss,css,d.ts,js,js.map,svg,png,woff,woff2,md}",
137
138
  ".stylelintrc.js"
138
139
  ],
139
140
  "publishConfig": {
@@ -0,0 +1,9 @@
1
+ @font-face {
2
+ font-family: "BrownPro";
3
+ font-style: normal;
4
+ font-weight: bold;
5
+ font-display: swap;
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");
9
+ }
package/styles/core.scss CHANGED
@@ -1,3 +1,4 @@
1
+ @import "core/fonts";
1
2
  @import "core/palette";
2
3
  @import "core/theme";
3
4
  @import "core/utilities";
Binary file
@@ -0,0 +1,19 @@
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
+
3
+ Here how we did it using our builder `Webpack`:
4
+
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
+ }
17
+ ```
18
+
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.