igniteui-theming 1.0.0-beta.16 → 1.0.0-beta.17
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/.github/workflows/npm-publish.yml +3 -0
- package/README.md +104 -0
- package/package.json +7 -1
- package/sass/color/_functions.scss +2 -2
- package/sass/color/_types.scss +4 -22
- package/sass/color/presets/dark/_bootstrap.scss +3 -0
- package/sass/color/presets/dark/_extra.scss +3 -0
- package/sass/color/presets/dark/_fluent.scss +3 -0
- package/sass/color/presets/dark/_indigo.scss +3 -0
- package/sass/color/presets/dark/_material.scss +3 -0
- package/sass/color/presets/light/_bootstrap.scss +3 -0
- package/sass/color/presets/light/_extra.scss +3 -0
- package/sass/color/presets/light/_fluent.scss +3 -0
- package/sass/color/presets/light/_indigo.scss +3 -0
- package/sass/color/presets/light/_material.scss +3 -0
- package/sass/elevations/presets/_material.scss +55 -24
- package/sass/typography/presets/_bootstrap.scss +132 -116
- package/sass/typography/presets/_fluent.scss +133 -116
- package/sass/typography/presets/_indigo.scss +134 -117
- package/sass/typography/presets/_material.scss +134 -118
- package/scripts/buildJSON.mjs +166 -0
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
|
|
2
|
+
<h1 align="center">
|
|
3
|
+
Ignite UI Theming - from Infragistics
|
|
4
|
+
</h1>
|
|
5
|
+
|
|
6
|
+
[](https://badge.fury.io/js/igniteui-theming)
|
|
7
|
+
|
|
8
|
+
The Ignite UI Theming repository collects a set of Sass mixins, functions, and variables used to create themes for a variety of UI frameworks built by Infragistics. The theming package makes it super easy to create palettes, elevations and typography styles for your projects.
|
|
9
|
+
|
|
10
|
+
## Palettes
|
|
11
|
+
We provide four predefined palettes - material, bootstrap, fluent and indigo that have all the necessary colors along with diffent variants of those colors to make it even easier picking the right one for your case. Here's what they look like:
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
To access any of the colors in the palettes, you can use the `color` function:
|
|
16
|
+
|
|
17
|
+
```scss
|
|
18
|
+
background: color($light-material-palette, 'primary', 500);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You can take a further look on what color functions and mixins the package contains and how to use them in the [Colors Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Colors-(Draft))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Typography
|
|
25
|
+
Another valuable module of our theming package is the typography, helping you have consistency all over your project. There are again four typography presets for the four themes that we provide out of the box.
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
You can set any of the typefaces by using the `typography` mixin, which accepts 2 arguments(font-family and type-scale). By default the typography is using the material typeface and type-scale.
|
|
30
|
+
|
|
31
|
+
```scss
|
|
32
|
+
@include typography($font-family: $material-typeface, $type-scale: $material-type-scale);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Learn more about the typography module in the package by checking out the [Typography Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Typography-(Draft))
|
|
36
|
+
|
|
37
|
+
## Elevations
|
|
38
|
+
The theming package is providing one preset of shadows that can be used to give your components a lift. They're super helpful using with buttons, cards, navigation bars, etc.
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
You can set elevations 0-24, by using the `elevation` function, which accepts the elevation level as an argument:
|
|
43
|
+
|
|
44
|
+
```scss
|
|
45
|
+
box-shadow: elevation(12);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Learn more about elevations and their abilities in the [Elevations Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Elevations-(draft))
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
In order to use the Ignite UI Theming in your application you should install the `igniteui-theming` package:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
npm install igniteui-theming
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Next, you will need to **use** it in the file that you want like this:
|
|
59
|
+
|
|
60
|
+
```scss
|
|
61
|
+
@use '.../node_modules/igniteui-theming/' as *;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
You can also **use** just a fraction of the package:
|
|
65
|
+
|
|
66
|
+
```scss
|
|
67
|
+
@use '.../node_modules/igniteui-theming/sass/color' as *;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
We provide presets for **material, bootstrap, fluent and indigo** themes for the color(light and dark palettes), typography and elevations fractions. You can import them into your scss file like this:
|
|
71
|
+
|
|
72
|
+
```scss
|
|
73
|
+
@use '.../node_modules/igniteui-theming/sass/typography/presets' as *;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
You can read more about what the package contains on the [Wiki page](https://github.com/IgniteUI/igniteui-theming/wiki)
|
|
77
|
+
|
|
78
|
+
## Linting and Testing
|
|
79
|
+
|
|
80
|
+
To scan the project for linting errors, run
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
npm run lint
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
To run the suite of tests, run
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
npm run test
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Building and Running API Docs
|
|
93
|
+
|
|
94
|
+
To build the docs, run
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
npm run build:docs
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
To start the docs in your browser, run
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
npm run serve:docs
|
|
104
|
+
```
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-theming",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.17",
|
|
4
4
|
"description": "A set of Sass variables, mixins, and functions for generating palettes, typography, and elevations used by Ignite UI components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"clean": "rimraf \"json/\"",
|
|
8
|
+
"build": "npm run build:json && npm run build:e2e",
|
|
7
9
|
"build:docs": "npx sassdoc ./sass",
|
|
8
10
|
"build:e2e": "sass ./test/e2e/theme.scss ./test/e2e/theme.css",
|
|
11
|
+
"build:json": "node scripts/buildJSON.mjs",
|
|
9
12
|
"lint": "stylelint ./sass",
|
|
10
13
|
"test": "jest",
|
|
11
14
|
"serve:docs": "npx http-server ./sassdoc"
|
|
@@ -38,8 +41,11 @@
|
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
43
|
"devDependencies": {
|
|
44
|
+
"globby": "^13.1.2",
|
|
41
45
|
"jest": "^28.1.1",
|
|
42
46
|
"postcss": "^8.4.14",
|
|
47
|
+
"rimraf": "^3.0.2",
|
|
48
|
+
"sass-export": "^2.1.2",
|
|
43
49
|
"sass-true": "^6.1.0",
|
|
44
50
|
"stylelint": "^14.9.1",
|
|
45
51
|
"stylelint-config-standard-scss": "^4.0.0",
|
|
@@ -45,8 +45,8 @@ $_enhanced-accessibility: false;
|
|
|
45
45
|
$error: null,
|
|
46
46
|
$variant: null,
|
|
47
47
|
) {
|
|
48
|
-
$color-shades:
|
|
49
|
-
$gray-shades:
|
|
48
|
+
$color-shades: types.$IColorShades;
|
|
49
|
+
$gray-shades: types.$IGrayShades;
|
|
50
50
|
$primary-palette: shades('primary', $primary, $color-shades);
|
|
51
51
|
$secondary-palette: shades('secondary', $secondary, $color-shades);
|
|
52
52
|
$surface-palette: shades('surface', $surface, $color-shades);
|
package/sass/color/_types.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use 'sass:list';
|
|
2
3
|
|
|
3
4
|
////
|
|
4
5
|
/// @group Palettes
|
|
@@ -6,30 +7,11 @@
|
|
|
6
7
|
|
|
7
8
|
/// A list consisting of all generated gray shades
|
|
8
9
|
/// @type Map
|
|
9
|
-
$IGrayShades: (
|
|
10
|
-
50: '',
|
|
11
|
-
100: '',
|
|
12
|
-
200: '',
|
|
13
|
-
300: '',
|
|
14
|
-
400: '',
|
|
15
|
-
500: '',
|
|
16
|
-
600: '',
|
|
17
|
-
700: '',
|
|
18
|
-
800: '',
|
|
19
|
-
900: '',
|
|
20
|
-
);
|
|
10
|
+
$IGrayShades: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900);
|
|
21
11
|
|
|
22
12
|
/// A list consisting of all generated shades for palette colors
|
|
23
13
|
/// @type Map
|
|
24
|
-
$IColorShades:
|
|
25
|
-
$IGrayShades,
|
|
26
|
-
(
|
|
27
|
-
'A100': '',
|
|
28
|
-
'A200': '',
|
|
29
|
-
'A400': '',
|
|
30
|
-
'A700': '',
|
|
31
|
-
)
|
|
32
|
-
);
|
|
14
|
+
$IColorShades: list.join($IGrayShades, ('A100', 'A200', 'A400', 'A700'));
|
|
33
15
|
|
|
34
16
|
/// All palette colors mapped with corresponding color shades
|
|
35
17
|
/// @type Map
|
|
@@ -47,7 +29,7 @@ $IPaletteColors: (
|
|
|
47
29
|
/// A list consisting of palette metadata
|
|
48
30
|
/// @type Map
|
|
49
31
|
$IPaletteMeta: (
|
|
50
|
-
'variant':
|
|
32
|
+
'variant': null,
|
|
51
33
|
);
|
|
52
34
|
|
|
53
35
|
/// A map with all palette colors and palette meta
|
|
@@ -17,6 +17,32 @@ $_color-2: rgba(0 0 0 / 12%);
|
|
|
17
17
|
/// @type Color
|
|
18
18
|
$_color-3: rgba(0 0 0 / 8%);
|
|
19
19
|
|
|
20
|
+
/// All elevation levels
|
|
21
|
+
$_1: box-shadow((0 1px 3px 0 $_color-1, 0 1px 1px 0 $_color-2, 0 2px 1px -1px $_color-3));
|
|
22
|
+
$_2: box-shadow((0 1px 5px 0 $_color-1, 0 2px 2px 0 $_color-2, 0 3px 1px -2px $_color-3));
|
|
23
|
+
$_3: box-shadow((0 1px 8px 0 $_color-1, 0 3px 4px 0 $_color-2, 0 3px 3px -2px $_color-3));
|
|
24
|
+
$_4: box-shadow((0 2px 4px -1px $_color-1, 0 4px 5px 0 $_color-2, 0 1px 10px 0 $_color-3));
|
|
25
|
+
$_5: box-shadow((0 3px 5px -1px $_color-1, 0 5px 8px 0 $_color-2, 0 1px 14px 0 $_color-3));
|
|
26
|
+
$_6: box-shadow((0 3px 5px -1px $_color-1, 0 6px 10px 0 $_color-2, 0 1px 18px 0 $_color-3));
|
|
27
|
+
$_7: box-shadow((0 4px 5px -2px $_color-1, 0 7px 10px 1px $_color-2, 0 2px 16px 1px $_color-3));
|
|
28
|
+
$_8: box-shadow((0 5px 5px -3px $_color-1, 0 8px 10px 1px $_color-2, 0 3px 14px 2px $_color-3));
|
|
29
|
+
$_9: box-shadow((0 5px 6px -3px $_color-1, 0 9px 12px 1px $_color-2, 0 3px 16px 2px $_color-3));
|
|
30
|
+
$_10: box-shadow((0 6px 6px -3px $_color-1, 0 10px 14px 1px $_color-2, 0 4px 18px 3px $_color-3));
|
|
31
|
+
$_11: box-shadow((0 6px 7px -4px $_color-1, 0 11px 15px 1px $_color-2, 0 4px 20px 3px $_color-3));
|
|
32
|
+
$_12: box-shadow((0 7px 8px -4px $_color-1, 0 12px 17px 2px $_color-2, 0 5px 22px 4px $_color-3));
|
|
33
|
+
$_13: box-shadow((0 7px 8px -4px $_color-1, 0 13px 19px 2px $_color-2, 0 5px 24px 4px $_color-3));
|
|
34
|
+
$_14: box-shadow((0 7px 9px -4px $_color-1, 0 14px 21px 2px $_color-2, 0 5px 26px 4px $_color-3));
|
|
35
|
+
$_15: box-shadow((0 8px 9px -5px $_color-1, 0 15px 22px 2px $_color-2, 0 6px 28px 5px $_color-3));
|
|
36
|
+
$_16: box-shadow((0 8px 10px -5px $_color-1, 0 16px 24px 2px $_color-2, 0 6px 30px 5px $_color-3));
|
|
37
|
+
$_17: box-shadow((0 8px 11px -5px $_color-1, 0 17px 26px 2px $_color-2, 0 6px 32px 5px $_color-3));
|
|
38
|
+
$_18: box-shadow((0 9px 11px -5px $_color-1, 0 18px 28px 2px $_color-2, 0 7px 34px 6px $_color-3));
|
|
39
|
+
$_19: box-shadow((0 9px 12px -6px $_color-1, 0 19px 29px 2px $_color-2, 0 7px 36px 6px $_color-3));
|
|
40
|
+
$_20: box-shadow((0 10px 13px -6px $_color-1, 0 20px 31px 3px $_color-2, 0 8px 38px 7px $_color-3));
|
|
41
|
+
$_21: box-shadow((0 10px 13px -6px $_color-1, 0 21px 33px 3px $_color-2, 0 8px 40px 7px $_color-3));
|
|
42
|
+
$_22: box-shadow((0 10px 14px -6px $_color-1, 0 22px 35px 3px $_color-2, 0 8px 42px 7px $_color-3));
|
|
43
|
+
$_23: box-shadow((0 11px 14px -7px $_color-1, 0 23px 36px 3px $_color-2, 0 9px 44px 8px $_color-3));
|
|
44
|
+
$_24: box-shadow((0 11px 15px -7px $_color-1, 0 24px 38px 3px $_color-2, 0 9px 46px 8px $_color-3));
|
|
45
|
+
|
|
20
46
|
/// Allows user configration of this module.
|
|
21
47
|
@mixin configure($color-1, $color-2, $color-3) {
|
|
22
48
|
@if $color-1 {
|
|
@@ -32,32 +58,37 @@ $_color-3: rgba(0 0 0 / 8%);
|
|
|
32
58
|
}
|
|
33
59
|
}
|
|
34
60
|
|
|
61
|
+
/**
|
|
62
|
+
* @sass-export-section="material"
|
|
63
|
+
*/
|
|
35
64
|
/// А map of 24 shadow elevations with the umbra, penumbra and ambient shadows.
|
|
36
65
|
/// @type Map
|
|
37
66
|
$elevations: (
|
|
38
67
|
0: none,
|
|
39
|
-
1:
|
|
40
|
-
2:
|
|
41
|
-
3:
|
|
42
|
-
4:
|
|
43
|
-
5:
|
|
44
|
-
6:
|
|
45
|
-
7:
|
|
46
|
-
8:
|
|
47
|
-
9:
|
|
48
|
-
10:
|
|
49
|
-
11:
|
|
50
|
-
12:
|
|
51
|
-
13:
|
|
52
|
-
14:
|
|
53
|
-
15:
|
|
54
|
-
16:
|
|
55
|
-
17:
|
|
56
|
-
18:
|
|
57
|
-
19:
|
|
58
|
-
20:
|
|
59
|
-
21:
|
|
60
|
-
22:
|
|
61
|
-
23:
|
|
62
|
-
24:
|
|
68
|
+
1: $_1,
|
|
69
|
+
2: $_2,
|
|
70
|
+
3: $_3,
|
|
71
|
+
4: $_4,
|
|
72
|
+
5: $_5,
|
|
73
|
+
6: $_6,
|
|
74
|
+
7: $_7,
|
|
75
|
+
8: $_8,
|
|
76
|
+
9: $_9,
|
|
77
|
+
10: $_10,
|
|
78
|
+
11: $_11,
|
|
79
|
+
12: $_12,
|
|
80
|
+
13: $_13,
|
|
81
|
+
14: $_14,
|
|
82
|
+
15: $_15,
|
|
83
|
+
16: $_16,
|
|
84
|
+
17: $_17,
|
|
85
|
+
18: $_18,
|
|
86
|
+
19: $_19,
|
|
87
|
+
20: $_20,
|
|
88
|
+
21: $_21,
|
|
89
|
+
22: $_22,
|
|
90
|
+
23: $_23,
|
|
91
|
+
24: $_24
|
|
63
92
|
);
|
|
93
|
+
|
|
94
|
+
// @end-sass-export-section
|