You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**textfield:** windows high contrast mode ([e30149c](https://github.com/adobe/spectrum-css/commit/e30149c))
852
858
859
+
### Migration guide
860
+
861
+
#### T-shirt sizes
862
+
863
+
As of token migration, textfield now has t-shirt sizes. Medium is the default size if no size variant is applied. Icon sizes must match each t-shirt size.
864
+
865
+
#### Label
866
+
867
+
As of token migration, textfield must always have a label. Label placement is top or on the side (start).
868
+
869
+
#### Character Count
870
+
871
+
As of token migration, textfield now has an optional character count. The character count moves to the side (end) when the label position is on the side (start). This count needs to be read by a screen reader but we cannot just use a live region as that will result in an overly verbose experience Adjust the markup of the character count for optimal accessibility for each API.
872
+
873
+
#### Help Text
874
+
875
+
As of token migration, Help text is optional and has only one position below the textfield input. Help text aligns with the input in both standard and side label layouts.
876
+
877
+
#### Composition
878
+
879
+
As of spectrum tokens migration, Textfield uses grid to align the label, character count, helptext, and focus indicator in both the default and side label layouts.
880
+
881
+
Any application using Textarea Grows (Textarea input which automatically resizes vertically to accommodate content that is entered) will need to place the sizer element within the same grid area as the input and focus indicator.
##### Removal of `:valid`, `:invalid`, and `::placeholder`
917
+
918
+
Textfield no longer supports the CSS pseudo selectors [`:invalid`](https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid) and [`:value`](https://developer.mozilla.org/en-US/docs/Web/CSS/:valid).
919
+
920
+
The CSS pseudo-element [`::placeholder`](https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder) has been deprecated due to accessibility. The styling remains for backwards compatibility but it is advised to stop utilizing placeholders moving forward.
921
+
853
922
### 🐛 Bug fixes
854
923
855
924
-**stepper, textfield:** revert use of has ([c26c64f](https://github.com/adobe/spectrum-css/commit/c26c64f))
@@ -1334,6 +1403,39 @@ there, but it was missing a control for testing.
1334
1403
1335
1404
- refactor Textfield to be decorated, closes [#142](https://github.com/adobe/spectrum-css/issues/142) ([d34be59](https://github.com/adobe/spectrum-css/commit/d34be59))
1336
1405
1406
+
### Migration guide
1407
+
1408
+
Notes below apply to both text field and text area.
1409
+
1410
+
#### Composition
1411
+
1412
+
As of 3.0.0, Textfield is now composed the same way a DecoratedTextfield was previously. That is, the outer element `div.spectrum-Textfield` contains a `input.spectrum-Textfield-input`.
1413
+
1414
+
#### Icons
1415
+
1416
+
The `<svg>` element should appear before the `<input>` element.
1417
+
1418
+
#### Indicating validity and focus
1419
+
1420
+
Validity and focus must be bubbled up to the parent so adjacent siblings can be styled.
1421
+
1422
+
Thus, implementations must add the following classes in the following situations:
1423
+
1424
+
-`.spectrum-Textfield.is-focused` - when the input is focused with the mouse
1425
+
-`.spectrum-Textfield.is-keyboardFocused` - when the input is focused with the keyboard
1426
+
-`.spectrum-Textfield.is-valid` - when the input has an explicit valid state
1427
+
-`.spectrum-Textfield.is-invalid` - when the input has an explicit invalid state
1428
+
1429
+
#### Removal of `:valid`, `:invalid`, and `::placeholder`
1430
+
1431
+
Textfield no longer supports the CSS pseudo selectors [`:invalid`](https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid) and [`:value`](https://developer.mozilla.org/en-US/docs/Web/CSS/:valid).
1432
+
1433
+
Using these selectors is an anti-pattern that complicates form validation techniques by making inputs appear invalid immediately, not after use interaction. Please apply `.is-valid` and `.is-invalid` to the outer `div.spectrum-Textfield` element instead.
1434
+
1435
+
#### Variants
1436
+
1437
+
Variants must be applied to the parent element, i.e. `.spectrum-Textfield.spectrum-Textfield--quiet` or `.spectrum-Textfield.spectrum-Textfield--multiline`. The `<input>` will be styled appropriately.
1438
+
1337
1439
### 🛑 BREAKING CHANGES
1338
1440
1339
1441
- remove support for .is-focused on .spectrum-Textfield-input
0 commit comments