@siemens/element-theme 49.4.0 → 49.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siemens/element-theme",
3
- "version": "49.4.0",
3
+ "version": "49.5.0",
4
4
  "description": "Element CSS theme.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -19,18 +19,20 @@
19
19
  padding-inline: variables.$badge-padding-x;
20
20
  margin-block: 0;
21
21
  margin-inline: map.get(spacers.$spacers, 4);
22
- block-size: map.get(spacers.$spacers, 8);
23
- line-height: map.get(spacers.$spacers, 8);
22
+ line-height: 1.25rem;
24
23
  flex-shrink: 0;
25
24
  font-size: typography.$si-font-size-body;
26
25
  font-weight: typography.$si-font-weight-body;
27
- max-inline-size: 196px;
28
- min-inline-size: map.get(spacers.$spacers, 8);
26
+ max-inline-size: 24.5ch;
27
+ // Make min-inline-size equal the badge height to create a circular badge when there's only one character.
28
+ min-inline-size: calc(1.25rem + 2 * #{variables.$badge-padding-y}); // 1.75rem = same as height
29
29
  text-overflow: ellipsis;
30
30
  overflow: hidden;
31
31
  text-align: center;
32
32
  white-space: nowrap;
33
- vertical-align: baseline;
33
+ // Use middle instead of baseline to produce consistent line-box heights
34
+ // across inline-block (text-only) and inline-flex (icon) badge variants.
35
+ vertical-align: middle;
34
36
  border-radius: variables.$badge-border-radius;
35
37
 
36
38
  &:empty {
@@ -124,11 +126,11 @@
124
126
  @extend %badge-text-emphasis;
125
127
  }
126
128
 
127
- .icon {
128
- padding-block: map.get(spacers.$spacers, 1);
129
- margin-inline-start: -4px;
130
- margin-inline-end: map.get(spacers.$spacers, 1);
131
- vertical-align: bottom;
129
+ &:has(> .icon) {
130
+ display: inline-flex;
131
+ align-items: center;
132
+ gap: map.get(spacers.$spacers, 1);
133
+ padding-inline: map.get(spacers.$spacers, 2) variables.$badge-padding-x;
132
134
  }
133
135
  }
134
136
 
@@ -126,20 +126,23 @@ $btn-size-sm: 24px !default;
126
126
  margin-inline: 0;
127
127
  }
128
128
  }
129
-
130
- &:hover {
131
- color: semantic-tokens.$element-ui-0-hover;
132
- }
133
129
  }
134
130
 
