@matteusan/himig 1.2.3 → 1.3.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.
Files changed (45) hide show
  1. package/.yarn/cache/@matteusan-sentro-npm-0.1.25-9dadcacaf9-2964e33fdc.zip +0 -0
  2. package/.yarn/install-state.gz +0 -0
  3. package/_index.scss +21 -13
  4. package/ms-badge/_badge-extend.scss +3 -3
  5. package/ms-badge/_badge-styles.scss +8 -0
  6. package/ms-button/_button-extend.scss +3 -3
  7. package/ms-button/_button-mixins.scss +28 -17
  8. package/ms-button/_button-styles.scss +13 -9
  9. package/ms-button/_button-theme.scss +5 -5
  10. package/ms-card/_card-base.scss +243 -0
  11. package/{ms-surface/_surface-extend.scss → ms-card/_card-extend.scss} +6 -6
  12. package/{ms-item-card/_item-card-styles.scss → ms-card/_card-styles.scss} +28 -25
  13. package/{ms-item-card/_item-card-theme.scss → ms-card/_card-theme.scss} +27 -25
  14. package/{ms-sprite → ms-card}/_index.scss +1 -1
  15. package/ms-core/README.md +2 -0
  16. package/ms-core/_index.scss +2 -1
  17. package/{ms-sprite/_sprite-styles.scss → ms-core/component/_component-extend.scss} +28 -29
  18. package/{ms-surface → ms-core/component}/_index.scss +1 -2
  19. package/ms-core/package.json +15 -0
  20. package/ms-core/struct/_struct-utils.scss +3 -7
  21. package/ms-core/theme/_theme-merge.scss +1 -1
  22. package/ms-core/theme/_theme-properties.scss +9 -0
  23. package/ms-core/theme/_theme-setters.scss +5 -2
  24. package/ms-form-field/_form-field-base.scss +25 -22
  25. package/ms-form-field/_form-field-extend.scss +3 -3
  26. package/ms-form-field/_form-field-styles.scss +83 -72
  27. package/ms-form-field/_form-field-theme.scss +10 -8
  28. package/ms-list/_list-base.scss +1 -0
  29. package/ms-list/_list-extend.scss +3 -3
  30. package/ms-list/_list-theme.scss +2 -2
  31. package/ms-select-field/_index.scss +24 -0
  32. package/ms-select-field/_select-field-base.scss +108 -0
  33. package/ms-select-field/_select-field-extend.scss +53 -0
  34. package/ms-select-field/_select-field-styles.scss +203 -0
  35. package/{ms-surface/_surface-theme.scss → ms-select-field/_select-field-theme.scss} +29 -19
  36. package/{ms-item-card → ms-tick-field}/_index.scss +2 -2
  37. package/ms-tick-field/_tick-field-base.scss +78 -0
  38. package/{ms-item-card/_item-card-extend.scss → ms-tick-field/_tick-field-extend.scss} +6 -6
  39. package/ms-tick-field/_tick-field-styles.scss +121 -0
  40. package/ms-tick-field/_tick-field-theme.scss +77 -0
  41. package/ms-utils/_color-utils.scss +0 -1
  42. package/package.json +1 -1
  43. package/ms-item-card/_item-card-base.scss +0 -96
  44. package/ms-surface/_surface-base.scss +0 -111
  45. package/ms-surface/_surface-styles.scss +0 -88
Binary file
package/_index.scss CHANGED
@@ -44,7 +44,10 @@ $vue-mode: $test-mode !default;
44
44
  $surface: 'ms-dark-grey',
45
45
  $background: 'ms-dark-grey.800',
46
46
  $error: 'ms-red',
