Skip to content

Commit

Permalink
Merge pull request #567 from stp-ip/bootstrap
Browse files Browse the repository at this point in the history
Upgrade bootstrap to v4.3.1
  • Loading branch information
stp-ip authored May 21, 2019
2 parents eb5adcb + 930d744 commit 3843744
Show file tree
Hide file tree
Showing 70 changed files with 1,466 additions and 683 deletions.
2 changes: 1 addition & 1 deletion assets/styles/bootstrap/_alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Expand the right padding and account for the close button's positioning.

.alert-dismissible {
padding-right: ($close-font-size + $alert-padding-x * 2);
padding-right: $close-font-size + $alert-padding-x * 2;

// Adjust close link position
.close {
Expand Down
9 changes: 8 additions & 1 deletion assets/styles/bootstrap/_badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@
.badge {
display: inline-block;
padding: $badge-padding-y $badge-padding-x;
font-size: $badge-font-size;
@include font-size($badge-font-size);
font-weight: $badge-font-weight;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
@include border-radius($badge-border-radius);
@include transition($badge-transition);

@at-root a#{&} {
@include hover-focus {
text-decoration: none;
}
}

// Empty badges collapse automatically
&:empty {
Expand Down
27 changes: 9 additions & 18 deletions assets/styles/bootstrap/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

> .btn {
position: relative;
flex: 0 1 auto;
flex: 1 1 auto;

// Bring the hover, focused, and "active" buttons to the front to overlay
// the borders properly
Expand All @@ -22,14 +22,6 @@
z-index: 1;
}
}

// Prevent double borders when buttons are next to each other
.btn + .btn,
.btn + .btn-group,
.btn-group + .btn,
.btn-group + .btn-group {
margin-left: -$btn-border-width;
}
}

// Optional: Group multiple button groups together for a toolbar
Expand All @@ -44,8 +36,10 @@
}

