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

Let wide InputGroups honor the minimum input width and overflow horizontally (#522) #578

Merged
merged 1 commit into from
Dec 2, 2024
Merged
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
14 changes: 9 additions & 5 deletions src/components/InputGroup/InputGroup.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// 1. The class name is intentionally singular because it's targeted by other mixins too.
// 2. Use a block-level display mode to prevent extra white space below grouped inputs in Safari.
// 3. Prevent individual inputs from overlapping inside narrow containers.
// 4. Legends are tricky to style, let's use a `div` instead.
// 3. Let wide input groups honor the minimum input width and overflow horizontally without wrapping and distorting
// the inputs.
// 4. Prevent individual inputs from overlapping inside narrow containers.
// 5. Legends are tricky to style, let's use a `div` instead.
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset#styling_with_css

@use "../../styles/tools/form-fields/box-field-elements";
Expand All @@ -19,12 +21,12 @@
@include foundation.fieldset();
}

// 4.
// 5.
.legend {
@include accessibility.hide-text();
}

// 4.
// 5.
.label {
@include foundation.label();
}
Expand Down Expand Up @@ -63,11 +65,13 @@
.isRootLayoutVertical,
.isRootLayoutHorizontal {
@include box-field-layout.vertical();

max-width: none; // 3.
}

.isRootLayoutVertical .field,
.isRootLayoutHorizontal .field {
max-width: none; // 3.
max-width: none; // 4.
}

.isRootLayoutHorizontal {
Expand Down