47
- $undefined: 'ms-grey',
47
+ $disabled: (
48
+ 'default': rgba(#fff, 12%),
49
+ 'ink': rgba(#fff, 34%)
50
+ ),
48
51
  $radius: (),
49
52
  $global: (),
50
53
  $supertitle: (),
@@ -61,7 +64,7 @@ $vue-mode: $test-mode !default;
61
64
  $surface: ms-core.prioritize(map.get($theme, 'surface'), $surface);
62
65
  $background: ms-core.prioritize(map.get($theme, 'background'), $background);
63
66
  $error: ms-core.prioritize(map.get($theme, 'error'), $error);
64
- $undefined: ms-core.prioritize(map.get($theme, 'undefined'), $undefined);
67
+ $disabled: ms-core.prioritize(map.get($theme, 'disabled'), $disabled);
65
68
  $radius: ms-core.prioritize(map.get($theme, 'radius'), $radius);
66
69
  $global: ms-core.prioritize(map.get($theme, 'global'), $global);
67
70
  $supertitle: ms-core.prioritize(map.get($theme, 'supertitle'), $supertitle);
@@ -139,7 +142,7 @@ $vue-mode: $test-mode !default;
139
142
  $surface: $surface,
140
143
  $background: $background,
141
144
  $error: $error,
142
- $undefined: $undefined,
145
+ $disabled: $disabled,
143
146
  $radius: $radius,
144
147
  $breakpoints: $breakpoints,
145
148
  $global: map.merge($_init-type-global, $global),
@@ -158,18 +161,19 @@ $vue-mode: $test-mode !default;
158
161
  --ms-transition-time: 0.2s;
159
162
 
160
163
  font-family: ms-core.token-get('family-global');
164
+ line-height: ms-core.token-get('line-height-global');
161
165
  }
162
166
 
163
167
  @include ms-core.breakpoint-config(map.merge($_init-breakpoints, $breakpoints));
164
168
 
165
169
  @include font-pack.load((
166
- 'global': map.get($global, 'family'),
167
- 'supertitle': map.get($supertitle, 'family'),
168
- 'title': map.get($title, 'family'),
169
- 'subtitle': map.get($subtitle, 'family'),
170
- 'body': map.get($body, 'family'),
171
- 'mono': map.get($mono, 'family'),
172
- 'small': map.get($small, 'family'),
170
+ 'global': map.get(map.merge($_init-type-global, $global), 'family'),
171
+ 'supertitle': map.get(map.merge($_init-type-supertitle, $supertitle), 'family'),
172
+ 'title': map.get(map.merge($_init-type-title, $title), 'family'),
173
+ 'subtitle': map.get(map.merge($_init-type-subtitle, $subtitle), 'family'),
174
+ 'body': map.get(map.merge($_init-type-body, $body), 'family'),
175
+ 'mono': map.get(map.merge($_init-type-mono, $mono), 'family'),
176
+ 'small': map.get(map.merge($_init-type-small, $small), 'family'),
173
177
  ));
174
178
 
175
179
  *,
@@ -208,21 +212,25 @@ $vue-mode: $test-mode !default;
208
212
  font-family: inherit;
209
213
  font-size: inherit;
210
214
  font-weight: inherit;
211
- line-height: ms-core.primitive-token-get('line-height.normal');
215
+ line-height: inherit;
212
216
  }
213
217
 
