@carbon/styles 1.77.0-rc.0 → 1.77.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.
@@ -130,8 +130,8 @@ describe('@carbon/styles/scss/type', () => {
130
130
  const { stylesheet } = css.parse(result.css.toString());
131
131
  const [rule] = stylesheet.rules;
132
132
  for (const declaration of rule.declarations) {
133
- expect(declaration.property).toEqual(
134
- expect.stringContaining('--custom-')
133
+ expect(declaration.value).toEqual(
134
+ expect.stringContaining('var(--custom-')
135
135
  );
136
136
  }
137
137
  });
package/scss/_config.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  //
2
- // Copyright IBM Corp. 2018, 2023
2
+ // Copyright IBM Corp. 2018, 2025
3
3
  //
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
@@ -18,11 +18,11 @@ $css--body: true !default;
18
18
  /// @group config
19
19
  $css--font-face: true !default;
20
20
 
21
- /// If true, emit the custom type properties in in :root
21
+ /// If true, emit the custom type properties in :root
22
22
  /// @access public
23
23
  /// @type Bool
24
24
  /// @group config
25
- $css--emit-type-custom-props: true !default;
25
+ $css--emit-type-custom-props: false !default;
26
26
 
27
27
  /// If true, include reset CSS
28
28
  /// @access public
@@ -13,6 +13,7 @@
13
13
  'enable-experimental-tile-contrast': false,
14
14
  'enable-v12-tile-radio-icons': false,
15
15
  'enable-v12-structured-list-visible-icons': false,
16
+ 'enable-dialog-element': false,
16
17
  )
17
18
  !default
18
19
  );
@@ -25,6 +25,7 @@
25
25
  @use 'data-table/skeleton';
26
26
  @use 'data-table/sort';
27
27
  @use 'date-picker';
28
+ @use 'dialog';
28
29
  @use 'dropdown';
29
30
  @use 'file-uploader';
30
31
  @use 'fluid-combo-box';
@@ -18,16 +18,14 @@
18
18
  @use '../../utilities/component-reset';
19
19
  @use '../../utilities/focus-outline' as *;
20
20
  @use '../../utilities/high-contrast-mode' as *;
21
- @use '../../utilities/z-index' as *;
22
21
 
23
22
  /// Dialog styles
24
23
  /// @access public
25
24
  /// @group dialog
26
25
  @mixin dialog {
27
26
  .#{$prefix}--dialog {
28
- /* size */
29
27
  padding: 0;
30
- border: 1px solid $border-subtle-01;
28
+ border: none;
31
29
  background-color: $layer;
32
30
  color: $text-primary;
33
31
  inline-size: 48rem;
@@ -101,15 +99,6 @@
101
99
  min-block-size: $spacing-09;
102
100
  }
103
101
 
104
- .#{$prefix}--dialog__content {
105
- padding: $spacing-05;
106
- block-size: 100%;
107
- }
108
-
109
- .#{$prefix}--dialog--modal {
110
- border: 1px solid transparent;
111
- }
112
-
113
102
  /* Transition the :backdrop when the dialog modal is promoted to the top layer */
114
103
  .#{$prefix}--dialog::backdrop {
115
104
  background-color: $overlay;
@@ -98,14 +98,6 @@
98
98
  }
99
99
  }
100
100
 
101
- .#{$prefix}--menu-item__icon {
102
- display: none;
103
- }
104
-
105
- .#{$prefix}--menu--with-icons .#{$prefix}--menu-item__icon {
106
- display: flex;
107
- }
108
-
109
101
  .#{$prefix}--menu-item__label {
110
102
  overflow: hidden;
111
103
  text-overflow: ellipsis;
@@ -121,18 +113,74 @@
121
113
  @include component-reset.reset;
122
114
  }
123
115
 
116
+ .#{$prefix}--menu-item__icon,
117
+ .#{$prefix}--menu-item__selection-icon {
118
+ display: none;
119
+ }
120
+
124
121
  .#{$prefix}--menu--with-icons > .#{$prefix}--menu-item,
125
122
  .#{$prefix}--menu--with-icons
126
123
  > .#{$prefix}--menu-item-group
127
124
  > ul
128
125
  > .#{$prefix}--menu-item,
129
126
  .#{$prefix}--menu--with-icons
127
+ > .#{$prefix}--menu-item-radio-group
128
+ > ul
129
+ > .#{$prefix}--menu-item,
130
+ .#{$prefix}--menu--with-selectable-items > .#{$prefix}--menu-item,
131
+ .#{$prefix}--menu--with-selectable-items
132
+ > .#{$prefix}--menu-item-group
133
+ > ul
134
+ > .#{$prefix}--menu-item,
135
+ .#{$prefix}--menu--with-selectable-items
130
136
  > .#{$prefix}--menu-item-radio-group
131
137
  > ul
132
138
  > .#{$prefix}--menu-item {
133
139
  grid-template-columns: 1rem 1fr max-content;
134
140
  }
135
141
 
