Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds date input example and adjusts baseline appearance #2116

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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