214
218
  main.content-wrap {
215
219
  $margin: 15px;
216
220
  width: calc(100% - #{$margin * 2});
217
221
  max-width: ms-core.key-create('content-wrap-max-width', ms-core.primitive-token-get('dimension.xl'));
218
- display: ms-core.key-create('content-wrap-display', grid);
219
- grid-template-columns: repeat(ms-core.key-create('content-wrap-cols', 4), 1fr);
222
+ height: 100%;
223
+ display: ms-core.key-create('content-wrap-display', flex);
224
+ flex-flow: column nowrap;
220
225
  gap: ms-core.key-create('content-wrap-gap', ms-core.primitive-token-get('spacing.md'));
221
226
  margin: 0 auto;
222
227
  padding:
223
228
  ms-core.key-create('content-wrap-padding-y', ms-core.primitive-token-get('spacing.lg'))
224
229
  ms-core.key-create('content-wrap-padding-x', ms-core.primitive-token-get('spacing.none'));
225
230
 
231
+ // If grid
232
+ grid-template-columns: repeat(ms-core.key-create('content-wrap-cols', 4), 1fr);
233
+
226
234
  @include ms-core.breakpoint-create('medium') {
227
235
  @include ms-core.key-bind('content-wrap-cols', repeat(8, 1fr));
228
236
  }
@@ -23,10 +23,10 @@
23
23
  @use '../ms-core';
24
24
 
25
25
  /// Component variant maker.
26
- /// @param {string} $variant
26
+ /// @param {string} $variants
27
27
  /// @return {*} extension class.
28
- @mixin extend($variant) {
29
- .ms-badge.is-#{$variant} {
28
+ @mixin extend($variants) {
29
+ @include ms-core.component-extend('badge', $variants) {
30
30
  @content;
31
31
  }
32
32
  }
@@ -39,5 +39,13 @@
39
39
  @include ms-core.color-apply('badge', $color);
40
40
  @include ms-core.struct-apply('badge', $struct);
41
41
  @include ms-core.typography-bind('badge', $typography);
42
+
43
+ &:where(.is-outlined) {
44
+ @include ms-core.color-bind('badge', (
45
+ fill: transparent,
46
+ ink: ms-core.theme-get($color, 'fill'),
47
+ border: ms-core.theme-get($color, 'border')
48
+ ));
49
+ }
42
50
  }
43
51
  }
@@ -23,10 +23,10 @@
23
23
  @use '../ms-core';
24
24
 
25
25
  /// Component variant maker.
26
- /// @param {string} $variant
26
+ /// @param {string} $variants
27
27
  /// @return {*} extension class.
28
- @mixin extend($variant) {
29
- .ms-button.is-#{$variant} {
28
+ @mixin extend($variants) {
29
+ @include ms-core.component-extend('button', $variants) {
30
30
  @content;
31
31
  }
32
32
  }
@@ -22,11 +22,11 @@
22
22
 
23
23
  @use '../ms-core';
24
24
  @use 'sass:map';
25
+ @use 'sass:string';
25
26
 
26
27
  @mixin text($fills, $inks, $borders) {
27
28
  $fill: map.get($fills, 'default');
28
- $fill-disabled: map.get($fills, 'disabled');
29
- $ink-disabled: map.get($fills, 'disabled');
29
+ $ink-disabled: map.get($inks, 'disabled');
30
30
  $border: map.get($borders, 'default');
31
31
 
32
32
  &:not(:disabled) {
@@ -35,30 +35,30 @@
35
35
  ink: $fill,
36
36
  border: transparent
37
37
  ));
38
- @include ms-core.key-bind('button-outline', 2px solid rgba(raw($fill), ms-core.$color-fill-default-opacity));
38
+ @include ms-core.key-bind('button-outline', 2px solid rgba(_raw($fill), ms-core.$color-fill-default-opacity));
39
39
 
40
40
  &:hover {
41
41
  @include ms-core.color-bind('button', (
42
- fill: rgba(raw($fill), ms-core.$color-fill-hover-opacity),
42
+ fill: _smart-alpha-color($fill, ms-core.$color-fill-hover-opacity),
43
43
  ink: $fill,
44
- border: rgba(raw($border), ms-core.$color-border-hover-opacity)
44
+ border: _smart-alpha-color($border, ms-core.$color-border-hover-opacity, $type: 'border')
45
45
  ));
46
46
  }
47
47
 
48
48
  &:focus {
49
49
  @include ms-core.color-bind('button', (
50
- fill: rgba(raw($fill), ms-core.$color-fill-focus-opacity),
50
+ fill: _smart-alpha-color($fill, ms-core.$color-fill-focus-opacity),
51
51
  ink: $fill,
52
- border: rgba(raw($border), ms-core.$color-border-focus-opacity)
52
+ border: _smart-alpha-color($border, ms-core.$color-border-focus-opacity, $type: 'border')
53
53
  ));
54
- @include ms-core.key-bind('button-outline', 2px solid rgba(raw($fill), ms-core.$color-outline-focus-opacity));
54
+ @include ms-core.key-bind('button-outline', 2px solid rgba(_raw($fill), ms-core.$color-outline-focus-opacity));
55
55
  }
56
56
 
57
57
  &:active {
58
58
  @include ms-core.color-bind('button', (
59
- fill: rgba(raw($fill), ms-core.$color-fill-active-opacity),
59
+ fill: _smart-alpha-color($fill, ms-core.$color-fill-active-opacity),
60
60
  ink: $fill,
61
- border: rgba(raw($border), ms-core.$color-border-active-opacity)
61
+ border: _smart-alpha-color($border, ms-core.$color-border-active-opacity, $type: 'border')
62
62
  ));
63
63
  }
64
64
  }
@@ -79,7 +79,7 @@
79
79
  $fill-active: map.get($fills, 'active');
80
80
  $fill-disabled: map.get($fills, 'disabled');
81
81
  $ink: map.get($inks, 'default');
82
- $ink-disabled: map.get($fills, 'disabled');
82
+ $ink-disabled: map.get($inks, 'disabled');
83
83
  $border: map.get($borders, 'default');
84
84
  $border-hover: map.get($borders, 'hover');
85
85
  $border-focus: map.get($borders, 'focus');
@@ -92,15 +92,15 @@
92
92
  ink: $fill,
93
93
  border: $border
94
94
  ));