142
+ .#{$prefix}--menu--with-icons
143
+ > .#{$prefix}--menu-item
144
+ > .#{$prefix}--menu-item__icon,
145
+ .#{$prefix}--menu--with-icons
146
+ > .#{$prefix}--menu-item-group
147
+ > ul
148
+ > .#{$prefix}--menu-item
149
+ > .#{$prefix}--menu-item__icon,
150
+ .#{$prefix}--menu--with-icons
151
+ > .#{$prefix}--menu-item-radio-group
152
+ > ul
153
+ > .#{$prefix}--menu-item
154
+ > .#{$prefix}--menu-item__icon,
155
+ .#{$prefix}--menu--with-selectable-items
156
+ > .#{$prefix}--menu-item
157
+ > .#{$prefix}--menu-item__selection-icon,
158
+ .#{$prefix}--menu--with-selectable-items
159
+ > .#{$prefix}--menu-item-group
160
+ > ul
161
+ > .#{$prefix}--menu-item
162
+ > .#{$prefix}--menu-item__selection-icon,
163
+ .#{$prefix}--menu--with-selectable-items
164
+ > .#{$prefix}--menu-item-radio-group
165
+ > ul
166
+ > .#{$prefix}--menu-item
167
+ > .#{$prefix}--menu-item__selection-icon {
168
+ display: flex;
169
+ }
170
+
171
+ .#{$prefix}--menu--with-icons.#{$prefix}--menu--with-selectable-items
172
+ > .#{$prefix}--menu-item,
173
+ .#{$prefix}--menu--with-icons.#{$prefix}--menu--with-selectable-items
174
+ > .#{$prefix}--menu-item-group
175
+ > ul
176
+ > .#{$prefix}--menu-item,
177
+ .#{$prefix}--menu--with-icons.#{$prefix}--menu--with-selectable-items
178
+ > .#{$prefix}--menu-item-radio-group
179
+ > ul
180
+ > .#{$prefix}--menu-item {
181
+ grid-template-columns: 1rem 1rem 1fr max-content;
182
+ }
183
+
136
184
  .#{$prefix}--menu-item--disabled {
137
185
  color: $text-disabled;
138
186
  cursor: not-allowed;
@@ -30,19 +30,4 @@
30
30
  .#{$prefix}--menu-button__trigger--open svg {
31
31
  transform: rotate(180deg);
32
32
  }
33
-
34
- // Menu alignment classes
35
- $popover-offset: custom-property.get-var('popover-offset', 3rem);
36
-
37
- .#{$prefix}--menu-button__top {
38
- transform: translate(0, calc(-100% - $popover-offset));
39
- }
40
-
41
- .#{$prefix}--menu-button__top-start {
42
- transform: translate(0, calc(-100% - $popover-offset));
43
- }
44
-
45
- .#{$prefix}--menu-button__top-end {
46
- transform: translate(0, calc(-100% - $popover-offset));
47
- }
48
33
  }
@@ -7,6 +7,7 @@
7
7
 
8
8
  @use '../button';
9
9
  @use '../../config' as *;
10
+ @use '../../feature-flags' as *;
10
11
  @use '../../breakpoint' as *;
11
12
  @use '../../motion' as *;
12
13
  @use '../../spacing' as *;
@@ -23,34 +24,57 @@
23
24
  /// Modal styles
24
25
  /// @access public
25
26
  /// @group modal
26
- @mixin modal {
27
+ @mixin modal(
28
+ $enable-experimental-focus-wrap-without-sentinels: false,
29
+ $enable-dialog-element: false
30
+ ) {
27
31
  .#{$prefix}--modal {
28
- position: fixed;
29
- z-index: z('modal');
30
- display: flex;
31
- align-items: center;
32
- justify-content: center;
33
- background-color: $overlay;
34
- block-size: 100vh;
35
- content: '';
36
- inline-size: 100vw;
37
- inset-block-start: 0;
38
- inset-inline-start: 0;
39
- opacity: 0;
40
- transition:
41
- opacity $duration-moderate-02 motion(exit, expressive),
42
- visibility 0ms linear $duration-moderate-02;
43
- visibility: hidden;
44
-
45
- &.is-visible {
46
- opacity: 1;
32
+ // For modals using the native dialog element, the modal visibility is handled
33
+ // by the Dialog styles.
34
+ @if not(
35
+ enabled('enable-experimental-focus-wrap-without-sentinels') or
36
+ $enable-experimental-focus-wrap-without-sentinels or
37
+ enabled('enable-dialog-element') or
38
+ $enable-dialog-element
39
+ )
40
+ {
41
+ position: fixed;
42
+ z-index: z('modal');
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ background-color: $overlay;
47
+ block-size: 100vh;
48
+ content: '';
49
+ inline-size: 100vw;
50
+ inset-block-start: 0;
51
+ inset-inline-start: 0;
52
+ opacity: 0;
47
53
  transition:
48
- opacity $duration-moderate-02 motion(entrance, expressive),
49
- visibility 0ms linear;
50
- visibility: inherit;
54
+ opacity $duration-moderate-02 motion(exit, expressive),
55
+ visibility 0ms linear $duration-moderate-02;
56
+ visibility: hidden;
57
+ }
51
58
 
52
- @media screen and (prefers-reduced-motion: reduce) {
53
- transition: none;
59
+ // For modals using the native dialog element, the modal visibility is handled
60
+ // by the Dialog styles.
61
+ @if not(
62
+ enabled('enable-experimental-focus-wrap-without-sentinels') or
63
+ $enable-experimental-focus-wrap-without-sentinels or
64
+ enabled('enable-dialog-element') or
65
+ $enable-dialog-element
66
+ )
67
+ {
68
+ &.is-visible {
69
+ opacity: 1;
70
+ transition:
71
+ opacity $duration-moderate-02 motion(entrance, expressive),
72
+ visibility 0ms linear;
73
+ visibility: inherit;
74
+
75
+ @media screen and (prefers-reduced-motion: reduce) {
76
+ transition: none;
77
+ }
54
78
  }
55
79
  }
56
80