@ukic/fonts 2.0.0-alpha.116 → 2.0.0-alpha.117

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/package.json +3 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 The Secret Intelligence Service (MI6)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Using the UI Kit Fonts
2
+
3
+ This package includes fonts used within ICDS components.
4
+
5
+ ## Adding a font
6
+
7
+ This will add a font to the package. You shouldn't have to do this.
8
+
9
+ Install the desired font from `@fontsource`:
10
+
11
+ ````
12
+ npm install @fontsource/open-sans --save-dev
13
+ ````
14
+
15
+ Import the package or particular font weight CSS file into `src/fonts.js`:
16
+
17
+ ````js
18
+ // src/fonts.js
19
+ import '@fontsource/open-sans/300.css';
20
+ ````
21
+
22
+ Run `npm run build` and a `dist` directory will appear with the font files and main `font.css` file
23
+
24
+ ## Using this package
25
+
26
+ Run `npm install @ukic/fonts` at the root level of your project.
27
+
28
+ The `fonts.css` file can be imported:
29
+
30
+ ### Javascript
31
+
32
+ ````js
33
+ import '@ukic/fonts/dist/fonts.css'
34
+ ````
35
+
36
+ ### CSS
37
+
38
+ ````css
39
+ /* In some cases, reference to the node_modules directory may be required. */
40
+ @import '@ukic/fonts/dist/fonts.css'
41
+ ````
42
+
43
+ ### Build
44
+
45
+ Webpack is used to extract the fonts from `node_modules/@fontsource/*` directory and build the `fonts.css` file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukic/fonts",
3
- "version": "2.0.0-alpha.116",
3
+ "version": "2.0.0-alpha.117",
4
4
  "description": "@ukic/fonts provides typography assets to ICDS components",
5
5
  "scripts": {
6
6
  "build": "rimraf ./dist && webpack --config webpack.config.js",
@@ -18,5 +18,6 @@
18
18
  "rimraf": "^3.0.2",
19
19
  "webpack": "^5.70.0",
20
20
  "webpack-cli": "^4.9.2"
21
- }
21
+ },
22
+ "gitHead": "95357939ace05ebb8c86796738eb35cfc93730b6"
22
23
  }