.btn-group {
> .btn:first-child {
margin-left: 0;
// Prevent double borders when buttons are next to each other
> .btn:not(:first-child),
> .btn-group:not(:first-child) {
margin-left: -$btn-border-width;
}

// Reset rounded corners
Expand Down Expand Up @@ -119,17 +113,14 @@
align-items: flex-start;
justify-content: center;

.btn,
.btn-group {
> .btn,
> .btn-group {
width: 100%;
}

> .btn + .btn,
> .btn + .btn-group,
> .btn-group + .btn,
> .btn-group + .btn-group {
> .btn:not(:first-child),
> .btn-group:not(:first-child) {
margin-top: -$btn-border-width;
margin-left: 0;
}

// Reset rounded corners
Expand Down
24 changes: 9 additions & 15 deletions assets/styles/bootstrap/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@

.btn {
display: inline-block;
font-family: $btn-font-family;
font-weight: $btn-font-weight;
color: $body-color;
text-align: center;
white-space: nowrap;
vertical-align: middle;
user-select: none;
background-color: transparent;
border: $btn-border-width solid transparent;
@include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-line-height, $btn-border-radius);
@include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-line-height, $btn-border-radius);
@include transition($btn-transition);

// Share hover and focus styles
@include hover-focus {
@include hover {
color: $body-color;
text-decoration: none;
}

Expand All @@ -33,11 +35,6 @@
@include box-shadow(none);
}

// Opinionated: add "hand" cursor to non-disabled .btn elements
&:not(:disabled):not(.disabled) {
cursor: pointer;
}

&:not(:disabled):not(.disabled):active,
&:not(:disabled):not(.disabled).active {
@include box-shadow($btn-active-box-shadow);
Expand Down Expand Up @@ -80,19 +77,16 @@ fieldset:disabled a.btn {
.btn-link {
font-weight: $font-weight-normal;
color: $link-color;
background-color: transparent;
text-decoration: $link-decoration;

@include hover {
color: $link-hover-color;
text-decoration: $link-hover-decoration;
background-color: transparent;
border-color: transparent;
}

&:focus,
&.focus {
text-decoration: $link-hover-decoration;
border-color: transparent;
box-shadow: none;
}

Expand All @@ -111,11 +105,11 @@ fieldset:disabled a.btn {
//

.btn-lg {
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
}

.btn-sm {
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
}


Expand Down
84 changes: 36 additions & 48 deletions assets/styles/bootstrap/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
min-width: 0; // See https://github.com/twbs/bootstrap/pull/22740#issuecomment-305868106
word-wrap: break-word;
background-color: $card-bg;
background-clip: border-box;
Expand Down Expand Up @@ -36,14 +36,15 @@
// as much space as possible, ensuring footers are aligned to the bottom.
flex: 1 1 auto;
padding: $card-spacer-x;
color: $card-color;
}

.card-title {
margin-bottom: $card-spacer-y;
}

.card-subtitle {
margin-top: -($card-spacer-y / 2);
margin-top: -$card-spacer-y / 2;
margin-bottom: 0;
}

Expand All @@ -68,6 +69,7 @@
.card-header {
padding: $card-spacer-y $card-spacer-x;
margin-bottom: 0; // Removes the default margin-bottom of <hN>
color: $card-cap-color;
background-color: $card-cap-bg;
border-bottom: $card-border-width solid $card-border-color;

Expand Down Expand Up @@ -98,15 +100,15 @@
//

.card-header-tabs {
margin-right: -($card-spacer-x / 2);
margin-right: -$card-spacer-x / 2;
margin-bottom: -$card-spacer-y;
margin-left: -($card-spacer-x / 2);
margin-left: -$card-spacer-x / 2;
border-bottom: 0;
}

.card-header-pills {
margin-right: -($card-spacer-x / 2);
margin-left: -($card-spacer-x / 2);
margin-right: -$card-spacer-x / 2;
margin-left: -$card-spacer-x / 2;
}

// Card image
Expand Down Expand Up @@ -194,55 +196,35 @@

// Handle rounded corners
@if $enable-rounded {
&:first-child {
&:not(:last-child) {
@include border-right-radius(0);

.card-img-top,
.card-header {
// stylelint-disable-next-line property-blacklist
border-top-right-radius: 0;
}
.card-img-bottom,
.card-footer {
// stylelint-disable-next-line property-blacklist
border-bottom-right-radius: 0;
}
}

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

.card-img-top,
.card-header {
// stylelint-disable-next-line property-blacklist
border-top-left-radius: 0;
}
.card-img-bottom,
.card-footer {
// stylelint-disable-next-line property-blacklist
border-bottom-left-radius: 0;
}
}

&:only-child {
@include border-radius($card-border-radius);

.card-img-top,
.card-header {
@include border-top-radius($card-border-radius);
}
.card-img-bottom,
.card-footer {
@include border-bottom-radius($card-border-radius);
}
}

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

.card-img-top,
.card-img-bottom,
.card-header,
.card-footer {
@include border-radius(0);
}
}
}
}
}
Expand Down Expand Up @@ -277,25 +259,31 @@
//

.accordion {
.card:not(:first-of-type):not(:last-of-type) {
border-bottom: 0;
border-radius: 0;
}
> .card {
overflow: hidden;

.card:not(:first-of-type) {
.card-header:first-child {
border-radius: 0;
&:not(:first-of-type) {
.card-header:first-child {
@include border-radius(0);
}

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

.card:first-of-type {
border-bottom: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
&:first-of-type {
border-bottom: 0;
@include border-bottom-radius(0);
}

.card:last-of-type {
border-top-left-radius: 0;
border-top-right-radius: 0;
&:last-of-type {
@include border-top-radius(0);
}

.card-header {
margin-bottom: -$card-border-width;
}
}
}
Loading

0 comments on commit 3843744

Please sign in to comment.