95
- @include ms-core.key-bind('button-outline', 2px solid rgba(raw($fill), ms-core.$color-fill-default-opacity));
95
+ @include ms-core.key-bind('button-outline', 2px solid rgba(_raw($fill), ms-core.$color-fill-default-opacity));
96
96
 
97
97
  &:focus {
98
98
  @include ms-core.color-bind('button', (
99
- fill: rgba(raw($fill), ms-core.$color-fill-focus-opacity),
99
+ fill: _smart-alpha-color($fill, ms-core.$color-fill-focus-opacity),
100
100
  ink: $fill,
101
101
  border: $border
102
102
  ));
103
- @include ms-core.key-bind('button-outline', 2px solid rgba(raw($fill), ms-core.$color-outline-focus-opacity));
103
+ @include ms-core.key-bind('button-outline', 2px solid rgba(_raw($fill), ms-core.$color-outline-focus-opacity));
104
104
  }
105
105
 
106
106
  &:hover {
@@ -149,7 +149,7 @@
149
149
  ink: $ink,
150
150
  border: $border
151
151
  ));
152
- @include ms-core.key-bind('button-outline', 2px solid rgba(raw($fill), ms-core.$color-fill-default-opacity));
152
+ @include ms-core.key-bind('button-outline', 2px solid rgba(_raw($fill), ms-core.$color-fill-default-opacity));
153
153
 
154
154
  &:hover {
155
155
  @include ms-core.color-bind('button', (
@@ -165,7 +165,7 @@
165
165
  ink: $ink,
166
166
  border: $border-focus
167
167
  ));
168
- @include ms-core.key-bind('button-outline', 2px solid rgba(raw($fill), ms-core.$color-outline-focus-opacity));
168
+ @include ms-core.key-bind('button-outline', 2px solid rgba(_raw($fill), ms-core.$color-outline-focus-opacity));
169
169
  }
170
170
 
171
171
  &:active {
@@ -186,6 +186,17 @@
186
186
  }
187
187
  }
188
188
 
189
- @function raw($query) {
189
+ @function _smart-alpha-color($query, $opacity, $type: 'fill', $state: 'hover') {
190
+ $_tones: ('hover': 400, 'active': 600);
191
+ $_color: string.slice($query, 1, (string.length($query) - 4));
192
+ // $_tone: string.slice($query, (string.length($_color) + 2), (string.length($query)));
193
+ @if $type == 'border' { @return rgba(#fff, 0%); }
194
+ @if ms-core.token-check('#{$_color}-alpha-#{map.get($_tones, $state)}') {
195
+ @return ms-core.token-get('#{$_color}-alpha-#{map.get($_tones, $state)}');
196
+ }
197
+ @return _raw($query, $opacity);
198
+ }
199
+
200
+ @function _raw($query) {
190
201
  @return ms-core.token-switch-raw($query);
191
202
  }
@@ -78,6 +78,10 @@ $_states: ('error');
78
78
  );
79
79
  outline-offset: 2px;
80
80
 
81
+ &:where(:disabled) {
82
+ cursor: not-allowed;
83
+ }
84
+
81
85
  &:where(.is-icon-only) {
82
86
  @include ms-core.struct-bind('button', (
83
87
  width: (min: auto),
@@ -97,18 +101,18 @@ $_states: ('error');
97
101
  'hover': '#{$state}-300',
98
102
  'focus': '#{$state}-400',
99
103
  'active': '#{$state}-200',
100
- 'disabled': '#{$state}-800',
104
+ 'disabled': 'disabled-ink',
101
105
  ),
102
106
  $inks: (
103
107
  'default': '#{$state}-ink',
104
- 'disabled': '#{$state}-800'
108
+ 'disabled': 'disabled-ink'
105
109
  ),
106
110
  $borders: (
107
111
  'default': '#{$state}-400',
108
112
  'hover': '#{$state}-300',
109
113
  'focus': '#{$state}-400',
110
114
  'active': '#{$state}-200',
111
- 'disabled': '#{$state}-800',
115
+ 'disabled': 'disabled-ink',
112
116
  )
113
117
  );
114
118
  }
@@ -137,18 +141,18 @@ $_states: ('error');
137
141
  'hover': '#{$state}-300',
138
142
  'focus': '#{$state}-400',
139
143
  'active': '#{$state}-200',
140
- 'disabled': '#{$state}-800',
144
+ 'disabled': 'disabled-ink',
141
145
  ),
142
146
  $inks: (
143
147
  'default': '#{$state}-ink',
144
- 'disabled': '#{$state}-800'
148
+ 'disabled': 'disabled-ink'
145
149
  ),
146
150
  $borders: (
147
151
  'default': '#{$state}-400',
148
152
  'hover': '#{$state}-300',
149
153
  'focus': '#{$state}-400',
150
154
  'active': '#{$state}-200',
151
- 'disabled': '#{$state}-800',
155
+ 'disabled': 'disabled-ink',
152
156
  )
153
157
  );
