@matteusan/himig 1.7.3 → 1.8.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.
Binary file
package/_index.scss CHANGED
@@ -58,56 +58,60 @@ $vue-mode: $test-mode !default;
58
58
  $breakpoints: pintig.prioritize(map.get($theme, 'breakpoints'), $breakpoints);
59
59
  $extend: pintig.prioritize(map.get($theme, 'extend'), $extend);
60
60
 
61
- $_init-family: 'family.sans-serif';
62
- $_init-line-height: 'line-height.normal';
63
-
64
61
  $_init-type-global: (
65
- 'family': $_init-family,
62
+ 'family': 'family.sans-serif',
66
63
  'size': 'size.sm',
67
64
  'weight': 'weight.normal',
68
- 'line-height': $_init-line-height,
65
+ 'line-height': 'line-height.normal',
66
+ 'squeeze': 'squeeze.normal',
69
67
  );
70
68
 
71
69
  $_init-type-supertitle: (
72
- 'family': $_init-family,
73
- 'size': 'size.xl',
74
- 'weight': 'weight.black',
75
- 'line-height': $_init-line-height,
70
+ 'family': 'family.serif',
71
+ 'size': 'size.3xl',
72
+ 'weight': 'weight.normal',
73
+ 'line-height': 'line-height.short',
74
+ 'squeeze': 'squeeze.tight',
76
75
  );
77
76
 
78
77
  $_init-type-title: (
79
- 'family': $_init-family,
80
- 'size': 'size.lg',
81
- 'weight': 'weight.bold',
82
- 'line-height': $_init-line-height,
78
+ 'family': 'family.serif',
79
+ 'size': 'size.xl',
80
+ 'weight': 'weight.normal',
81
+ 'line-height': 'line-height.short',
82
+ 'squeeze': 'squeeze.tight',
83
83
  );
84
84
 
85
85
  $_init-type-subtitle: (
86
- 'family': $_init-family,
86
+ 'family': 'family.sans-serif',
87
87
  'size': 'size.md',
88
- 'weight': 'weight.bold',
89
- 'line-height': $_init-line-height,
88
+ 'weight': 'weight.light',
89
+ 'line-height': 'line-height.normal',
90
+ 'squeeze': 'squeeze.normal',
90
91
  );
91
92
 
92
93
  $_init-type-body: (
93
- 'family': $_init-family,
94
+ 'family': 'family.sans-serif',
94
95
  'size': 'size.sm',
95
96
  'weight': 'weight.normal',
96
- 'line-height': $_init-line-height,
97
+ 'line-height': 'line-height.normal',
98
+ 'squeeze': 'squeeze.normal',
97
99
  );
98
100
 
99
101
  $_init-type-mono: (
100
102
  'family': 'family.mono',
101
103
  'size': 'size.sm',
102
104
  'weight': 'weight.normal',
103
- 'line-height': $_init-line-height,
105
+ 'line-height': 'line-height.normal',
106
+ 'squeeze': 'squeeze.normal',
104
107
  );
105
108
 
106
109
  $_init-type-small: (
107
- 'family': $_init-family,
110
+ 'family': 'family.sans-serif',
108
111
  'size': 'size.xs',
109
112
  'weight': 'weight.light',
110
- 'line-height': $_init-line-height,
113
+ 'line-height': 'line-height.tall',
114
+ 'squeeze': 'squeeze.normal',
111
115
  );
112
116
 
113
117
  $_init-breakpoints: (
@@ -117,37 +121,6 @@ $vue-mode: $test-mode !default;
117
121
  'xlarge': pintig.primitive-token-get('breakpoint.xl'),
118
122
  );
119
123
 
120
- :root {
121
- @include pintig.theme-config(
122
- $primary: $primary,
123
- $accent: $accent,
124
- $surface: $surface,
125
- $background: $background,
126
- $error: $error,
127
- $disabled: $disabled,
128
- $radius: $radius,
129
- $breakpoints: $breakpoints,
130
- $global: map.merge($_init-type-global, $global),
131
- $supertitle: map.merge($_init-type-supertitle, $supertitle),
132
- $title: map.merge($_init-type-title, $title),
133
- $subtitle: map.merge($_init-type-subtitle, $subtitle),
134
- $body: map.merge($_init-type-body, $body),
135
- $mono: map.merge($_init-type-mono, $mono),
136
- $small: map.merge($_init-type-small, $small),
137
- $extend: $extend,
138
- );
139
-
140
- // Immutables
141
- --ms-shadow-color: rgba(0, 0, 0, 0.25);
142
- --ms-sprite-size: 32px;
143
- --ms-transition-time: 0.2s;
144
-
145
- font-family: pintig.token-get('family-global');
146
- line-height: pintig.token-get('line-height-global');
147
- }
148
-
149
- @include pintig.breakpoint-config(map.merge($_init-breakpoints, $breakpoints));
150
-
151
124
  @include font-pack.load((
152
125
  'global': map.get(map.merge($_init-type-global, $global), 'family'),
153
126
  'supertitle': map.get(map.merge($_init-type-supertitle, $supertitle), 'family'),
@@ -158,67 +131,114 @@ $vue-mode: $test-mode !default;
158
131
  'small': map.get(map.merge($_init-type-small, $small), 'family'),
159
132
  ));
