@carbon/styles 1.75.0-rc.0 → 1.76.0-rc.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.
@@ -33,12 +33,14 @@ describe('@carbon/styles/scss/config', () => {
33
33
  $css--font-face: false,
34
34
  $css--reset: false,
35
35
  $css--default-type: false,
36
+ $css--emit-type-custom-props: false
36
37
  );
37
38
 
38
39
  $_: get('config', (
39
40
  css--default-type: config.$css--default-type,
40
41
  css--font-face: config.$css--font-face,
41
42
  css--reset: config.$css--reset,
43
+ css--emit-type-custom-props: config.$css--emit-type-custom-props,
42
44
  prefix: config.$prefix,
43
45
  ));
44
46
  `);
@@ -47,6 +49,7 @@ describe('@carbon/styles/scss/config', () => {
47
49
  'css--default-type': false,
48
50
  'css--font-face': false,
49
51
  'css--reset': false,
52
+ 'css--emit-type-custom-props': false,
50
53
  prefix: 'test',
51
54
  });
52
55
  });
@@ -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.value).toEqual(
134
- expect.stringContaining('var(--custom-')
133
+ expect(declaration.property).toEqual(
134
+ expect.stringContaining('--custom-')
135
135
  );
136
136
  }
137
137
  });
@@ -150,3 +150,22 @@ describe('@carbon/styles/scss/type', () => {
150
150
  expect(stylesheet).toMatchSnapshot();
151
151
  });
152
152
  });
153
+
154
+ describe('type custom properties', () => {
155
+ it('should emit the css Custom properties for non-fluid typography', async () => {
156
+ const { result } = await render(`
157
+ @use '../scss/type' as *;
158
+
159
+ .selector {
160
+ @include emit-type-custom-properties()
161
+ }
162
+ `);
163
+ const { stylesheet } = css.parse(result.css.toString());
164
+ const rules = stylesheet.rules.filter(
165
+ (rule) => rule.selectors[0] === '.selector'
166
+ );
167
+ const declarations = rules[0].declarations;
168
+
169
+ expect(declarations.length).toBe(191);
170
+ });
171
+ });
package/scss/_config.scss CHANGED
@@ -18,6 +18,12 @@ $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
22
+ /// @access public
23
+ /// @type Bool
24
+ /// @group config
25
+ $css--emit-type-custom-props: true !default;
26
+
21
27
  /// If true, include reset CSS
22
28
  /// @access public
23
29
  /// @type Bool
@@ -42,9 +42,21 @@
42
42
  align-items: center;
43
43
  margin: 0;
44
44
  block-size: convert.to-rem(16px);
45
- inline-size: auto;
46
45
  inset-block-start: convert.to-rem(13px);
47
- inset-inline-start: $spacing-05;
46
+
47
+ // For the main label
48
+ &:not(.#{$prefix}--text-area__label-counter) {
49
+ inline-size: auto;
50
+ inset-inline-end: auto;
51
+ inset-inline-start: $spacing-05;
52
+ }
53
+
54
+ // For the counter
55
+ &.#{$prefix}--text-area__label-counter {
56
+ inline-size: auto;
57
+ inset-inline-end: $spacing-05;
58
+ inset-inline-start: auto;
59
+ }
48
60
  }
49
61
 
50
62
  .#{$prefix}--text-area--fluid .#{$prefix}--label::-webkit-scrollbar,
@@ -33,9 +33,21 @@
33
33
  align-items: center;
34
34
  margin: 0;
35
35
  block-size: convert.to-rem(16px);
36
- inline-size: calc(100% - 2rem);
37
36
  inset-block-start: convert.to-rem(13px);
38
- inset-inline-start: $spacing-05;
37
+
38
+ // For the main label
39
+ &:not(.#{$prefix}--text-input__label-counter) {
40
+ inline-size: auto;
41
+ inset-inline-end: auto;
42
+ inset-inline-start: $spacing-05;
43
+ }
44
+
45
+ // For the counter
46
+ &.#{$prefix}--text-input__label-counter {
47
+ inline-size: auto;
48
+ inset-inline-end: $spacing-05;
49
+ inset-inline-start: auto;
50
+ }
39
51
  }
40
52
 
41
53
  .#{$prefix}--text-input--fluid .#{$prefix}--label::-webkit-scrollbar,
@@ -522,6 +522,8 @@
522
522
  //-----------------------------
523
523
  // Icon Item
524
524
  //-----------------------------
525
+ &.#{$prefix}--tabs__icon--default,
526
+ &.#{$prefix}--tabs__icon--lg,
525
527
  &.#{$prefix}--tabs__icon--default .#{$prefix}--tab--list,
526
528
  &.#{$prefix}--tabs__icon--lg .#{$prefix}--tab--list {
527
529
  overflow-x: visible;
@@ -235,6 +235,7 @@
235
235
  }
236
236
 
237
237
  .#{$prefix}--text-area__label-wrapper {
238
+ position: relative;
238
239
  display: flex;
239
240
  justify-content: space-between;
240
241
  inline-size: 100%;
@@ -534,9 +534,5 @@
534
534
  display: flex;
535
535
  justify-content: space-between;
536
536
  inline-size: 100%;
537
-
538
- .#{$prefix}--text-input__label-counter {
539
- align-self: end;
540
- }
541
537
  }
542
538
  }
@@ -88,6 +88,25 @@
88
88
  cursor: not-allowed;
89
89
  }
90
90
 
91
+ // Overrides link styling
92
+ li a.#{$prefix}--tree-node {
93
+ text-decoration: none;
94
+
95
+ &:not(.cds--tree-node--disabled) {
96
+ color: $text-secondary;
97
+ }
98
+ }
99
+
100
+ li.#{$prefix}--tree-node-link-parent {
101
+ display: flex;
102
+ flex-direction: column;
103
+ background-color: $layer-01;
104
+
105
+ > .#{$prefix}--tree-node__children {
106
+ padding-inline-start: $spacing-05;
107
+ }
108
+ }
109
+
91
110
  .#{$prefix}--tree-node__label {
92
111
  @include type-style('body-compact-01');
93
112
 
@@ -5,7 +5,10 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
+ @use '../feature-flags' as *;
8
9
  @use '../config';
10
+ @use 'sass:string';
11
+ @use 'sass:map';
9
12
 
10
13
  // prettier-ignore
11
14
  @forward '@carbon/type' show
@@ -90,3 +93,24 @@
90
93
  custom-property-prefix: config.$prefix,
91
94
  )
92
95
  );
96
+
97
+ // output type custom properties used by non-fluid type-style below
98
+ /// @access public
99
+ /// @group @carbon/type
100
+ @mixin emit-type-custom-properties() {
101
+ @each $name, $token in type.$tokens {
102
+ @if string.slice($name, 1, 5) != 'fluid' {
103
+ @each $property, $value in $token {
104
+ @if $property != 'breakpoints' {
105
+ --#{config.$prefix}-#{$name}-#{$property}: #{$value};
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+
112
+ @if config.$css--emit-type-custom-props == true {
113
+ :root {
114
+ @include emit-type-custom-properties();
115
+ }
116
+ }