154
158
  }
@@ -170,18 +174,18 @@ $_states: ('error');
170
174
  'hover': '#{$state}-300',
171
175
  'focus': '#{$state}-400',
172
176
  'active': '#{$state}-200',
173
- 'disabled': '#{$state}-800',
177
+ 'disabled': 'disabled',
174
178
  ),
175
179
  $inks: (
176
180
  'default': '#{$state}-ink',
177
- 'disabled': '#{$state}-600'
181
+ 'disabled': 'disabled-ink'
178
182
  ),
179
183
  $borders: (
180
184
  'default': '#{$state}-400',
181
185
  'hover': '#{$state}-300',
182
186
  'focus': '#{$state}-400',
183
187
  'active': '#{$state}-200',
184
- 'disabled': '#{$state}-800',
188
+ 'disabled': 'disabled',
185
189
  )
186
190
  );
187
191
  }
@@ -26,21 +26,21 @@ $init-color: (
26
26
  hover: 'accent-300',
27
27
  active: 'accent-200',
28
28
  focus: 'accent-400',
29
- disabled: 'undefined-300',
29
+ disabled: 'disabled',
30
30
  ),
31
31
  ink: (
32
32
  default: 'accent-ink',
33
33
  hover: 'accent-ink',
34
34
  active: 'accent-ink',
35
35
  focus: 'accent-ink',
36
- disabled: 'undefined-600',
36
+ disabled: 'disabled-ink',
37
37
  ),
38
38
  border: (
39
39
  default: 'accent-400',
40
40
  hover: 'accent-300',
41
41
  active: 'accent-200',
42
42
  focus: 'accent-400',
43
- disabled: 'undefined-300',
43
+ disabled: 'disabled',
44
44
  ),
45
45
  );
46
46
 
@@ -50,7 +50,7 @@ $init-struct: (
50
50
  min: 69px,
51
51
  max: max-content
52
52
  ),
53
- padding: ('sm' 'md'),
53
+ padding: ('md' 'lg'),
54
54
  radius: 'small',
55
55
  border-width: 'xs',
56
56
  border-style: solid,
@@ -61,7 +61,7 @@ $init-typography: (
61
61
  family: 'global',
62
62
  size: 'body',
63
63
  weight: 'bold',
64
- line-height: 'condensed'
64
+ line-height: 1.25rem
65
65
  );
66
66
 
67
67
  $init-settings: ();
