@sb1/ffe-symbols 1.1.1
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/LICENSE.md +21 -0
- package/README.md +66 -0
- package/ffe-symbol-font-inline.less +9 -0
- package/ffe-symbol.css +44 -0
- package/ffe-symbol.less +9 -0
- package/icons/MaterialSymbolsRounded.woff2 +0 -0
- package/package.json +35 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 SpareBank 1
|
|
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,66 @@
|
|
|
1
|
+
# @sb1/ffe-symbols
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install --save @sb1/ffe-symbols
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Full documentation on icon usage is available at https://design.sparebank1.no/komponenter/ikoner/.
|
|
12
|
+
|
|
13
|
+
There are two ways to use `ffe-symbols`:
|
|
14
|
+
|
|
15
|
+
1. Copy the font files from `node_modules/@sb1/ffe-symbols/icons/` and use `ffe-symbol.less`
|
|
16
|
+
2. Use `ffe-symbol.css`, where the icon font is base64 encoded inline
|
|
17
|
+
|
|
18
|
+
Approach 1 is probably what you want for performance reasons.
|
|
19
|
+
|
|
20
|
+
### Using Less
|
|
21
|
+
|
|
22
|
+
Copy the font files from `node_modules/@sb1/ffe-symbol/icons/` to a folder that will be shipped with your app. You can use npm-scripts, (if you use Webpack) [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin), or whatever you see fit to get the files to where they need to be.
|
|
23
|
+
|
|
24
|
+
Import `node_modules/@sb1/ffe-symbols/ffe-symbol.less` in your app:
|
|
25
|
+
|
|
26
|
+
```less
|
|
27
|
+
@import 'npm://@sb1/ffe-symbol/ffe-symbol.less'; // with less-plugin
|
|
28
|
+
@import '~@sb1/ffe-symbol/ffe-symbol.less'; // with webpack and less-loader
|
|
29
|
+
@import '../path/to/node_modules/@sb1/ffe-symbol/ffe-symbol.less'; // by path
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
You need to provide a constant named `@icons-url` after the `@import` with a URL path to the fonts folder so the browser knows where to download the font files.
|
|
33
|
+
|
|
34
|
+
```less
|
|
35
|
+
@import '~@sb1/ffe-symbol/ffe-symbol.less';
|
|
36
|
+
@icons-url: '/privat/forsikring/icons';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### CSS with inline fonts
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
@import url('~@sb1/ffe-symbol/ffe-symbol.css');
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```less
|
|
46
|
+
@import (inline) '~@sb1/ffe-symbol/ffe-symbol.css';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## React component
|
|
50
|
+
|
|
51
|
+
See `@sb1/ffe-symbols-react`.
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
To start a local development server, run the following from the designsystem root folder:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install
|
|
59
|
+
npm run build
|
|
60
|
+
npm start
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
A local instance of `component-overview` with live reloading will run at http://localhost:1234/.
|
|
64
|
+
NOTE: `component-overview` uses the css-implementation, so you'll have to run `npm run build` to see the changes made to the styling.
|
|
65
|
+
|
|
66
|
+
Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
|