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

Clean up the reset code for button's rounded corners in button group and input button #24696

Closed
wants to merge 5 commits into from
Closed
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
66 changes: 13 additions & 53 deletions scss/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,46 +44,24 @@
}

.btn-group {
> .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}

// Set corners individual because sometimes a single button can be in a .btn-group
// and we need :first-child and :last-child to both match
> .btn:first-child {
margin-left: 0;

&:not(:last-child):not(.dropdown-toggle) {
@include border-right-radius(0);
}
}


// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu
// immediately after it
> .btn:last-child:not(:first-child),
> .dropdown-toggle:not(:first-child) {
@include border-left-radius(0);
}

// Custom edits for including btn-groups within btn-groups (useful for including
// Alignment for including btn-groups within btn-groups (useful for including
// dropdown buttons within a btn-group)
> .btn-group {
float: left;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need this float here? What is it for?

}

> .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}

> .btn-group:first-child:not(:last-child) {
> .btn:last-child,
> .dropdown-toggle {
@include border-right-radius(0);
}
// Reset rounded corners
> .btn:not(:last-child):not(.dropdown-toggle),
> .btn-group:not(:last-child) > .btn {
@include border-right-radius(0);
}

> .btn-group:last-child:not(:first-child) > .btn:first-child {
> .btn:not(:first-child),
> .btn-group:not(:first-child) > .btn {
@include border-left-radius(0);
}
}
Expand Down Expand Up @@ -154,32 +132,14 @@
margin-left: 0;
}

> .btn {
&:not(:first-child):not(:last-child) {
border-radius: 0;
}

&:first-child:not(:last-child) {
@include border-bottom-radius(0);
}

&:last-child:not(:first-child) {
@include border-top-radius(0);
}
}

> .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}

> .btn-group:first-child:not(:last-child) {
> .btn:last-child,
> .dropdown-toggle {
@include border-bottom-radius(0);
}
// Reset rounded corners
> .btn:not(:last-child):not(.dropdown-toggle),
> .btn-group:not(:last-child) > .btn {
@include border-bottom-radius(0);
}

> .btn-group:last-child:not(:first-child) > .btn:first-child {
> .btn:not(:first-child),
> .btn-group:not(:first-child) > .btn {
@include border-top-radius(0);
}
}
Expand Down
6 changes: 0 additions & 6 deletions scss/_input-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
.input-group .custom-file {
display: flex;
align-items: center;

&:not(:first-child):not(:last-child) {
@include border-radius(0);
}
}

.input-group .custom-file {
Expand Down Expand Up @@ -120,7 +116,6 @@
.input-group-addon:not(:last-child),
.input-group-btn:not(:last-child) > .btn,
.input-group-btn:not(:last-child) > .btn-group > .btn,
.input-group-btn:not(:last-child) > .dropdown-toggle,
.input-group-btn:not(:first-child) > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:not(:first-child) > .btn-group:not(:last-child) > .btn {
@include border-right-radius(0);
Expand All @@ -136,7 +131,6 @@
.input-group-addon:not(:first-child),
.input-group-btn:not(:first-child) > .btn,
.input-group-btn:not(:first-child) > .btn-group > .btn,
.input-group-btn:not(:first-child) > .dropdown-toggle,
.input-group-btn:not(:last-child) > .btn:not(:first-child),
.input-group-btn:not(:last-child) > .btn-group:not(:first-child) > .btn {
@include border-left-radius(0);
Expand Down