@@ -0,0 +1,243 @@
1
+ //---------------------------------------------------
2
+ // Copyright (c) 2024 MatteuSan
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ //---------------------------------------------------
22
+
23
+ @use '../ms-core';
24
+ @use 'sass:map';
25
+
26
+ @mixin init(
27
+ $struct,
28
+ $typography,
29
+ ) {
30
+ $radius: ms-core.theme-get($struct, 'radius');
31
+ $padding: ms-core.theme-get($struct, 'padding');
32
+ $section-gap: ms-core.theme-get($struct, 'gap', 'section');
33
+ $header-gap: ms-core.theme-get($struct, 'gap', 'header');
34
+ $footer-gap: ms-core.theme-get($struct, 'gap', 'footer');
35
+
36
+ $title-family: ms-core.theme-get($typography, 'family', 'title');
37
+ $title-size: ms-core.theme-get($typography, 'size', 'title');
38
+ $title-weight: ms-core.theme-get($typography, 'weight', 'title');
39
+ $title-line-height: ms-core.theme-get($typography, 'line-height', 'title');
40
+
41
+ $subtitle-family: ms-core.theme-get($typography, 'family', 'subtitle');
42
+ $subtitle-size: ms-core.theme-get($typography, 'size', 'subtitle');
43
+ $subtitle-weight: ms-core.theme-get($typography, 'weight', 'subtitle');
44
+ $subtitle-line-height: ms-core.theme-get($typography, 'line-height', 'subtitle');
45
+
46
+ $content-family: ms-core.theme-get($typography, 'family');
47
+ $content-size: ms-core.theme-get($typography, 'size');
48
+ $content-weight: ms-core.theme-get($typography, 'weight');
49
+ $content-line-height: ms-core.theme-get($typography, 'line-height');
50
+
51
+ $icon-size: ms-core.theme-get($struct, 'size', 'icon');
52
+
53
+ .ms-card {
54
+ // @include ms-core.key-bind('card-section-gap', ms-core.primitive-token-switch('spacing.#{$section-gap}', $section-gap));
55
+ @include ms-core.struct-gap('card-section', $section-gap, 'bind');
56
+ // overflow: hidden;
57
+
58
+ @content;
59
+
60
+ .ms-card__media {
61
+ width: 100%;
62
+ height: 100%;
63
+ max-height: 120px;
64
+ overflow: hidden;
65
+ @include ms-core.struct-apply('card-media', (
66
+ radius: ($radius $radius 0 0),
67
+ ));
68
+
69
+ img {
70
+ width: 100%;
71
+ height: 100%;
72
+ object-fit: cover;
73
+ object-position: center;
74
+ }
75
+ }
76
+
77
+ .ms-card__header {
78
+ display: flex;
79
+ flex-flow: row nowrap;
80
+ justify-content: space-between;
81
+ gap: ms-core.key-create('card-header-gap', ms-core.primitive-token-switch('spacing.#{$header-gap}', $header-gap));
82
+ @include ms-core.color-border('card', transparent);
83
+ @include ms-core.struct-apply('card-header', (
84
+ radius: (0),
85
+ padding: ($padding $padding 0),
86
+ border-width: ('xs' 'xs' 0),
87
+ border-style: 'solid',
88
+ ));
89
+
90
+ &:not(:only-child),
91
+ &:not(:last-child) {
92
+ padding-bottom: ms-core.key-get('card-section-gap');
93
+ }
94
+
95
+ &:last-child {
96
+ @include ms-core.struct-bind('card-header', (
97
+ radius: (0 0 $radius $radius),
98
+ border-width: (0 'xs' 'xs'),
99
+ padding: (0 $padding $padding),
100
+ ));
101
+ }
102
+
103
+ &:first-child {
104
+ @include ms-core.struct-bind('card-header', (
105
+ radius: ($radius $radius 0 0),
106
+ padding: ($padding $padding 0),
107
+ border-width: ('xs' 'xs' 0),
108
+ ));
109
+ }
110
+
111
+ &:only-child {
112
+ @include ms-core.struct-bind('card-header', (
113
+ radius: $radius,
114
+ padding: $padding,
115
+ border-width: ('xs'),
116
+ ));
117
+ }
118
+
119
+ .ms-card__mast {
120
+ .ms-card__title {
121
+ @include ms-core.typography-apply('card-title', (
122
+ family: $title-family,
123
+ size: $title-size,
124
+ weight: $title-weight,
125
+ line-height: $title-line-height
126
+ ));
127
+ @include ms-core.break(1);
128
+ }
129
+
130
+ .ms-card__subtitle {
131
+ @include ms-core.typography-apply('card-subtitle', (
132
+ family: $subtitle-family,
133
+ size: $subtitle-size,
134
+ weight: $subtitle-weight,
135
+ line-height: $subtitle-line-height
136
+ ));
137
+ @include ms-core.break(2);
138
+ }
139
+ }
140
+
141
+ .ms-card__icon {
142
+ width: ms-core.key-create('card-icon-size', ms-core.token-switch($icon-size));
143
+ height: ms-core.key-create('card-icon-size', ms-core.token-switch($icon-size));
144
+ border-radius: 50%;
145
+ @include ms-core.color-apply('card-icon', (
146
+ border: 'accent-400'
147
+ ));
148
+ @include ms-core.struct-apply('card-icon', (
149
+ border-width: 1px,
150
+ border-style: solid
151
+ ));
152
+
153
+ img {
154
+ height: 100%;
155
+ object-fit: cover;
156
+ object-position: center;
157
+ }
158
+ }
159
+ }
160
+
161
+ .ms-card__content {
162
+ @include ms-core.color-border('card', transparent);
163
+ @include ms-core.struct-apply('card', (
164
+ radius: (0 0 $radius $radius),
165
+ padding: (0 $padding),
166
+ border-width: (0 'xs' 'xs'),
167
+ border-style: 'solid',
168
+ ));
169
+
170
+ p {
171
+ @include ms-core.typography-apply('card', (
172
+ family: $content-family,
173
+ size: $content-size,
174
+ weight: $content-weight,
175
+ line-height: $content-line-height
176
+ ));
177
+ }
178
+
179
+ &:not(:only-child),
180
+ &:not(:last-child) {
181
+ padding-bottom: ms-core.key-get('card-section-gap');
182
+ }
183
+
184
+ &:last-child {
185
+ @include ms-core.struct-bind('card', (
186
+ radius: (0 0 $radius $radius),
187
+ padding: (0 $padding $padding),
188
+ ));
189
+ }
190
+
191
+ &:first-child {
192
+ @include ms-core.struct-bind('card', (
193
+ radius: ($radius $radius 0 0),
194
+ padding: ($padding $padding 0),
195
+ border-width: ('xs' 'xs' 0),
196
+ ));
197
+ }
198
+
199
+ &:only-child {
200
+ @include ms-core.struct-bind('card', (
201
+ radius: $radius,
202
+ padding: $padding,
203
+ border-width: 'xs'
204
+ ));
205
+ }
206
+ }
207
+
208
+ .ms-card__footer {
209
+ display: flex;
210
+ flex-flow: row nowrap;
211
+ justify-content: end;
212
+ gap: ms-core.key-create('card-footer-gap', ms-core.primitive-token-switch('spacing.#{$footer-gap}', $footer-gap));
213
+ @include ms-core.color-border('card', transparent);
214
+ @include ms-core.struct-apply('card-footer', (
215
+ radius: (0 0 $radius $radius),
216
+ padding: (0 $padding),
217
+ border-width: 'xs',
218
+ border-style: 'solid',
219
+ ));
220
+
221
+ &:last-child {
222
+ @include ms-core.struct-bind('card-footer', (
223
+ radius: (0 0 $radius $radius),
224
+ padding: (0 $padding $padding),
225
+ ));
226
+ }
227
+
228
+ &:first-child {
229
+ @include ms-core.struct-bind('card-footer', (
230
+ radius: ($radius $radius 0 0),
231
+ padding: ($padding $padding 0),
232
+ ));
233
+ }
234
+
235
+ &:only-child {
236
+ @include ms-core.struct-bind('card-footer', (
237
+ radius: $radius,
238
+ padding: $padding,
239
+ ));
240
+ }
241
+ }
242
+ }
243
+ }
@@ -23,10 +23,10 @@
23
23
  @use '../ms-core';
