@filip.mazev/blocks 1.0.43 → 1.2.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/README.md +1 -3
- package/core/styles/_index.scss +11 -0
- package/core/styles/_mixins.scss +36 -0
- package/core/styles/_palettes.scss +159 -0
- package/core/styles/_theme-engine.scss +249 -0
- package/core/styles/_utilities.scss +157 -0
- package/core/styles/_variables.scss +57 -0
- package/core/styles/themes/_green-theme.scss +4 -0
- package/core/styles/themes/_high-contrast-theme.scss +122 -0
- package/core/styles/themes/_orange-theme.scss +4 -0
- package/core/styles/themes/_purple-theme.scss +4 -0
- package/core/styles/themes/_red-theme.scss +4 -0
- package/fesm2022/filip.mazev-blocks.mjs +1 -1
- package/fesm2022/filip.mazev-blocks.mjs.map +1 -1
- package/package.json +2 -8
- package/types/filip.mazev-blocks.d.ts +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ ng add @filip.mazev/blocks
|
|
|
16
16
|
|
|
17
17
|
When you run the command above, the Angular CLI will execute our custom schematic to handle the boilerplate for you:
|
|
18
18
|
|
|
19
|
-
* Interactive Theme Selection: You will be prompted to choose your preferred global theme
|
|
19
|
+
* Interactive Theme Selection: You will be prompted to choose your preferred global theme.
|
|
20
20
|
* Dependency Management: Automatically adds the latest versions of the Blocks ecosystem to your package.json and runs npm install.
|
|
21
21
|
* SCSS Injection: Intelligently locates your project's global stylesheet (styles.scss or styles.sass) and injects the required @use statements, mixins, and both light/dark mode CSS variables based on your theme selection.
|
|
22
22
|
|
|
@@ -43,5 +43,3 @@ Then, manually configure your styles.scss:
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
```
|
|
46
|
-
|
|
47
|
-
_For detailed usage instructions, API references, and component configurations, please refer to the READMEs of the individual packages._
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@forward 'mixins';
|
|
2
|
+
@forward 'variables';
|
|
3
|
+
@forward 'utilities';
|
|
4
|
+
@forward 'palettes';
|
|
5
|
+
@forward 'theme-engine';
|
|
6
|
+
|
|
7
|
+
@forward 'themes/purple-theme';
|
|
8
|
+
@forward 'themes/orange-theme';
|
|
9
|
+
@forward 'themes/red-theme';
|
|
10
|
+
@forward 'themes/green-theme';
|
|
11
|
+
@forward 'themes/high-contrast-theme';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use 'variables' as *;
|
|
3
|
+
|
|
4
|
+
@mixin respond-up($size) {
|
|
5
|
+
@media (min-width: map.get($breakpoints, $size)) {
|
|
6
|
+
@content;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@mixin respond-down($size) {
|
|
11
|
+
@media (max-width: map.get($breakpoints, $size)) {
|
|
12
|
+
@content;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin respond-between($min, $max) {
|
|
17
|
+
@media (min-width: map.get($breakpoints, $min)) and (max-width: map.get($breakpoints, $max)) {
|
|
18
|
+
@content;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@function spacing($key) {
|
|
23
|
+
@return map.get($spacing, $key);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@function radius($key) {
|
|
27
|
+
@return map.get($radiuses, $key);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@function shadow($key) {
|
|
31
|
+
@return map.get($shadows, $key);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@function z($key) {
|
|
35
|
+
@return map.get($z-index, $key);
|
|
36
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
$orange-palette: (
|
|
4
|
+
50: #FFF7ED,
|
|
5
|
+
100: #FFEDD4,
|
|
6
|
+
200: #FFD6A7,
|
|
7
|
+
300: #FFB86A,
|
|
8
|
+
400: #FF8904,
|
|
9
|
+
500: #FF6900,
|
|
10
|
+
600: #F54900,
|
|
11
|
+
700: #CA3500,
|
|
12
|
+
800: #9F2D00,
|
|
13
|
+
900: #551111,
|
|
14
|
+
1000: #441306) !default;
|
|
15
|
+
|
|
16
|
+
$purple-palette: (
|
|
17
|
+
50: #F4EBFF,
|
|
18
|
+
100: #E6D4FF,
|
|
19
|
+
200: #CFA3FF,
|
|
20
|
+
300: #B36BFF,
|
|
21
|
+
400: #922FFF,
|
|
22
|
+
500: #6D00FF,
|
|
23
|
+
600: #5700CC,
|
|
24
|
+
700: #410099,
|
|
25
|
+
800: #2C0066,
|
|
26
|
+
900: #160033,
|
|
27
|
+
1000: #0B001A) !default;
|
|
28
|
+
|
|
29
|
+
$red-palette: (
|
|
30
|
+
50: #FDF1F0,
|
|
31
|
+
100: #FADCDA,
|
|
32
|
+
200: #F5B0AB,
|
|
33
|
+
300: #EF8079,
|
|
34
|
+
400: #EA4C43,
|
|
35
|
+
500: #E3241B,
|
|
36
|
+
600: #BE1810,
|
|
37
|
+
700: #991009,
|
|
38
|
+
800: #750904,
|
|
39
|
+
900: #520401,
|
|
40
|
+
1000: #2E0200) !default;
|
|
41
|
+
|
|
42
|
+
$green-palette: (
|
|
43
|
+
50: #F7FCE8,
|
|
44
|
+
100: #EDF8C8,
|
|
45
|
+
200: #DDF19C,
|
|
46
|
+
300: #CAE96A,
|
|
47
|
+
400: #BEE046,
|
|
48
|
+
500: #B0D624,
|
|
49
|
+
600: #92B518,
|
|
50
|
+
700: #718F10,
|
|
51
|
+
800: #556D0C,
|
|
52
|
+
900: #3C4E08,
|
|
53
|
+
1000: #212C03) !default;
|
|
54
|
+
|
|
55
|
+
$danger-palette: (
|
|
56
|
+
50: #FFFCFC,
|
|
57
|
+
100: #F4E5E5,
|
|
58
|
+
200: #EAD0D0,
|
|
59
|
+
300: #DE9E9E,
|
|
60
|
+
400: #F76D6D,
|
|
61
|
+
500: #D94D4D,
|
|
62
|
+
600: #C93D3D,
|
|
63
|
+
700: #BA2E2E,
|
|
64
|
+
800: #722222,
|
|
65
|
+
900: #2B1717,
|
|
66
|
+
1000: #0E0C0C) !default;
|
|
67
|
+
|
|
68
|
+
$warn-palette: (
|
|
69
|
+
50: #FFFEFB,
|
|
70
|
+
100: #F7F0E3,
|
|
71
|
+
200: #EAE3D0,
|
|
72
|
+
300: #E7C892,
|
|
73
|
+
400: #E4AD55,
|
|
74
|
+
500: #C68D36,
|
|
75
|
+
600: #B77D27,
|
|
76
|
+
700: #A96D18,
|
|
77
|
+
800: #6A4817,
|
|
78
|
+
900: #2B2317,
|
|
79
|
+
1000: #0E0D0C) !default;
|
|
80
|
+
|
|
81
|
+
$success-palette: (
|
|
82
|
+
50: #FCFFFC,
|
|
83
|
+
100: #E6F4E6,
|
|
84
|
+
200: #D1EAD0,
|
|
85
|
+
300: #98D6A0,
|
|
86
|
+
400: #5FC370,
|
|
87
|
+
500: #3FA94E,
|
|
88
|
+
600: #2E9C3E,
|
|
89
|
+
700: #1E8F2D,
|
|
90
|
+
800: #1A5D22,
|
|
91
|
+
900: #172B18,
|
|
92
|
+
1000: #0C0E0C) !default;
|
|
93
|
+
|
|
94
|
+
$information-palette: (
|
|
95
|
+
50: #FBFDFF,
|
|
96
|
+
100: #E5EEF7,
|
|
97
|
+
200: #D0DDEA,
|
|
98
|
+
300: #97CACE,
|
|
99
|
+
400: #5FB7C3,
|
|
100
|
+
500: #3E90B5,
|
|
101
|
+
600: #2E7CAE,
|
|
102
|
+
700: #1E69A7,
|
|
103
|
+
800: #1A4469,
|
|
104
|
+
900: #17202B,
|
|
105
|
+
1000: #0C0D0E) !default;
|
|
106
|
+
|
|
107
|
+
$neutral-palette: (
|
|
108
|
+
50: #FAFAFA,
|
|
109
|
+
100: #F5F5F5,
|
|
110
|
+
200: #E5E5E5,
|
|
111
|
+
300: #D4D4D4,
|
|
112
|
+
400: #A1A1A1,
|
|
113
|
+
500: #737373,
|
|
114
|
+
600: #525252,
|
|
115
|
+
700: #404040,
|
|
116
|
+
800: #262626,
|
|
117
|
+
900: #171717,
|
|
118
|
+
1000: #0A0A0A) !default;
|
|
119
|
+
|
|
120
|
+
$hc-black: #000000;
|
|
121
|
+
$hc-white: #ffffff;
|
|
122
|
+
$hc-yellow: #e4d500;
|
|
123
|
+
$hc-cyan: #00f3f3;
|
|
124
|
+
$hc-red: #ff0000;
|
|
125
|
+
$hc-green: #00ff00;
|
|
126
|
+
|
|
127
|
+
$all-palettes: (
|
|
128
|
+
'orange': $orange-palette,
|
|
129
|
+
'purple': $purple-palette,
|
|
130
|
+
'red': $red-palette,
|
|
131
|
+
'green': $green-palette,
|
|
132
|
+
'danger': $danger-palette,
|
|
133
|
+
'warn': $warn-palette,
|
|
134
|
+
'success': $success-palette,
|
|
135
|
+
'information': $information-palette,
|
|
136
|
+
'neutral': $neutral-palette) !default;
|
|
137
|
+
|
|
138
|
+
@function get-palette($name) {
|
|
139
|
+
@if map.has-key($all-palettes, $name) {
|
|
140
|
+
@return map.get($all-palettes, $name
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@else {
|
|
145
|
+
@error "The palette '#{$name}' does not exist in @filip.mazev/blocks/core/styles/index.";
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@function get-color-from-palette($palette-name, $shade) {
|
|
150
|
+
$palette: get-palette($palette-name);
|
|
151
|
+
|
|
152
|
+
@if map.has-key($palette, $shade) {
|
|
153
|
+
@return map.get($palette, $shade);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@else {
|
|
157
|
+
@error "Shade '#{$shade}' not found in palette '#{$palette-name}'.";
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:list';
|
|
3
|
+
@use 'palettes' as *;
|
|
4
|
+
|
|
5
|
+
$required-theme-keys: (
|
|
6
|
+
'bg-canvas',
|
|
7
|
+
'bg-surface',
|
|
8
|
+
'bg-surface-alt',
|
|
9
|
+
'bg-element',
|
|
10
|
+
'bg-element-hover',
|
|
11
|
+
'bg-element-active',
|
|
12
|
+
|
|
13
|
+
'primary',
|
|
14
|
+
'primary-hover',
|
|
15
|
+
'primary-active',
|
|
16
|
+
'primary-subtle',
|
|
17
|
+
'on-primary',
|
|
18
|
+
|
|
19
|
+
'text-heading',
|
|
20
|
+
'text-primary',
|
|
21
|
+
'text-secondary',
|
|
22
|
+
'text-brand',
|
|
23
|
+
'text-inverse',
|
|
24
|
+
'text-info',
|
|
25
|
+
'text-warn',
|
|
26
|
+
'text-success',
|
|
27
|
+
'text-danger',
|
|
28
|
+
|
|
29
|
+
'border-subtle',
|
|
30
|
+
'border-default',
|
|
31
|
+
'border-strong',
|
|
32
|
+
'border-brand',
|
|
33
|
+
'border-info',
|
|
34
|
+
'border-success',
|
|
35
|
+
'border-warn',
|
|
36
|
+
'border-danger',
|
|
37
|
+
|
|
38
|
+
'bg-info',
|
|
39
|
+
'bg-info-hover',
|
|
40
|
+
'bg-info-active',
|
|
41
|
+
'bg-info-disabled',
|
|
42
|
+
'bg-info-subtle',
|
|
43
|
+
|
|
44
|
+
'bg-success',
|
|
45
|
+
'bg-success-hover',
|
|
46
|
+
'bg-success-active',
|
|
47
|
+
'bg-success-disabled',
|
|
48
|
+
'bg-success-subtle',
|
|
49
|
+
|
|
50
|
+
'bg-warn',
|
|
51
|
+
'bg-warn-hover',
|
|
52
|
+
'bg-warn-active',
|
|
53
|
+
'bg-warn-disabled',
|
|
54
|
+
'bg-warn-subtle',
|
|
55
|
+
|
|
56
|
+
'bg-danger',
|
|
57
|
+
'bg-danger-hover',
|
|
58
|
+
'bg-danger-active',
|
|
59
|
+
'bg-danger-disabled',
|
|
60
|
+
'bg-danger-subtle',
|
|
61
|
+
|
|
62
|
+
'scroll-bg',
|
|
63
|
+
'scroll-thumb',
|
|
64
|
+
'scroll-thumb-hover'
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
@function validate-theme($theme, $theme-name) {
|
|
68
|
+
@each $key in $required-theme-keys {
|
|
69
|
+
@if not map.has-key($theme, $key) {
|
|
70
|
+
@error "Strict Theme Error: '#{$theme-name}' is missing the required key '#{$key}'.";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@each $key, $value in $theme {
|
|
75
|
+
@if not list.index($required-theme-keys, $key) {
|
|
76
|
+
@error "Strict Theme Error: '#{$theme-name}' contains an invalid key '#{$key}'. Remove or rename it.";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@return $theme;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@function make-light-theme($brand, $overrides: ()) {
|
|
84
|
+
$base: (
|
|
85
|
+
'bg-canvas': #ffffff,
|
|
86
|
+
'bg-surface': #ffffff,
|
|
87
|
+
'bg-surface-alt': get-color-from-palette($brand, 50),
|
|
88
|
+
'bg-element': get-color-from-palette('neutral', 100),
|
|
89
|
+
'bg-element-hover': get-color-from-palette($brand, 200),
|
|
90
|
+
'bg-element-active': get-color-from-palette($brand, 300),
|
|
91
|
+
|
|
92
|
+
'primary': get-color-from-palette($brand, 500),
|
|
93
|
+
'primary-hover': get-color-from-palette($brand, 600),
|
|
94
|
+
'primary-active': get-color-from-palette($brand, 700),
|
|
95
|
+
'primary-subtle': rgba(get-color-from-palette($brand, 300), 0.6),
|
|
96
|
+
'on-primary': get-color-from-palette('neutral', 100),
|
|
97
|
+
|
|
98
|
+
'text-heading': get-color-from-palette('neutral', 900),
|
|
99
|
+
'text-primary': get-color-from-palette('neutral', 700),
|
|
100
|
+
'text-secondary': get-color-from-palette('neutral', 500),
|
|
101
|
+
'text-brand': get-color-from-palette($brand, 700),
|
|
102
|
+
'text-inverse': get-color-from-palette('neutral', 100),
|
|
103
|
+
'text-info': get-color-from-palette('information', 700),
|
|
104
|
+
'text-warn': get-color-from-palette('warn', 700),
|
|
105
|
+
'text-success': get-color-from-palette('success', 700),
|
|
106
|
+
'text-danger': get-color-from-palette('danger', 700),
|
|
107
|
+
|
|
108
|
+
'border-subtle': get-color-from-palette('neutral', 200),
|
|
109
|
+
'border-default': get-color-from-palette('neutral', 300),
|
|
110
|
+
'border-strong': get-color-from-palette('neutral', 400),
|
|
111
|
+
'border-brand': get-color-from-palette($brand, 400),
|
|
112
|
+
'border-info': get-color-from-palette('information', 400),
|
|
113
|
+
'border-success': get-color-from-palette('success', 400),
|
|
114
|
+
'border-warn': get-color-from-palette('warn', 400),
|
|
115
|
+
'border-danger': get-color-from-palette('danger', 400),
|
|
116
|
+
|
|
117
|
+
'bg-info': get-color-from-palette('information', 100),
|
|
118
|
+
'bg-info-hover': get-color-from-palette('information', 200),
|
|
119
|
+
'bg-info-active': get-color-from-palette('information', 300),
|
|
120
|
+
'bg-info-disabled': get-color-from-palette('information', 50),
|
|
121
|
+
'bg-info-subtle': rgba(get-color-from-palette('information', 50), 0.95),
|
|
122
|
+
|
|
123
|
+
'bg-success': get-color-from-palette('success', 100),
|
|
124
|
+
'bg-success-hover': get-color-from-palette('success', 200),
|
|
125
|
+
'bg-success-active': get-color-from-palette('success', 300),
|
|
126
|
+
'bg-success-disabled': get-color-from-palette('success', 50),
|
|
127
|
+
'bg-success-subtle': rgba(get-color-from-palette('success', 50), 0.95),
|
|
128
|
+
|
|
129
|
+
'bg-warn': get-color-from-palette('warn', 100),
|
|
130
|
+
'bg-warn-hover': get-color-from-palette('warn', 200),
|
|
131
|
+
'bg-warn-active': get-color-from-palette('warn', 300),
|
|
132
|
+
'bg-warn-disabled': get-color-from-palette('warn', 50),
|
|
133
|
+
'bg-warn-subtle': rgba(get-color-from-palette('warn', 50), 0.95),
|
|
134
|
+
|
|
135
|
+
'bg-danger': get-color-from-palette('danger', 100),
|
|
136
|
+
'bg-danger-hover': get-color-from-palette('danger', 200),
|
|
137
|
+
'bg-danger-active': get-color-from-palette('danger', 300),
|
|
138
|
+
'bg-danger-disabled': get-color-from-palette('danger', 50),
|
|
139
|
+
'bg-danger-subtle': rgba(get-color-from-palette('danger', 50), 0.95),
|
|
140
|
+
|
|
141
|
+
'scroll-bg': get-color-from-palette($brand, 100),
|
|
142
|
+
'scroll-thumb': linear-gradient(278deg, get-color-from-palette($brand, 300) -10.44%, get-color-from-palette($brand, 400) 100%),
|
|
143
|
+
'scroll-thumb-hover': linear-gradient(278deg, get-color-from-palette($brand, 400) -10.44%, get-color-from-palette($brand, 700) 100%),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
$merged-theme: map.merge($base, $overrides);
|
|
147
|
+
|
|
148
|
+
@return validate-theme($merged-theme, '#{$brand}-light');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@function make-dark-theme($brand, $overrides: ()) {
|
|
152
|
+
$base: (
|
|
153
|
+
'bg-canvas': #000000,
|
|
154
|
+
'bg-surface': get-color-from-palette('neutral', 1000),
|
|
155
|
+
'bg-surface-alt': get-color-from-palette('neutral', 900),
|
|
156
|
+
'bg-element': get-color-from-palette('neutral', 800),
|
|
157
|
+
'bg-element-hover': get-color-from-palette($brand, 700),
|
|
158
|
+
'bg-element-active': get-color-from-palette($brand, 800),
|
|
159
|
+
|
|
160
|
+
'primary': get-color-from-palette($brand, 500),
|
|
161
|
+
'primary-hover': get-color-from-palette($brand, 400),
|
|
162
|
+
'primary-active': get-color-from-palette($brand, 300),
|
|
163
|
+
'primary-subtle': rgba(get-color-from-palette($brand, 700), 0.6),
|
|
164
|
+
'on-primary': #ffffff,
|
|
165
|
+
|
|
166
|
+
'text-heading': #ffffff,
|
|
167
|
+
'text-primary': get-color-from-palette('neutral', 200),
|
|
168
|
+
'text-secondary': get-color-from-palette('neutral', 400),
|
|
169
|
+
'text-brand': get-color-from-palette($brand, 300),
|
|
170
|
+
'text-inverse': get-color-from-palette('neutral', 900),
|
|
171
|
+
'text-info': get-color-from-palette('information', 400),
|
|
172
|
+
'text-success': get-color-from-palette('success', 400),
|
|
173
|
+
'text-warn': get-color-from-palette('warn', 400),
|
|
174
|
+
'text-danger': get-color-from-palette('danger', 400),
|
|
175
|
+
|
|
176
|
+
'border-subtle': get-color-from-palette('neutral', 900),
|
|
177
|
+
'border-default': get-color-from-palette('neutral', 800),
|
|
178
|
+
'border-strong': get-color-from-palette('neutral', 700),
|
|
179
|
+
'border-brand': get-color-from-palette($brand, 600),
|
|
180
|
+
'border-info': get-color-from-palette('information', 400),
|
|
181
|
+
'border-success': get-color-from-palette('success', 400),
|
|
182
|
+
'border-warn': get-color-from-palette('warn', 400),
|
|
183
|
+
'border-danger': get-color-from-palette('danger', 400),
|
|
184
|
+
|
|
185
|
+
'bg-info': get-color-from-palette('information', 900),
|
|
186
|
+
'bg-info-hover': get-color-from-palette('information', 800),
|
|
187
|
+
'bg-info-active': get-color-from-palette('information', 700),
|
|
188
|
+
'bg-info-disabled': get-color-from-palette('information', 1000),
|
|
189
|
+
'bg-info-subtle': rgba(get-color-from-palette('information', 1000), 0.95),
|
|
190
|
+
|
|
191
|
+
'bg-success': get-color-from-palette('success', 900),
|
|
192
|
+
'bg-success-hover': get-color-from-palette('success', 800),
|
|
193
|
+
'bg-success-active': get-color-from-palette('success', 700),
|
|
194
|
+
'bg-success-disabled': get-color-from-palette('success', 1000),
|
|
195
|
+
'bg-success-subtle': rgba(get-color-from-palette('success', 1000), 0.95),
|
|
196
|
+
|
|
197
|
+
'bg-warn': get-color-from-palette('warn', 900),
|
|
198
|
+
'bg-warn-hover': get-color-from-palette('warn', 800),
|
|
199
|
+
'bg-warn-active': get-color-from-palette('warn', 700),
|
|
200
|
+
'bg-warn-disabled': get-color-from-palette('warn', 1000),
|
|
201
|
+
'bg-warn-subtle': rgba(get-color-from-palette('warn', 1000), 0.95),
|
|
202
|
+
|
|
203
|
+
'bg-danger': get-color-from-palette('danger', 900),
|
|
204
|
+
'bg-danger-hover': get-color-from-palette('danger', 800),
|
|
205
|
+
'bg-danger-active': get-color-from-palette('danger', 700),
|
|
206
|
+
'bg-danger-disabled': get-color-from-palette('danger', 1000),
|
|
207
|
+
'bg-danger-subtle': rgba(get-color-from-palette('danger', 1000), 0.95),
|
|
208
|
+
|
|
209
|
+
'scroll-bg': get-color-from-palette($brand, 900),
|
|
210
|
+
'scroll-thumb': linear-gradient(278deg, get-color-from-palette($brand, 700) -10.44%, get-color-from-palette($brand, 500) 100%),
|
|
211
|
+
'scroll-thumb-hover': linear-gradient(278deg, get-color-from-palette($brand, 500) -10.44%, get-color-from-palette($brand, 400) 100%),
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
$merged-theme: map.merge($base, $overrides);
|
|
215
|
+
|
|
216
|
+
@return validate-theme($merged-theme, '#{$brand}-dark');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@mixin bx-theme($config) {
|
|
220
|
+
@each $key, $value in $config {
|
|
221
|
+
|
|
222
|
+
@if $key !='meta-brand-palette' {
|
|
223
|
+
--bx-#{$key}: #{$value};
|
|
224
|
+
|
|
225
|
+
.bx-bg-#{$key} {
|
|
226
|
+
background-color: var(--bx-#{$key});
|
|
227
|
+
transition: background-color 0.2s ease-in-out;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.bx-text-#{$key} {
|
|
231
|
+
color: var(--bx-#{$key});
|
|
232
|
+
transition: color 0.2s ease-in-out;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.bx-border-#{$key} {
|
|
236
|
+
border-color: var(--bx-#{$key});
|
|
237
|
+
transition: border-color 0.2s ease-in-out;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@if $key =='meta-brand-palette' {
|
|
242
|
+
$brand-palette: get-palette($value);
|
|
243
|
+
|
|
244
|
+
@each $shade, $color in $brand-palette {
|
|
245
|
+
--bx-color-primary-#{$shade}: #{$color};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use 'variables' as *;
|
|
4
|
+
@use 'palettes' as *;
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@each $key, $val in $spacing {
|
|
8
|
+
.bx-p-#{$key} {
|
|
9
|
+
padding: #{$val};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.bx-pt-#{$key} {
|
|
13
|
+
padding-top: #{$val};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.bx-pr-#{$key} {
|
|
17
|
+
padding-right: #{$val};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bx-pb-#{$key} {
|
|
21
|
+
padding-bottom: #{$val};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.bx-pl-#{$key} {
|
|
25
|
+
padding-left: #{$val};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bx-px-#{$key} {
|
|
29
|
+
padding-left: #{$val};
|
|
30
|
+
padding-right: #{$val};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.bx-py-#{$key} {
|
|
34
|
+
padding-top: #{$val};
|
|
35
|
+
padding-bottom: #{$val};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.bx-m-#{$key} {
|
|
39
|
+
margin: #{$val};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.bx-mt-#{$key} {
|
|
43
|
+
margin-top: #{$val};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.bx-mr-#{$key} {
|
|
47
|
+
margin-right: #{$val};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.bx-mb-#{$key} {
|
|
51
|
+
margin-bottom: #{$val};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bx-ml-#{$key} {
|
|
55
|
+
margin-left: #{$val};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bx-mx-#{$key} {
|
|
59
|
+
margin-left: #{$val};
|
|
60
|
+
margin-right: #{$val};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.bx-my-#{$key} {
|
|
64
|
+
margin-top: #{$val};
|
|
65
|
+
margin-bottom: #{$val};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@each $key, $val in $radiuses {
|
|
70
|
+
.bx-rounded-#{$key} {
|
|
71
|
+
border-radius: #{$val};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.bx-rounded-t-#{$key} {
|
|
75
|
+
border-top-left-radius: #{$val};
|
|
76
|
+
border-top-right-radius: #{$val};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.bx-rounded-b-#{$key} {
|
|
80
|
+
border-bottom-left-radius: #{$val};
|
|
81
|
+
border-bottom-right-radius: #{$val};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.bx-rounded-l-#{$key} {
|
|
85
|
+
border-top-left-radius: #{$val};
|
|
86
|
+
border-bottom-left-radius: #{$val};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.bx-rounded-r-#{$key} {
|
|
90
|
+
border-top-right-radius: #{$val};
|
|
91
|
+
border-bottom-right-radius: #{$val};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@each $key, $val in $shadows {
|
|
96
|
+
.bx-shadow-#{$key} {
|
|
97
|
+
box-shadow: #{$val};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@each $key, $val in $z-index {
|
|
102
|
+
.bx-z-#{$key} {
|
|
103
|
+
z-index: #{$val};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@each $palette-name, $shades in $all-palettes {
|
|
108
|
+
@if meta.type-of($shades)=='map' {
|
|
109
|
+
@each $shade, $color in $shades {
|
|
110
|
+
.bx-bg-#{$palette-name}-#{$shade} {
|
|
111
|
+
background-color: var(--bx-color-#{$palette-name}-#{$shade});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.bx-text-#{$palette-name}-#{$shade} {
|
|
115
|
+
color: var(--bx-color-#{$palette-name}-#{$shade});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.bx-border-#{$palette-name}-#{$shade} {
|
|
119
|
+
border-color: var(--bx-color-#{$palette-name}-#{$shade});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:root {
|
|
126
|
+
@each $key, $val in $spacing {
|
|
127
|
+
--bx-space-#{$key}: #{$val};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@each $key, $val in $radiuses {
|
|
131
|
+
--bx-rounded-#{$key}: #{$val};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@each $key, $val in $shadows {
|
|
135
|
+
--bx-shadow-#{$key}: #{$val};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@each $key, $val in $z-index {
|
|
139
|
+
--bx-z-#{$key}: #{$val};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@each $palette-name, $shades in $all-palettes {
|
|
143
|
+
@if meta.type-of($shades)=='map' {
|
|
144
|
+
@each $shade, $color in $shades {
|
|
145
|
+
--bx-color-#{$palette-name}-#{$shade}: #{$color};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.bx-icon-pos-start {
|
|
151
|
+
margin-right: 0.5rem;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.bx-icon-pos-end {
|
|
155
|
+
margin-left: 0.5rem;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@use 'palettes' as *;
|
|
2
|
+
|
|
3
|
+
$spacing: (
|
|
4
|
+
0: 0,
|
|
5
|
+
1: 0.25rem,
|
|
6
|
+
2: 0.5rem,
|
|
7
|
+
3: 0.75rem,
|
|
8
|
+
4: 1rem,
|
|
9
|
+
5: 1.25rem,
|
|
10
|
+
6: 1.5rem,
|
|
11
|
+
8: 2rem,
|
|
12
|
+
10: 2.5rem,
|
|
13
|
+
12: 3rem,
|
|
14
|
+
) !default;
|
|
15
|
+
|
|
16
|
+
$radiuses: (
|
|
17
|
+
none: 0,
|
|
18
|
+
sm: 0.25rem,
|
|
19
|
+
md: 0.5rem,
|
|
20
|
+
lg: 0.75rem,
|
|
21
|
+
xl: 1rem,
|
|
22
|
+
2xl: 1.5rem,
|
|
23
|
+
3xl: 1.875rem,
|
|
24
|
+
pill: 9999px,
|
|
25
|
+
) !default;
|
|
26
|
+
|
|
27
|
+
$shadows: (
|
|
28
|
+
sm: (0 2px 4px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)),
|
|
29
|
+
md: (0 4px 8px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -2px rgba(0, 0, 0, 0.12)),
|
|
30
|
+
lg: (0 12px 20px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1)),
|
|
31
|
+
xl: (0 24px 32px -5px rgba(0, 0, 0, 0.25), 0 10px 12px -5px rgba(0, 0, 0, 0.15)),
|
|
32
|
+
modal: 0 8px 20px rgba(0, 0, 0, 0.12),
|
|
33
|
+
toast: 0 4px 12px rgba(0, 0, 0, 0.15)) !default;
|
|
34
|
+
|
|
35
|
+
$z-index: (
|
|
36
|
+
base: 1,
|
|
37
|
+
dropdown: 100,
|
|
38
|
+
sticky: 200,
|
|
39
|
+
fixed: 300,
|
|
40
|
+
modal: 400,
|
|
41
|
+
popover: 500,
|
|
42
|
+
tooltip: 600,
|
|
43
|
+
toast: 9999,
|
|
44
|
+
) !default;
|
|
45
|
+
|
|
46
|
+
$breakpoints: (
|
|
47
|
+
xs: 360px,
|
|
48
|
+
|
|
49
|
+
sm: 640px,
|
|
50
|
+
md: 768px,
|
|
51
|
+
|
|
52
|
+
lg: 1024px,
|
|
53
|
+
xl: 1280px,
|
|
54
|
+
|
|
55
|
+
2xl: 1536px,
|
|
56
|
+
3xl: 1920px,
|
|
57
|
+
4xl: 2560px) !default;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
@use '../palettes' as *;
|
|
2
|
+
@use '../theme-engine' as *;
|
|
3
|
+
|
|
4
|
+
$high-contrast-light-theme: validate-theme(('bg-canvas': $hc-white,
|
|
5
|
+
'bg-surface': $hc-white,
|
|
6
|
+
'bg-surface-alt': $hc-white,
|
|
7
|
+
'bg-element': $hc-white,
|
|
8
|
+
'bg-element-hover': $hc-yellow,
|
|
9
|
+
'bg-element-active': $hc-yellow,
|
|
10
|
+
|
|
11
|
+
'primary': $hc-black,
|
|
12
|
+
'primary-hover': $hc-black,
|
|
13
|
+
'primary-active': $hc-black,
|
|
14
|
+
'primary-subtle': $hc-white,
|
|
15
|
+
'on-primary': $hc-white,
|
|
16
|
+
|
|
17
|
+
'text-heading': $hc-black,
|
|
18
|
+
'text-primary': $hc-black,
|
|
19
|
+
'text-secondary': $hc-black,
|
|
20
|
+
'text-brand': $hc-black,
|
|
21
|
+
'text-inverse': $hc-white,
|
|
22
|
+
'text-info': $hc-cyan,
|
|
23
|
+
'text-success': $hc-green,
|
|
24
|
+
'text-warn': $hc-yellow,
|
|
25
|
+
'text-danger': $hc-red,
|
|
26
|
+
|
|
27
|
+
'border-subtle': $hc-black,
|
|
28
|
+
'border-default': $hc-black,
|
|
29
|
+
'border-strong': $hc-black,
|
|
30
|
+
'border-brand': $hc-black,
|
|
31
|
+
'border-info': $hc-black,
|
|
32
|
+
'border-success': $hc-black,
|
|
33
|
+
'border-warn': $hc-black,
|
|
34
|
+
'border-danger': $hc-black,
|
|
35
|
+
|
|
36
|
+
'bg-info': $hc-white,
|
|
37
|
+
'bg-info-hover': $hc-white,
|
|
38
|
+
'bg-info-active': $hc-white,
|
|
39
|
+
'bg-info-disabled': $hc-white,
|
|
40
|
+
'bg-info-subtle': $hc-white,
|
|
41
|
+
|
|
42
|
+
'bg-success': $hc-white,
|
|
43
|
+
'bg-success-hover': $hc-white,
|
|
44
|
+
'bg-success-active': $hc-white,
|
|
45
|
+
'bg-success-disabled': $hc-white,
|
|
46
|
+
'bg-success-subtle': $hc-white,
|
|
47
|
+
|
|
48
|
+
'bg-warn': $hc-white,
|
|
49
|
+
'bg-warn-hover': $hc-white,
|
|
50
|
+
'bg-warn-active': $hc-white,
|
|
51
|
+
'bg-warn-disabled': $hc-white,
|
|
52
|
+
'bg-warn-subtle': $hc-white,
|
|
53
|
+
|
|
54
|
+
'bg-danger': $hc-white,
|
|
55
|
+
'bg-danger-hover': $hc-white,
|
|
56
|
+
'bg-danger-active': $hc-white,
|
|
57
|
+
'bg-danger-disabled': $hc-white,
|
|
58
|
+
'bg-danger-subtle': $hc-white,
|
|
59
|
+
|
|
60
|
+
'scroll-bg': $hc-white,
|
|
61
|
+
'scroll-thumb': $hc-black,
|
|
62
|
+
'scroll-thumb-hover': $hc-yellow), 'high-contrast-light') !default;
|
|
63
|
+
|
|
64
|
+
$high-contrast-dark-theme: validate-theme(('bg-canvas': $hc-black,
|
|
65
|
+
'bg-surface': $hc-black,
|
|
66
|
+
'bg-surface-alt': $hc-black,
|
|
67
|
+
'bg-element': $hc-black,
|
|
68
|
+
'bg-element-hover': $hc-yellow,
|
|
69
|
+
'bg-element-active': $hc-yellow,
|
|
70
|
+
|
|
71
|
+
'primary': $hc-white,
|
|
72
|
+
'primary-hover': $hc-white,
|
|
73
|
+
'primary-active': $hc-white,
|
|
74
|
+
'primary-subtle': $hc-black,
|
|
75
|
+
'on-primary': $hc-black,
|
|
76
|
+
|
|
77
|
+
'text-heading': $hc-white,
|
|
78
|
+
'text-primary': $hc-white,
|
|
79
|
+
'text-secondary': $hc-white,
|
|
80
|
+
'text-brand': $hc-white,
|
|
81
|
+
'text-inverse': $hc-black,
|
|
82
|
+
'text-info': $hc-cyan,
|
|
83
|
+
'text-success': $hc-green,
|
|
84
|
+
'text-warn': $hc-yellow,
|
|
85
|
+
'text-danger': $hc-red,
|
|
86
|
+
|
|
87
|
+
'border-subtle': $hc-white,
|
|
88
|
+
'border-default': $hc-white,
|
|
89
|
+
'border-strong': $hc-white,
|
|
90
|
+
'border-brand': $hc-white,
|
|
91
|
+
'border-info': $hc-white,
|
|
92
|
+
'border-success': $hc-white,
|
|
93
|
+
'border-warn': $hc-white,
|
|
94
|
+
'border-danger': $hc-white,
|
|
95
|
+
|
|
96
|
+
'bg-info': $hc-black,
|
|
97
|
+
'bg-info-hover': $hc-black,
|
|
98
|
+
'bg-info-active': $hc-black,
|
|
99
|
+
'bg-info-disabled': $hc-black,
|
|
100
|
+
'bg-info-subtle': $hc-black,
|
|
101
|
+
|
|
102
|
+
'bg-success': $hc-black,
|
|
103
|
+
'bg-success-hover': $hc-black,
|
|
104
|
+
'bg-success-active': $hc-black,
|
|
105
|
+
'bg-success-disabled': $hc-black,
|
|
106
|
+
'bg-success-subtle': $hc-black,
|
|
107
|
+
|
|
108
|
+
'bg-warn': $hc-black,
|
|
109
|
+
'bg-warn-hover': $hc-black,
|
|
110
|
+
'bg-warn-active': $hc-black,
|
|
111
|
+
'bg-warn-disabled': $hc-black,
|
|
112
|
+
'bg-warn-subtle': $hc-black,
|
|
113
|
+
|
|
114
|
+
'bg-danger': $hc-black,
|
|
115
|
+
'bg-danger-hover': $hc-black,
|
|
116
|
+
'bg-danger-active': $hc-black,
|
|
117
|
+
'bg-danger-disabled': $hc-black,
|
|
118
|
+
'bg-danger-subtle': $hc-black,
|
|
119
|
+
|
|
120
|
+
'scroll-bg': $hc-black,
|
|
121
|
+
'scroll-thumb': $hc-white,
|
|
122
|
+
'scroll-thumb-hover': $hc-yellow), 'high-contrast-dark') !default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filip.mazev-blocks.mjs","sources":["../../../projects/blocks/src/public-api.ts","../../../projects/blocks/src/filip.mazev-blocks.ts"],"sourcesContent":["/*\n * Public API Surface of blocks\n *\n */\n\nexport const BLOCKS_VERSION = '1.0
|
|
1
|
+
{"version":3,"file":"filip.mazev-blocks.mjs","sources":["../../../projects/blocks/src/public-api.ts","../../../projects/blocks/src/filip.mazev-blocks.ts"],"sourcesContent":["/*\n * Public API Surface of blocks\n *\n */\n\nexport const BLOCKS_VERSION = '1.2.0';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;AAGG;AAEI,MAAM,cAAc,GAAG;;ACL9B;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filip.mazev/blocks",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"schematics": "./schematics/collection.json",
|
|
6
6
|
"exports": {
|
|
7
|
-
"./core/styles
|
|
8
|
-
"./core/styles/mixins": "./core/styles/_mixins.scss",
|
|
9
|
-
"./core/styles/palettes": "./core/styles/_palettes.scss",
|
|
10
|
-
"./core/styles/theme-engine": "./core/styles/_theme-engine.scss",
|
|
11
|
-
"./core/styles/utilities": "./core/styles/_utilities.scss",
|
|
12
|
-
"./core/styles/variables": "./core/styles/_variables.scss",
|
|
13
|
-
"./core/styles/themes/*": "./core/styles/themes/*.scss",
|
|
7
|
+
"./core/styles/*": "./core/styles/*",
|
|
14
8
|
"./package.json": {
|
|
15
9
|
"default": "./package.json"
|
|
16
10
|
},
|