@sb1/ffe-core 27.0.0 → 27.0.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/README.md +36 -10
- package/less/waves.less +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @sb1/ffe-core
|
|
2
2
|
|
|
3
|
-
**ffe-core**
|
|
3
|
+
**ffe-core** contains styling common to all components in FFE - typography, colors, etc.
|
|
4
4
|
It also includes JavaScript exports for color and breakpoint variables.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
@@ -12,6 +12,12 @@ npm install --save-dev less less-plugin-npm-import # less-plugin is optional,
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
+
Full documentation on usage is available at:
|
|
16
|
+
|
|
17
|
+
https://design.sparebank1.no/komponenter/typografi/
|
|
18
|
+
https://design.sparebank1.no/profil/farger/
|
|
19
|
+
https://design.sparebank1.no/profil/spacing/
|
|
20
|
+
|
|
15
21
|
```less
|
|
16
22
|
/* Your project's main .less import file */
|
|
17
23
|
@import 'npm://@sb1/ffe-core/less/ffe'; // with less-plugin
|
|
@@ -19,10 +25,10 @@ npm install --save-dev less less-plugin-npm-import # less-plugin is optional,
|
|
|
19
25
|
@import '../path/to/node_modules/@sb1/ffe-core/less/ffe'; // direct reference
|
|
20
26
|
```
|
|
21
27
|
|
|
22
|
-
### Importing
|
|
28
|
+
### Importing specific parts
|
|
23
29
|
|
|
24
|
-
In some cases, you
|
|
25
|
-
|
|
30
|
+
In some cases, you may not require everything in this package. You can import the
|
|
31
|
+
parts you require if you want:
|
|
26
32
|
|
|
27
33
|
```less
|
|
28
34
|
// Variables
|
|
@@ -38,6 +44,16 @@ pieces you require if you want:
|
|
|
38
44
|
@import '~@sb1/ffe-core/less/accessibility';
|
|
39
45
|
```
|
|
40
46
|
|
|
47
|
+
## Theming with CSS custom properties
|
|
48
|
+
|
|
49
|
+
Theming of components is supported through a set of custom properties, defined in a `less/theme.less` file in every styling package. The properties in `ffe-core` constitute a base theme, which is in turn used as default values in other packages. You may override the properties in each individual package in order to customize a single component, or override the properties defined in `ffe-core` to customize a sitewide theme.
|
|
50
|
+
|
|
51
|
+
If your project uses the core styling, you're probably good to go. If not, make sure to import the core properties in `theme.less` from `ffe-core`:
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@import '~@sb1/ffe-core/less/theme';
|
|
55
|
+
```
|
|
56
|
+
|
|
41
57
|
## Design tokens
|
|
42
58
|
|
|
43
59
|
This package provides a set of less files containing variables for colors and other reusable constants. These files are:
|
|
@@ -48,19 +64,29 @@ This package provides a set of less files containing variables for colors and ot
|
|
|
48
64
|
- less/motion.less
|
|
49
65
|
- less/spacing.less
|
|
50
66
|
|
|
51
|
-
The less variables specified in this package are also
|
|
52
|
-
available as named JavaScript imports. This can be useful for consumers that use
|
|
53
|
-
CSS-in-JS, or that need access to these values in their JavaScript for other
|
|
54
|
-
reasons. They are named the same as their LESS siblings, but are camelCased, and
|
|
55
|
-
are without their `@ffe-` prefix.
|
|
67
|
+
The less variables specified in this package are also available as named JavaScript imports. This can be useful for consumers that use CSS-in-JS, or that need access to these values in their JavaScript for other reasons. They are named the same as their LESS siblings, but are camelCased, and do not have the `@ffe-` prefix.
|
|
56
68
|
|
|
57
69
|
This is how you import them:
|
|
58
70
|
|
|
59
71
|
```js
|
|
60
72
|
import {
|
|
61
|
-
|
|
73
|
+
fargeHvit,
|
|
62
74
|
fargeFjell30,
|
|
63
75
|
breakpointMd,
|
|
64
76
|
spacingXl,
|
|
65
77
|
} from '@sb1/ffe-core';
|
|
66
78
|
```
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
|
|
82
|
+
To start a local development server, run the following from the designsystem root folder:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm install
|
|
86
|
+
npm run build
|
|
87
|
+
npm start
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
A local instance of `component-overview` with live reloading will run at http://localhost:1234/.
|
|
91
|
+
|
|
92
|
+
Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
|
package/less/waves.less
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-core",
|
|
3
|
-
"version": "27.0.
|
|
3
|
+
"version": "27.0.1",
|
|
4
4
|
"description": "Rammeverk for Felles Front End",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "1ab898e744977e4cb4db1bee9b65369a0deeef9a"
|
|
35
35
|
}
|