|
11 | 11 | * governing permissions and limitations under the License.
|
12 | 12 | */
|
13 | 13 |
|
14 |
| -/* @todo align modifiers to use field-label or fieldlabel but not both */ |
15 |
| - |
16 | 14 | .spectrum-FieldLabel {
|
17 |
| - --spectrum-field-label-min-height: var(--spectrum-component-height-75); |
18 |
| - --spectrum-field-label-top-to-text: var(--spectrum-component-top-to-text-75); |
19 |
| - --spectrum-field-label-bottom-to-text: var(--spectrum-component-bottom-to-text-75); |
20 |
| - --spectrum-field-label-font-size: var(--spectrum-font-size-75); |
| 15 | + --spectrum-fieldlabel-min-height: var(--spectrum-component-height-100); |
| 16 | + --spectrum-fieldlabel-color: var(--spectrum-neutral-subdued-content-color-default); |
| 17 | + |
| 18 | + --spectrum-fieldlabel-top-to-text: var(--spectrum-component-top-to-text-100); |
| 19 | + --spectrum-fieldlabel-bottom-to-text: var(--spectrum-component-bottom-to-text-100); |
| 20 | + --spectrum-fieldlabel-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-medium); |
21 | 21 |
|
22 |
| - --spectrum-field-label-side-margin-block-start: var(--spectrum-field-label-top-margin-medium); |
23 |
| - --spectrum-field-label-side-padding-right: var(--spectrum-spacing-200); |
| 22 | + --spectrum-fieldlabel-font-size: var(--spectrum-font-size-100); |
| 23 | + --spectrum-fieldlabel-font-weight: var(--spectrum-regular-font-weight); |
| 24 | + --spectrum-fieldlabel-line-height: var(--spectrum-line-height-100); |
24 | 25 |
|
25 |
| - --spectrum-field-label-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-medium); |
| 26 | + --spectrum-fieldlabel-side-margin-block-start: var(--spectrum-field-label-top-margin-medium); |
| 27 | + --spectrum-fieldlabel-side-padding-right: var(--spectrum-spacing-200); |
26 | 28 | }
|
27 | 29 |
|
28 | 30 | .spectrum-FieldLabel--sizeS {
|
29 |
| - --spectrum-field-label-min-height: var(--spectrum-component-height-75); |
30 |
| - --spectrum-field-label-top-to-text: var(--spectrum-component-top-to-text-75); |
31 |
| - --spectrum-field-label-bottom-to-text: var(--spectrum-component-bottom-to-text-75); |
32 |
| - --spectrum-field-label-font-size: var(--spectrum-font-size-75); |
| 31 | + --spectrum-fieldlabel-min-height: var(--spectrum-component-height-75); |
| 32 | + --spectrum-fieldlabel-top-to-text: var(--spectrum-component-top-to-text-75); |
| 33 | + --spectrum-fieldlabel-bottom-to-text: var(--spectrum-component-bottom-to-text-75); |
| 34 | + --spectrum-fieldlabel-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-small); |
33 | 35 |
|
34 |
| - --spectrum-field-label-side-margin-block-start: var(--spectrum-field-label-top-margin-small); |
35 |
| - --spectrum-field-label-side-padding-right: var(--spectrum-spacing-100); |
| 36 | + --spectrum-fieldlabel-font-size: var(--spectrum-font-size-75); |
36 | 37 |
|
37 |
| - --spectrum-field-label-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-small); |
| 38 | + --spectrum-fieldlabel-side-margin-block-start: var(--spectrum-field-label-top-margin-small); |
| 39 | + --spectrum-fieldlabel-side-padding-right: var(--spectrum-spacing-100); |
38 | 40 | }
|
39 | 41 |
|
40 | 42 | .spectrum-FieldLabel--sizeL {
|
41 |
| - --spectrum-field-label-min-height: var(--spectrum-component-height-100); |
42 |
| - --spectrum-field-label-top-to-text: var(--spectrum-component-top-to-text-100); |
43 |
| - --spectrum-field-label-bottom-to-text: var(--spectrum-component-bottom-to-text-100); |
44 |
| - --spectrum-field-label-font-size: var(--spectrum-font-size-100); |
| 43 | + --spectrum-fieldlabel-min-height: var(--spectrum-component-height-200); |
| 44 | + --spectrum-fieldlabel-top-to-text: var(--spectrum-component-top-to-text-200); |
| 45 | + --spectrum-fieldlabel-bottom-to-text: var(--spectrum-component-bottom-to-text-200); |
| 46 | + --spectrum-fieldlabel-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-large); |
45 | 47 |
|
46 |
| - --spectrum-field-label-side-margin-block-start: var(--spectrum-field-label-top-margin-large); |
47 |
| - --spectrum-field-label-side-padding-right: var(--spectrum-spacing-200); |
| 48 | + --spectrum-fieldlabel-font-size: var(--spectrum-font-size-200); |
48 | 49 |
|
49 |
| - --spectrum-field-label-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-large); |
| 50 | + --spectrum-fieldlabel-side-margin-block-start: var(--spectrum-field-label-top-margin-large); |
| 51 | + --spectrum-fieldlabel-side-padding-right: var(--spectrum-spacing-200); |
50 | 52 | }
|
51 | 53 |
|
52 | 54 | .spectrum-FieldLabel--sizeXL {
|
53 |
| - --spectrum-field-label-min-height: var(--spectrum-component-height-200); |
54 |
| - --spectrum-field-label-top-to-text: var(--spectrum-component-top-to-text-200); |
55 |
| - --spectrum-field-label-bottom-to-text: var(--spectrum-component-bottom-to-text-200); |
56 |
| - --spectrum-field-label-font-size: var(--spectrum-font-size-200); |
| 55 | + --spectrum-fieldlabel-min-height: var(--spectrum-component-height-300); |
| 56 | + --spectrum-fieldlabel-top-to-text: var(--spectrum-component-top-to-text-300); |
| 57 | + --spectrum-fieldlabel-bottom-to-text: var(--spectrum-component-bottom-to-text-300); |
| 58 | + --spectrum-fieldlabel-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-extra-large); |
57 | 59 |
|
58 |
| - --spectrum-field-label-side-margin-block-start: var(--spectrum-field-label-top-margin-extra-large); |
59 |
| - --spectrum-field-label-side-padding-right: var(--spectrum-spacing-200); |
| 60 | + --spectrum-fieldlabel-font-size: var(--spectrum-font-size-300); |
| 61 | + |
| 62 | + --spectrum-fieldlabel-side-margin-block-start: var(--spectrum-field-label-top-margin-extra-large); |
| 63 | + --spectrum-fieldlabel-side-padding-right: var(--spectrum-spacing-200); |
| 64 | +} |
60 | 65 |
|
61 |
| - --spectrum-field-label-text-to-asterisk: var(--spectrum-field-label-text-to-asterisk-extra-large); |
| 66 | +.spectrum-FieldLabel--staticBlack { |
| 67 | + --spectrum-fieldlabel-color: var(--spectrum-black); |
| 68 | +} |
| 69 | + |
| 70 | +.spectrum-FieldLabel--staticWhite { |
| 71 | + --spectrum-fieldlabel-color: var(--spectrum-white); |
62 | 72 | }
|
63 | 73 |
|
64 | 74 | .spectrum-FieldLabel {
|
65 | 75 | display: block;
|
66 | 76 | box-sizing: border-box;
|
67 |
| - min-block-size: var(--mod-fieldlabel-min-height, var(--spectrum-field-label-min-height)); |
| 77 | + min-block-size: var(--mod-fieldlabel-min-height, var(--spectrum-fieldlabel-min-height)); |
68 | 78 |
|
69 |
| - padding-block: var(--mod-fieldlabel-padding-block, var(--mod-field-label-top-to-text, var(--spectrum-field-label-top-to-text)) var(--mod-field-label-bottom-to-text, var(--spectrum-field-label-bottom-to-text))); |
| 79 | + padding-block: var(--mod-fieldlabel-top-to-text, var(--spectrum-fieldlabel-top-to-text)) var(--mod-fieldlabel-bottom-to-text, var(--spectrum-fieldlabel-bottom-to-text)); |
70 | 80 | padding-inline: var(--mod-fieldlabel-padding-inline, 0);
|
71 |
| - margin-block: var(--mod-fieldlabel-margin-block, var(--mod-fieldlabel-margin-block-start, 0) var(--mod-fieldlabel-margin-block-end, 0)); |
72 |
| - margin-inline: var(--mod-fieldlabel-margin-inline, var(--mod-fieldlabel-margin-inline-start, 0) var(--mod-fieldlabel-margin-inline-end, 0)); |
73 | 81 |
|
74 |
| - font-size: var(--mod-fieldlabel-font-size, var(--spectrum-field-label-font-size)); |
75 |
| - font-weight: var(--mod-fieldlabel-font-weight, var(--spectrum-regular-font-weight)); |
| 82 | + font-size: var(--mod-fieldlabel-font-size, var(--spectrum-fieldlabel-font-size)); |
| 83 | + font-weight: var(--mod-fieldlabel-font-weight, var(--spectrum-fieldlabel-font-weight)); |
76 | 84 |
|
77 |
| - line-height: var(--mod-fieldlabel-line-height, var(--spectrum-line-height-100)); |
| 85 | + line-height: var(--mod-fieldlabel-line-height, var(--spectrum-fieldlabel-line-height)); |
78 | 86 |
|
79 | 87 | -webkit-font-smoothing: subpixel-antialiased;
|
80 | 88 | -moz-osx-font-smoothing: auto;
|
81 | 89 |
|
82 |
| - color: var(--highcontrast-field-label-content-color, var(--mod-fieldlabel-color, var(--spectrum-neutral-subdued-content-color-default))); |
| 90 | + color: var(--spectrum-fieldlabel-color); |
83 | 91 |
|
84 | 92 | /* CJK (Chinese, Japanese, and Korean) language support */
|
85 | 93 | &:lang(ja),
|
|
90 | 98 |
|
91 | 99 | /********* Disabled state *********/
|
92 | 100 | &.is-disabled {
|
93 |
| - --mod-fieldlabel-color: var(--mod-disabled-content-color, var(--spectrum-disabled-content-color)); |
| 101 | + --spectrum-fieldlabel-color: var(--highcontrast-fieldlabel-disabled-content-color, var(--spectrum-disabled-content-color)); |
94 | 102 | }
|
95 | 103 | }
|
96 | 104 |
|
97 | 105 | .spectrum-FieldLabel-requiredIcon {
|
98 | 106 | color: inherit;
|
99 | 107 | margin-block: 0;
|
100 |
| - margin-inline: var(--mod-field-label-text-to-asterisk, var(--spectrum-field-label-text-to-asterisk)) 0; |
101 |
| - vertical-align: var(--mod-field-label-asterisk-vertical-align, baseline); |
| 108 | + margin-inline: var(--mod-fieldlabel-text-to-asterisk, var(--spectrum-fieldlabel-text-to-asterisk)) 0; |
| 109 | + vertical-align: var(--mod-fieldlabel-asterisk-vertical-align, baseline); |
102 | 110 | }
|
103 | 111 |
|
104 | 112 | .spectrum-FieldLabel--left,
|
105 | 113 | .spectrum-FieldLabel--right {
|
106 | 114 | display: inline-block;
|
107 | 115 |
|
108 |
| - margin-block-start: var(--mod-fieldlabel-side-margin-block-start, var(--spectrum-field-label-side-margin-block-start)); |
| 116 | + margin-block-start: var(--mod-fieldlabel-side-margin-block-start, var(--spectrum-fieldlabel-side-margin-block-start)); |
109 | 117 | margin-block-end: 0;
|
110 |
| - margin-inline-end: var(--mod-fieldlabel-side-padding-right, var(--spectrum-field-label-side-padding-right)); |
| 118 | + margin-inline-end: var(--mod-fieldlabel-side-padding-right, var(--spectrum-fieldlabel-side-padding-right)); |
111 | 119 |
|
112 | 120 | vertical-align: top;
|
113 | 121 | }
|
|
116 | 124 | text-align: end;
|
117 | 125 | }
|
118 | 126 |
|
| 127 | +/********* Form *********/ |
| 128 | +.spectrum-Form { |
| 129 | + --spectrum-tableform-item-block-spacing: var(--spectrum-spacing-300); |
| 130 | + |
| 131 | + display: grid; |
| 132 | + grid-template-columns: var(--mod-form-grid-template-columns, auto auto); |
| 133 | + row-gap: var(--mod-form-item-block-spacing, var(--spectrum-tableform-item-block-spacing)); |
| 134 | + justify-content: start; |
| 135 | + |
| 136 | + inline-size: var(--mod-form-inline-size, fit-content); |
| 137 | + margin: 0; |
| 138 | +} |
| 139 | + |
| 140 | +/* Row */ |
| 141 | +.spectrum-Form-item { |
| 142 | + display: contents; |
| 143 | +} |
| 144 | + |
| 145 | +@supports (grid-template-columns: subgrid) { |
| 146 | + .spectrum-Form-item { |
| 147 | + display: grid; |
| 148 | + grid-column: span 2; |
| 149 | + grid-template-columns: subgrid; |
| 150 | + } |
| 151 | +} |
| 152 | + |
| 153 | +.spectrum-Form-itemLabel, |
| 154 | +.spectrum-Form-itemField { |
| 155 | + display: block; |
| 156 | +} |
| 157 | + |
| 158 | +/* Fix extra space after inline-flex elements such as stepper. */ |
| 159 | +.spectrum-Form-itemField > * { |
| 160 | + vertical-align: top; |
| 161 | +} |
| 162 | + |
| 163 | +/* Rows with stacked alignment */ |
| 164 | +.spectrum-Form--labelsAbove { |
| 165 | + --mod-form-item-block-spacing: var(--mod-form-item-block-spacing-labels-above, var(--spectrum-spacing-200)); |
| 166 | + --mod-form-grid-template-columns: var(--mod-form-grid-template-columns-labels-above, auto); |
| 167 | + |
| 168 | + .spectrum-Form-item { |
| 169 | + display: block; |
| 170 | + } |
| 171 | +} |
| 172 | + |
119 | 173 | /********* WHCM *********/
|
120 | 174 | @media (forced-colors: active) {
|
121 |
| - .spectrum-FieldLabel.is-disabled { |
122 |
| - --highcontrast-field-label-content-color: GrayText; |
| 175 | + .spectrum-FieldLabel { |
| 176 | + --highcontrast-fieldlabel-disabled-content-color: GrayText; |
123 | 177 | }
|
124 | 178 | }
|
0 commit comments