160
133
 
161
- *,
162
- :before,
163
- :after {
164
- margin: 0;
165
- padding: 0;
166
- box-sizing: inherit;
167
- color: inherit;
168
- }
134
+ @layer init, components, utils;
135
+
136
+ @layer init {
137
+ :root {
138
+ @include pintig.theme-config(
139
+ $primary: $primary,
140
+ $accent: $accent,
141
+ $surface: $surface,
142
+ $background: $background,
143
+ $error: $error,
144
+ $disabled: $disabled,
145
+ $radius: $radius,
146
+ $breakpoints: $breakpoints,
147
+ $global: map.merge($_init-type-global, $global),
148
+ $supertitle: map.merge($_init-type-supertitle, $supertitle),
149
+ $title: map.merge($_init-type-title, $title),
150
+ $subtitle: map.merge($_init-type-subtitle, $subtitle),
151
+ $body: map.merge($_init-type-body, $body),
152
+ $mono: map.merge($_init-type-mono, $mono),
153
+ $small: map.merge($_init-type-small, $small),
154
+ $extend: $extend,
155
+ );
156
+
157
+ @include pintig.token-config((
158
+ 'shadow-color': rgba(0, 0, 0, 0.25),
159
+ 'easing': (
160
+ 'default': ease-in-out,
161
+ 'smooth': cubic-bezier(0.83, 0, 0.17, 1)
162
+ ),
163
+ 'time': (
164
+ 'short': 0.2s,
165
+ 'default': 0.4s,
166
+ 'long': 0.6s
167
+ )
168
+ ));
169
+
170
+ // Immutables
171
+ --ms-shadow-color: rgba(0, 0, 0, 0.25);
172
+ --ms-transition-time: 0.2s;
173
+
174
+ font-family: pintig.token-get('family-global');
175
+ line-height: pintig.token-get('line-height-global');
176
+ }
169
177
 
170
- html {
171
- box-sizing: border-box;
172
- font-size: 100%;
173
- }
178
+ @include pintig.breakpoint-config(map.merge($_init-breakpoints, $breakpoints));
174
179
 
175
- body {
176
- background: pintig.key-create('body-fill', pintig.token-get('background'));
177
- color: pintig.key-create('body-ink', pintig.token-get('background-ink'));
178
- }
180
+ *,
181
+ :before,
182
+ :after {
183
+ margin: 0;
184
+ padding: 0;
185
+ box-sizing: inherit;
186
+ color: inherit;
187
+ }
179
188
 
180
- a {
181
- text-decoration: none;
182
- color: inherit;
183
- }
189
+ html {
190
+ box-sizing: border-box;
191
+ font-size: 100%;
192
+ }
184
193
 
185
- h1,
186
- h2,
187
- h3,
188
- h4,
189
- h5,
190
- h6,
191
- p,
192
- span,
193
- a {
194
- font-family: inherit;
195
- font-size: inherit;
196
- font-weight: inherit;
197
- line-height: inherit;
198
- }
194
+ body {
195
+ background: pintig.key-create('body-fill', pintig.token-get('background'));
196
+ color: pintig.key-create('body-ink', pintig.token-get('background-ink'));
197
+ }
198
+
199
+ a {
200
+ text-decoration: none;
201
+ color: inherit;
202
+ }
199
203
 
200
- main.content-wrap {
201
- $margin: 15px;
202
- width: calc(100% - #{$margin * 2});
203
- max-width: pintig.key-create('content-wrap-max-width', pintig.primitive-token-get('dimension.xl'));
204
- height: 100%;
205
- display: pintig.key-create('content-wrap-display', flex);
206
- flex-flow: column nowrap;
207
- gap: pintig.key-create('content-wrap-gap', pintig.primitive-token-get('spacing.md'));
208
- margin: 0 auto;
209
- padding:
210
- pintig.key-create('content-wrap-padding-y', pintig.primitive-token-get('spacing.lg'))
211
- pintig.key-create('content-wrap-padding-x', pintig.primitive-token-get('spacing.none'));
212
-
213
- // If grid
214
- grid-template-columns: repeat(pintig.key-create('content-wrap-cols', 4), 1fr);
215
-
216
- @include pintig.breakpoint-create('medium') {
217
- @include pintig.key-bind('content-wrap-cols', repeat(8, 1fr));
204
+ h1,
205
+ h2,
206
+ h3,
207
+ h4,
208
+ h5,
209
+ h6,
210
+ p,
211
+ span,
212
+ a {
213
+ font-family: inherit;
214
+ font-size: inherit;
215
+ font-weight: inherit;
216
+ line-height: inherit;
218
217
  }
219
218
 
220
- @include pintig.breakpoint-create('large') {
221
- @include pintig.key-bind('content-wrap-cols', repeat(12, 1fr));
219
+ main.content-wrap {
220
+ $margin: 15px;
221
+ width: calc(100% - #{$margin * 2});
222
+ max-width: pintig.key-create('content-wrap-max-width', pintig.primitive-token-get('dimension.xl'));
223
+ height: 100%;
224
+ display: pintig.key-create('content-wrap-display', flex);
225
+ flex-flow: column nowrap;
226
+ gap: pintig.key-create('content-wrap-gap', pintig.primitive-token-get('spacing.md'));
227
+ margin: 0 auto;
228
+ padding:
229
+ pintig.key-create('content-wrap-padding-y', pintig.primitive-token-get('spacing.lg'))
230
+ pintig.key-create('content-wrap-padding-x', pintig.primitive-token-get('spacing.none'));
231
+
232
+ // If grid
233
+ grid-template-columns: repeat(pintig.key-create('content-wrap-cols', 4), 1fr);
234
+
235
+ @include pintig.breakpoint-create('medium') {
236
+ @include pintig.key-bind('content-wrap-cols', repeat(8, 1fr));
237
+ }
238
+
239
+ @include pintig.breakpoint-create('large') {
240
+ @include pintig.key-bind('content-wrap-cols', repeat(12, 1fr));
241
+ }
222
242
  }
223
243
  }
224
244
 
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  @if list.index($family-list, 'family.sans-serif') {
15
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
15
+ @import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
16
16
  }
17
17
 
18
18
  @if list.index($family-list, 'family.serif') {
@@ -17,17 +17,19 @@
17
17
  $typography: pintig.theme-merge(theme.$init-typography, $typography);
18
18
  $settings: pintig.theme-merge(theme.$init-settings, $settings);
19
19
 
20
- @include base.init() {
21
- @include pintig.color-apply('badge', $color);
22
- @include pintig.struct-apply('badge', $struct);
23
- @include pintig.typography-bind('badge', $typography);
20
+ @layer components {
21
+ @include base.init() {
22
+ @include pintig.color-apply('badge', $color);
23
+ @include pintig.struct-apply('badge', $struct);
24
+ @include pintig.typography-bind('badge', $typography);
24
25
 
25
- &:where(.is-outlined) {
26
- @include pintig.color-bind('badge', (
27
- fill: transparent,
28
- ink: pintig.theme-get($color, 'fill'),
29
- border: pintig.theme-get($color, 'border')
30
- ));
26
+ &:where(.is-outlined) {
27
+ @include pintig.color-bind('badge', (
28
+ fill: transparent,
29
+ ink: pintig.theme-get($color, 'fill'),
30
+ border: pintig.theme-get($color, 'border')
31
+ ));
32
+ }
31
33
  }
32
34
  }
33
35
  }
@@ -20,7 +20,7 @@
20
20
  outline: pintig.key-create('button-outline', none);
21
21
 
22
22
  -webkit-appearance: caret;
23
- @include pintig.prefix(transition, all var(--ms-transition-time) ease);
23
+ @include pintig.prefix(transition, all pintig.token-get('time-short') pintig.token-get('easing'));
24
24
 
25
25
  @content;
26
26
 
@@ -17,30 +17,30 @@
17
17
  ink: $fill,
18
18
  border: transparent
19
19
  ));
20
- @include pintig.key-bind('button-outline', 2px solid rgba(_raw($fill), pintig.$color-fill-default-opacity));
20
+ @include pintig.key-bind('button-outline', 2px solid rgb(from _raw($fill) r g b / pintig.$color-fill-default-opacity));
21
21
 
22
22
  &:hover {
23
23
  @include pintig.color-bind('button', (
24
- fill: _smart-alpha-color($fill, pintig.$color-fill-hover-opacity),
24
+ fill: _alpha($fill, pintig.$color-fill-hover-opacity),
25
25
  ink: $fill,
26
- border: _smart-alpha-color($border, pintig.$color-border-hover-opacity, $type: 'border')
26
+ border: _alpha($border, pintig.$color-border-hover-opacity, $type: 'border')
27
27
  ));
28
28
  }
29
29
 
30
30
  &:focus {
31
31
  @include pintig.color-bind('button', (
32
- fill: _smart-alpha-color($fill, pintig.$color-fill-focus-opacity),
32
+ fill: _alpha($fill, pintig.$color-fill-focus-opacity),
33
33
  ink: $fill,
34
- border: _smart-alpha-color($border, pintig.$color-border-focus-opacity, $type: 'border')
34
+ border: _alpha($border, pintig.$color-border-focus-opacity, $type: 'border')
35
35
  ));
36
- @include pintig.key-bind('button-outline', 2px solid rgba(_raw($fill), pintig.$color-outline-focus-opacity));
36
+ @include pintig.key-bind('button-outline', 2px solid rgb(from _raw($fill) r g b / pintig.$color-outline-focus-opacity));
37
37
  }
38
38
 
39
39
  &:active {
40
40
  @include pintig.color-bind('button', (
41
- fill: _smart-alpha-color($fill, pintig.$color-fill-active-opacity),
41
+ fill: _alpha($fill, pintig.$color-fill-active-opacity),
42
42
  ink: $fill,
43
- border: _smart-alpha-color($border, pintig.$color-border-active-opacity, $type: 'border')
43
+ border: _alpha($border, pintig.$color-border-active-opacity, $type: 'border')
44
44
  ));
45
45
  }
46
46
  }
@@ -74,15 +74,15 @@
74
74
  ink: $fill,
75
75
  border: $border
76
76
  ));
77
- @include pintig.key-bind('button-outline', 2px solid rgba(_raw($fill), pintig.$color-fill-default-opacity));
77
+ @include pintig.key-bind('button-outline', 2px solid rgb(from _raw($fill) r g b / pintig.$color-fill-default-opacity));
78
78
 
79
79
  &:focus {
80
80
  @include pintig.color-bind('button', (
81
- fill: _smart-alpha-color($fill, pintig.$color-fill-focus-opacity),
81
+ fill: _alpha($fill, pintig.$color-fill-focus-opacity),
82
82
  ink: $fill,
83
83
  border: $border
84
84
  ));
85
- @include pintig.key-bind('button-outline', 2px solid rgba(_raw($fill), pintig.$color-outline-focus-opacity));
85
+ @include pintig.key-bind('button-outline', 2px solid rgb(from _raw($fill) r g b / pintig.$color-outline-focus-opacity));
86
86
  }
87
87
 
88
88
  &:hover {
@@ -131,7 +131,7 @@
131
131
  ink: $ink,
132
132
  border: $border
133
133
  ));
134
- @include pintig.key-bind('button-outline', 2px solid rgba(_raw($fill), pintig.$color-fill-default-opacity));
134
+ @include pintig.key-bind('button-outline', 2px solid rgb(from _raw($fill) r g b / pintig.$color-fill-default-opacity));
135
135
 
136
136
  &:hover {
137
137
  @include pintig.color-bind('button', (
@@ -147,7 +147,7 @@
147
147
  ink: $ink,
148
148
  border: $border-focus
149
149
  ));
150
- @include pintig.key-bind('button-outline', 2px solid rgba(_raw($fill), pintig.$color-outline-focus-opacity));
150
+ @include pintig.key-bind('button-outline', 2px solid rgb(from _raw($fill) r g b / pintig.$color-outline-focus-opacity));
151
151
  }
152
152
 
153
153
  &:active {
@@ -168,17 +168,10 @@
168
168
  }
169
169
  }
170
170
 
171
- @function _smart-alpha-color($query, $opacity, $type: 'fill', $state: 'hover') {
172
- $_tones: ('hover': 400, 'active': 600);
173
- $_color: string.slice($query, 1, (string.length($query) - 4));
174
- // $_tone: string.slice($query, (string.length($_color) + 2), (string.length($query)));
175
- @if $type == 'border' { @return rgba(#fff, 0%); }
176
- @if pintig.token-check('#{$_color}-alpha-#{map.get($_tones, $state)}') {
177
- @return pintig.token-get('#{$_color}-alpha-#{map.get($_tones, $state)}');
178
- }
179
- @return _raw($query, $opacity);
171
+ @function _alpha($query, $opacity, $type: 'fill', $state: 'hover') {
172
+ @return rgb(from _raw($query) r g b / $opacity);
180
173
  }
181
174
 
182
175
  @function _raw($query) {
183
- @return pintig.token-switch-raw($query);
176
+ @return pintig.token-switch($query);
184
177
  }