24
24
 
25
25
  /// Component variant maker.
26
- /// @param {string} $variant
26
+ /// @param {string} $variants
27
27
  /// @return {*} extension class.
28
- @mixin extend($variant) {
29
- .ms-surface.is-#{$variant} {
28
+ @mixin extend($variants) {
29
+ @include ms-core.component-extend('card', $variants) {
30
30
  @content;
31
31
  }
32
32
  }
@@ -35,19 +35,19 @@
35
35
  /// @param {map} $color-map
36
36
  /// @return {*} color styles.
37
37
  @mixin color($color-map) {
38
- @include ms-core.color-bind('surface', $color-map);
38
+ @include ms-core.color-bind('card', $color-map);
39
39
  }
40
40
 
41
41
  /// Structure variant mixin.
42
42
  /// @param {map} $struct-map
43
43
  /// @return {*} struct styles.
44
44
  @mixin struct($struct-map) {
45
- @include ms-core.struct-bind('surface', $struct-map);
45
+ @include ms-core.struct-bind('card', $struct-map);
46
46
  }
47
47
 
48
48
  /// Typography variant mixin.
49
49
  /// @param {map} $type-map
50
50
  /// @return {*} typography styles.
51
51
  @mixin typography($type-map) {
52
- @include ms-core.typography-bind('surface', $type-map);
52
+ @include ms-core.typography-bind('card', $type-map);
53
53
  }