Skip to content

Commit

Permalink
Merge pull request #2116 from cfpb/ans_input_date
Browse files Browse the repository at this point in the history
Adds date input example and adjusts baseline appearance
  • Loading branch information
anselmbradford authored Nov 19, 2024
2 parents eb0ec58 + 869583a commit 576b7e6
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 23 deletions.
11 changes: 10 additions & 1 deletion docs/pages/text-inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,21 @@ variation_groups:
placeholder="Placeholder text">Input text</textarea>
- variation_is_deprecated: false
variation_name: Text area input (full width)
variation_description: |-
variation_code_snippet: |-
<div class="m-form-field">
<textarea class="a-text-input a-text-input--full"
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.

10 changes: 10 additions & 0 deletions packages/cfpb-design-system/src/base/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ textarea {
font-family: var(--font-stack);
}

/*
* 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.
*/
input[type='date'] {
appearance: textfield;
display: revert;
}

strong,
b {
font-weight: 600;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

.m-form-field {
.a-text-input--full {
box-sizing: border-box;
width: 100%;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
border: 1px solid $input-border;
background: $input-bg;
color: $input-text;
box-sizing: border-box;

&:hover,
&.hover {
Expand Down

0 comments on commit 576b7e6

Please sign in to comment.