Skip to content

Commit

Permalink
.form-group--stacked: fix single child
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlaki committed Jul 26, 2023
1 parent 23309f0 commit e84e61e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
7 changes: 3 additions & 4 deletions css/spruce.css
Original file line number Diff line number Diff line change
Expand Up @@ -1421,10 +1421,6 @@ legend {
.form-group--stacked {
display: flex;
}
.form-group--stacked > * {
/* stylelint-disable */
/* stylelint-enable */
}
.form-group--stacked > * + * {
border-radius: 0;
-webkit-margin-start: -1px;
Expand All @@ -1442,6 +1438,9 @@ legend {
border-end-end-radius: var(--spruce-border-radius);
border-end-start-radius: 0;
}
.form-group--stacked > *:only-child {
border-radius: var(--spruce-border-radius);
}
.form-group--stacked > *:focus {
z-index: 2;
}
Expand Down
2 changes: 1 addition & 1 deletion css/spruce.min.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion preview/pug/page/form.pug
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ block content
legend Form Group Stacked
div(class='form-group--stacked')
input(class='form-control' type='text' aria-label='First Name')
input(class='form-control' type='text' aria-label='Last Name')
div(class='form-group--stacked')
input(class='form-control' type='text' aria-label='First Name')
input(class='form-control' type='text' aria-label='Last Name')
Expand Down
8 changes: 6 additions & 2 deletions scss/form/_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
margin-inline-start: -1px;
}

/* stylelint-disable */
// stylelint-disable
&:first-child {
border-start-end-radius: 0;
border-start-start-radius: config('border-radius', $form-control);
Expand All @@ -76,7 +76,11 @@
border-end-end-radius: config('border-radius', $form-control);
border-end-start-radius: 0;
}
/* stylelint-enable */

&:only-child {
border-radius: config('border-radius', $form-control);
}
// stylelint-enable

&:focus {
z-index: 2;
Expand Down

0 comments on commit e84e61e

Please sign in to comment.