135
- .btn-check:checked + .btn,
136
- label.btn:has(.btn-check:checked) {
137
- background: semantic-tokens.$element-action-secondary-active;
138
- border-color: semantic-tokens.$element-action-secondary-border-hover;
131
+ .btn-check + .btn:hover,
132
+ label:has(.btn-check:not(:checked)):hover > * {
139
133
  color: semantic-tokens.$element-ui-0-hover;
140
- z-index: 2;
134
+ }
135
+
136
+ .btn-check:checked {
137
+ + .btn {
138
+ background: semantic-tokens.$element-action-secondary-active;
139
+ border-color: semantic-tokens.$element-action-secondary-border-hover;
140
+ color: semantic-tokens.$element-ui-0-hover;
141
+ z-index: 2;
142
+ }
141
143
 
142
- &:hover {
144
+ + .btn:hover,
145
+ &:hover + .btn {
143
146
  color: semantic-tokens.$element-text-primary;
144
147
  }
145
148
  }
@@ -69,7 +69,7 @@ button {
69
69
 
70
70
  .icon {
71
71
  margin-block: -#{map.get(spacers.$spacers, 2)};
72
- margin-inline: -#{map.get(spacers.$spacers, 2)} #{map.get(spacers.$spacers, 2)};
72
+ margin-inline-end: #{map.get(spacers.$spacers, 2)};
73
73
  }
74
74
  }
75
75
 
@@ -104,9 +104,23 @@ button {
104
104
  --btn-color-active: #{semantic-tokens.$element-action-warning-text};
105
105
  }
106
106
 
107
+ // FIXME: Before the ghost variants were introduced, the .btn-ghost styling matched the tertiary styling.
108
+ // To avoid a breaking change, the class .btn-primary-ghost has been added which deviates from the usual button naming convention.
109
+ // With the next major release, the .btn-primary-ghost class should be removed so that the ghost buttons match the button naming convention
110
+ // and schematics should update .btn-ghost to .btn-tertiary-ghost.
111
+ .btn-primary-ghost {
112
+ --btn-bg: #{semantic-tokens.$element-base-1};
113
+ --btn-bg-hover: #{semantic-tokens.$element-base-1-hover};
114
+ --btn-bg-active: #{semantic-tokens.$element-base-1-selected};
115
+ --btn-color: #{semantic-tokens.$element-text-primary};
116
+ --btn-color-hover: #{semantic-tokens.$element-text-primary};
117
+ --btn-color-active: #{semantic-tokens.$element-text-primary};
118
+ }
119
+
107
120
  .btn-secondary,
108
121
  .btn-secondary-warning,
109
- .btn-secondary-danger {
122
+ .btn-secondary-danger,
123
+ .btn-secondary-ghost {
110
124
  --btn-bg: #{semantic-tokens.$element-action-secondary};
111
125
  --btn-bg-hover: #{semantic-tokens.$element-action-secondary-hover};
112
126
  --btn-bg-active: #{semantic-tokens.$element-action-secondary-active};
@@ -121,7 +135,9 @@ button {
121
135
 
122
136
  .btn-tertiary,
123
137
  .btn-tertiary-warning,
124
- .btn-tertiary-danger {
138
+ .btn-tertiary-danger,
139
+ .btn-tertiary-ghost,
140
+ .btn-ghost {
125
141
  --btn-bg: transparent;
126
142
  --btn-bg-hover: #{semantic-tokens.$element-action-secondary-hover};
127
143
  --btn-bg-active: #{semantic-tokens.$element-action-secondary-active};
@@ -154,6 +170,19 @@ button {
154
170
  --btn-border-color-active: #{semantic-tokens.$element-action-danger-active};
155
171
  }
156
172
 
173
+ .btn-secondary-ghost,
174
+ .btn-tertiary-ghost,
175
+ .btn-ghost {
176
+ --btn-bg-hover: #{semantic-tokens.$element-base-1-hover};
177
+ --btn-bg-active: #{semantic-tokens.$element-base-1-selected};
178
+ --btn-color: #{semantic-tokens.$element-text-primary};
179
+ --btn-color-hover: #{semantic-tokens.$element-text-primary};
180
+ --btn-color-active: #{semantic-tokens.$element-text-primary};
181
+ --btn-border-color: #{semantic-tokens.$element-ui-3};
182
+ --btn-border-color-hover: transparent;
183
+ --btn-border-color-active: transparent;
184
+ }
185
+
157
186
  .btn-link {
158
187
  --btn-color: #{bootstrap-variables.$btn-link-color};
159
188
  --btn-color-hover: #{bootstrap-variables.$btn-link-hover-color};
@@ -213,12 +242,10 @@ button {
213
242
  }
214
243
  }
215
244
 
216
- .btn-circle.btn-ghost,
217
- .btn-icon.btn-ghost,
218
245
  .btn-close {
219
246
  --btn-bg: transparent;
220
- --btn-bg-hover: #{variables.$element-base-1-hover};
221
- --btn-bg-active: #{variables.$element-base-1-selected};
247
+ --btn-bg-hover: #{semantic-tokens.$element-base-1-hover};
248
+ --btn-bg-active: #{semantic-tokens.$element-base-1-selected};
222
249
  --btn-color: #{semantic-tokens.$element-ui-1};
223
250
  --btn-color-active: #{semantic-tokens.$element-ui-1};
224
251
  }
@@ -209,7 +209,10 @@
209
209
  // scss-docs-start modal-fullscreen-loop
210
210
  @each $breakpoint in map.keys(variables.$grid-breakpoints) {
211
211
  $infix: breakpoints.breakpoint-infix($breakpoint, variables.$grid-breakpoints);
212
- $postfix: if($infix != '', $infix + '-down', '');
212
+ $postfix: '';
213
+ @if ($infix != '') {
214
+ $postfix: $infix + '-down';
215
+ }
213
216
 
214
217
  @include breakpoints.media-breakpoint-down($breakpoint) {
215
218
  .modal-fullscreen#{$postfix} {
@@ -269,21 +269,20 @@ code,
269
269
  kbd,
270
270
  samp {
271
271
  font-family: variables.$font-family-code;
272
- font-size: 1em; // Correct the odd `em` font sizing in all browsers.
272
+ font-size: variables.$code-font-size;
273
+ line-height: variables.$code-line-height;
273
274
  direction: ltr;
274
275
  unicode-bidi: bidi-override;
275
276
  }
276
277
 
277
- // 1. Remove browser default top margin
278
- // 2. Reset browser default of `1em` to use `rem`s
279
- // 3. Don't allow content to break outside
280
-
281
278
  pre {
282
279
  display: block;
283
- margin-block: 0 1rem; // 1 // 2
284
- overflow: auto; // 3
285
- font-size: variables.$code-font-size;
280
+ padding-block: variables.$pre-padding-y;
281
+ padding-inline: variables.$pre-padding-x;
282
+ border-radius: variables.$pre-border-radius;
283
+ overflow: auto;
286
284
  color: variables.$pre-color;
285
+ border: variables.$pre-border-color variables.$pre-border-width solid;
287
286
 
288
287
  // Account for some code outputs that place code tags in pre tags
289
288
  code {
@@ -294,9 +293,12 @@ pre {
294
293
  }
295
294
 
296
295
  code {
297
- font-size: variables.$code-font-size;
296
+ background: variables.$code-background;
298
297
  color: variables.$code-color;
299
298
  word-wrap: break-word;
299
+ padding-block: variables.$code-padding-y;
300
+ padding-inline: variables.$code-padding-x;
301
+ border-radius: variables.$code-border-radius;
300
302
 
301
303
  // Streamline the style when inside anchors to avoid broken underline and more
302
304
  a > & {
@@ -307,14 +309,12 @@ code {
307
309
  kbd {
308
310
  padding-block: variables.$kbd-padding-y;
309
311
  padding-inline: variables.$kbd-padding-x;
310
- font-size: variables.$kbd-font-size;
311
312
  color: variables.$kbd-color;
312
313
  background-color: variables.$kbd-bg;
313
314
  border-radius: variables.$border-radius-sm;
314
315
 
315
316
  kbd {
316
317
  padding: 0;
317
- font-size: 1em;
318
318
  font-weight: variables.$nested-kbd-font-weight;
319
319
  }
320
320
  }
@@ -409,6 +409,17 @@ textarea {
409
409
  line-height: inherit;
410
410
  }
411
411
 
412
+ input,
413
+ textarea {
414
+ &:disabled {
415
+ color: variables.$text-muted;
416
+
417
+ &::placeholder {
418
+ color: variables.$input-placeholder-disabled-color;
419
+ }
420
+ }
421
+ }
422
+
412
423
  // Remove the inheritance of text transform in Firefox
413
424
  button,
414
425
  select {
@@ -288,7 +288,7 @@ $table-variants: (
288
288
  // For each of Bootstrap's buttons, define text, background, and border color.
289
289
 
290
290
  $btn-padding-y: map.get(spacers.$spacers, 4);
291
- $btn-padding-x: map.get(spacers.$spacers, 6);
291
+ $btn-padding-x: map.get(spacers.$spacers, 4);
292
292
  $btn-font-size: $font-size-base;
293
293
  $btn-line-height: typography.$si-line-height-h5 !default;
294
294
  $btn-white-space: null !default; // Set to `nowrap` to prevent text wrapping
@@ -519,9 +519,9 @@ $popover-arrow-outer-color: $popover-border-color !default;
519
519
  $badge-font-size: typography.$si-font-size-body;
520
520
  $badge-font-weight: typography.$si-font-weight-body;
521
521
  $badge-color: semantic-tokens.$element-text-inverse !default;
522
- $badge-padding-y: 0;
522
+ $badge-padding-y: map.get(spacers.$spacers, 1);
523
523
  $badge-padding-x: map.get(spacers.$spacers, 4);
524
- $badge-border-radius: map.get(spacers.$spacers, 5);
524
+ $badge-border-radius: 0.75rem;
525
525
 
526
526
  // Modals
527
527
 
@@ -645,13 +645,24 @@ $breadcrumb-border-radius: 0 !default;
645
645
 
646
646
  // Code
647
647
 
648
- $code-font-size: 87.5% !default;
649
- $code-color: semantic-tokens.$element-data-11 !default;
648
+ $code-font-size: typography.$si-font-size-body !default;
649
+ $code-line-height: typography.$si-line-height-body !default;
650
+ $code-color: semantic-tokens.$element-text-primary !default;
651
+ $code-background: semantic-tokens.$element-ui-4 !default;
652
+ $code-padding-y: map.get(spacers.$spacers, 1) !default;
653
+ $code-padding-x: map.get(spacers.$spacers, 2) !default;
654
+ $code-border-radius: semantic-tokens.$element-radius-1 !default;
650
655
 
651
656
  $kbd-padding-y: 0.2rem !default;
652
657
  $kbd-padding-x: 0.4rem !default;
653
- $kbd-font-size: $code-font-size !default;
654
- $kbd-color: semantic-tokens.$element-base-1 !default;
658
+ $kbd-color: semantic-tokens.$element-text-primary !default;
655
659
  $kbd-bg: semantic-tokens.$element-ui-1 !default;
660
+ // variable is unused. TODO: remove it.
661
+ $kbd-font-size: $code-font-size !default;
656
662
 
657
663
  $pre-color: semantic-tokens.$element-text-primary !default;
664
+ $pre-padding-y: map.get(spacers.$spacers, 4) !default;
665
+ $pre-padding-x: map.get(spacers.$spacers, 4) !default;
666
+ $pre-border-color: semantic-tokens.$element-ui-4 !default;
667
+ $pre-border-width: $border-width !default;
668
+ $pre-border-radius: semantic-tokens.$element-radius-1 !default;
@@ -1,4 +1,5 @@
1
- // Shared between modals and offcanvases
1
+ @use '../variables';
2
+
2
3
  @mixin overlay-backdrop($zindex, $backdrop-bg, $backdrop-opacity) {
3
4
  position: fixed;
4
5
  inset-block-start: 0;
@@ -7,13 +8,14 @@
7
8
  inline-size: 100vw;
8
9
  block-size: 100vh;
9
10
  background-color: $backdrop-bg;
11
+ opacity: $backdrop-opacity;
12
+ transition: variables.$transition-fade;
10
13
 
11
- // Fade for backdrop
12
- &.fade {
14
+ @starting-style {
13
15
  opacity: 0;
14
16
  }
15
17
 
16
- &.show {
17
- opacity: $backdrop-opacity;
18
+ &.backdrop-leave {
19
+ opacity: 0;
18
20
  }
19
21
  }
@@ -28,7 +28,10 @@
28
28
  @if not $n {
29
29
  @error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
30
30
  }
31
- @return if($n < list.length($breakpoint-names), list.nth($breakpoint-names, $n + 1), null);
31
+ @if ($n < list.length($breakpoint-names)) {
32
+ @return list.nth($breakpoint-names, $n + 1);
33
+ }
34
+ @return null;
32
35
  }
33
36
 
34
37
  // Minimum breakpoint width. Null for the smallest (first) breakpoint.
@@ -37,7 +40,10 @@
37
40
  // 576px
38
41
  @function breakpoint-min($name, $breakpoints: variables.$grid-breakpoints) {
39
42
  $min: map.get($breakpoints, $name);
40
- @return if($min != 0, $min, null);
43
+ @if ($min != 0) {
44
+ @return $min;
45
+ }
46
+ @return null;
41
47
  }
42
48
 
43
49
  // Maximum breakpoint width.
@@ -51,7 +57,10 @@
51
57
  // 767.98px
52
58
  @function breakpoint-max($name, $breakpoints: variables.$grid-breakpoints) {
53
59
  $max: map.get($breakpoints, $name);
54
- @return if($max and $max > 0, $max - 0.02, null);
60
+ @if ($max and $max > 0) {
61
+ @return $max - 0.02;
62
+ }
63
+ @return null;
55
64
  }
56
65
 
57
66
  // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
@@ -62,7 +71,10 @@
62
71
  // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
63
72
  // "-sm"
64
73
  @function breakpoint-infix($name, $breakpoints: variables.$grid-breakpoints) {
65
- @return if(breakpoint-min($name, $breakpoints) == null, '', '-#{$name}');
74
+ @if (breakpoint-min($name, $breakpoints) == null) {
75
+ @return '';
76
+ }
77
+ @return '-#{$name}';
66
78
  }
67
79
 
68
80
  // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
@@ -26,11 +26,9 @@
26
26
 
27
27
  @mixin make-col-ready($gutter: variables.$grid-gutter-width) {
28
28
  // Add box sizing if only the grid is loaded
29
- box-sizing: if(
30
- meta.variable-exists(include-column-box-sizing) and $include-column-box-sizing,
31
- border-box,
32
- null
33
- );
29
+ @if (meta.variable-exists(include-column-box-sizing) and $include-column-box-sizing) {
30
+ box-sizing: border-box;
31
+ }
34
32
  // Prevent columns from becoming too narrow when at smaller grid tiers by
35
33
  // always setting `width: 100%;`. This works because we set the width
36
34
  // later on to override this initial width.
@@ -60,7 +58,11 @@
60
58
 
61
59
  @mixin make-col-offset($size, $columns: variables.$grid-columns) {
62
60
  $num: functions.divide($size, $columns);
63
- margin-inline-start: if($num == 0, 0, math.percentage($num));
61
+ @if ($num == 0) {
62
+ margin-inline-start: 0;
63
+ } @else {
64
+ margin-inline-start: math.percentage($num);
65
+ }
64
66
  }
65
67
 
66
68
  // Row columns
@@ -24,28 +24,33 @@
24
24
  }
25
25
 
26
26
  // Use custom class if present
27
- $property-class: if(
28
- map.has-key($utility, class),
29
- map.get($utility, class),
30
- list.nth($properties, 1)
31
- );
32
- $property-class: if($property-class == null, '', $property-class);
27
+ $property-class: list.nth($properties, 1);
28
+ @if (map.has-key($utility, class)) {
29
+ $property-class: map.get($utility, class);
30
+ }
31
+ @if ($property-class == null) {
32
+ $property-class: '';
33
+ }
33
34
 
34
35
  // State params to generate pseudo-classes
35
- $state: if(map.has-key($utility, state), map.get($utility, state), ());
36
+ $state: ();
37
+ @if (map.has-key($utility, state)) {
38
+ $state: map.get($utility, state);
39
+ }
36
40
 
37
- $infix: if(
38
- $property-class == '' and string.slice($infix, 1, 1) == '-',
39
- string.slice($infix, 2),
40
- $infix
41
- );
41
+ @if ($property-class == '' and string.slice($infix, 1, 1) == '-') {
42
+ $infix: string.slice($infix, 2);
43
+ }
42
44
 
43
45
  // Don't prefix if value key is null (eg. with shadow class)
44
- $property-class-modifier: if(
45
- $key,
46
- if($property-class == '' and $infix == '', '', '-') + $key,
47
- ''
48
- );
46
+ $property-class-modifier: '';
47
+ @if ($key) {
48
+ @if ($property-class == '' and $infix == '') {
49
+ $property-class-modifier: $key;
50
+ } @else {
51
+ $property-class-modifier: '-' + $key;
52
+ }
53
+ }
49
54
 
50
55
  $is-css-var: map.get($utility, css-var);
51
56
  $is-local-vars: map.get($utility, local-vars);
@@ -62,6 +67,11 @@
62
67
  }
63
68
  }
64
69
  } @else {
70
+ $important: null;
71
+ @if (variables.$enable-important-utilities) {
72
+ $important: string.unquote('!important');
73
+ }
74
+
65
75
  .#{$property-class + $infix + $property-class-modifier} {
66
76
  @each $property in $properties {
67
77
  @if $is-local-vars {
@@ -69,14 +79,14 @@
69
79
  --#{variables.$variable-prefix}#{$local-var}: #{$value};
70
80
  }
71
81
  }
72
- #{$property}: $value if(variables.$enable-important-utilities, !important, null);
82
+ #{$property}: $value $important;
73
83
  }
74
84
  }
75
85
 
76
86
  @each $pseudo in $state {
77
87
  .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
78
88
  @each $property in $properties {
79
- #{$property}: $value if(variables.$enable-important-utilities, !important, null);
89
+ #{$property}: $value $important;
80
90
  }
81
91
  }
82
92
  }
@@ -13,16 +13,6 @@
13
13
  font-weight: variables.$si-font-weight-semibold;
14
14
  }
15
15
 
16
- code {
17
- color: variables.$element-text-primary;
18
- background-color: variables.$element-ui-4;
19
- padding-block: map.get(variables.$spacers, 1);
20
- padding-inline: map.get(variables.$spacers, 2);
21
- border-radius: variables.$element-radius-1;
22
- font-family:
23
- 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
24
- }
25
-
26
16
  ul,
27
17
  ol {
28
18
  max-inline-size: 100%;
@@ -44,16 +34,6 @@
44
34
  }
45
35
 
46
36
  pre {
47
- background-color: variables.$element-ui-4;
48
- padding-block: map.get(variables.$spacers, 4);
49
- padding-inline: map.get(variables.$spacers, 4);
50
- border-radius: variables.$element-radius-1;
51
- overflow-x: auto;
52
- margin-inline: 0;
53
- inline-size: max-content;
54
- max-inline-size: 100%;
55
- box-sizing: border-box;
56
-
57
37
  code {
58
38
  background-color: transparent;
59
39
  padding-block: 0;