Skip to content

Commit

Permalink
Merge pull request #2121 from cfpb/ans_ios_tweak
Browse files Browse the repository at this point in the history
Tweak and consolidate date picker
  • Loading branch information
anselmbradford authored Nov 21, 2024
2 parents 824e17a + c41101f commit 4122c62
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 39 deletions.
20 changes: 13 additions & 7 deletions docs/pages/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ variation_groups:
- variations:
- variation_is_deprecated: false
variation_name: Date picker
variation_description:
Date inputs use the browser's built-in date picker, where available,
otherwise they fall back to a text input.
variation_code_snippet: |-
<div class="m-form-field">
<input class="a-text-input"
type="date"
id="datepicker-example"
placeholder="mm/dd/yyyy">
</div>
variation_group_name: Types
<input type="date" class="a-text-input" placeholder="mm/dd/yyyy">
variation_group_name: Types
- variation_is_deprecated: false
variation_name: Date picker (full-width)
variation_description:
Date inputs may use the `a-text-input--full` modifier to fill their
available space.
variation_code_snippet: |-
<input type="date" class="a-text-input a-text-input--full" placeholder="mm/dd/yyyy">
variation_group_name: Types
accessibility: >-
Inputs should always be paired with a `label` for accessibility reasons.
Expand Down
9 changes: 0 additions & 9 deletions docs/pages/text-inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,6 @@ variation_groups:
id="full-textarea-example"
placeholder="Placeholder text">Input text</textarea>
</div>
- variation_group_name: Date input
variations:
- variation_is_deprecated: false
variation_name: Date input
variation_description:
Date inputs use the browser's built-in date picker, where available,
otherwise they fall back to a text input.
variation_code_snippet: |-
<input type="date" class="a-text-input a-text-input--full" placeholder="mm/dd/yyyy" data-type="date" id="o-filterable-list-controls_from-date">
guidelines: >-
### Stylistic guidelines
Expand Down
2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/base/index.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/cfpb-design-system/dist/base/index.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/base/index.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/index.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/cfpb-design-system/dist/index.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/utilities/index.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/cfpb-design-system/dist/utilities/index.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/utilities/index.js.map

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions packages/cfpb-design-system/src/base/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ textarea {

/*
* On iOS Safari the input is collapsed till it's clicked.
* This sets the appearance to that of a textfield and then reverts the display
* to vertically align the date.
* This sets the default min width and height to what it would be if the
* appearance was a textfield.
*/
input[type='date'] {
appearance: textfield;
display: revert;
min-width: 98px;
min-height: 29px;

&.a-text-input--full {
min-width: 100%;
}
}

strong,
Expand Down

0 comments on commit 4122c62

Please sign in to comment.