Skip to content

Commit

Permalink
Upgrade Bourbon to 5.1.0 and fix deprecation warnings (#1973)
Browse files Browse the repository at this point in the history
- Replace uses of deprecated Bourbon helpers with raw CSS
- Add autoprefixer into the build chain to prefix the now removed helpers

This process was achieved by running through each of the deprecation warnings and using the following bash function to replace it in all files:

```
function bourbon-deprecate() {
    grep -rl "@include $1" ./frontend --exclude-dir=.git | xargs sed -i '' -E "s/@include $1[(](.*)[)]/$1: \1/g"
}
```

For some helpers, this did not result in valid CSS, so manual modifications were made.

Closes #1189 #1274
  • Loading branch information
zwass authored Jan 3, 2019
1 parent 0f99b45 commit 759a69b
Show file tree
Hide file tree
Showing 55 changed files with 410 additions and 222 deletions.
8 changes: 4 additions & 4 deletions frontend/components/AuthenticationFormWrapper/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.auth-form-wrapper {
@include display(flex);
@include flex-direction(column);
@include justify-content(center);
@include flex-grow(1);
display: flex;
flex-direction: column;
justify-content: center;
flex-grow: 1;
padding: $base 0;

&__logo {
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Footer/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.footer {
@include align-items(center);
align-items: center;
background-color: $footer-bg;
height: $footer-height;
text-align: center;
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/LoginRoutes/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.login-routes {
@include align-items(center);
@include display(flex);
@include flex-direction(column);
@include justify-content(center);
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
min-height: calc(100vh - #{$footer-height});
background-color: $white;
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/SmtpWarning/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.smtp-warning {
@include display(flex);
@include justify-content(space-between);
@include align-items(flex-start);
display: flex;
justify-content: space-between;
align-items: flex-start;
background-color: $alert;
color: $white;
padding: 15px 20px;
Expand All @@ -21,7 +21,7 @@
}

&__text {
@include flex-grow(1);
flex-grow: 1;
line-height: 20px;
}

Expand Down
10 changes: 5 additions & 5 deletions frontend/components/StackedWhiteBoxes/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
.stacked-white-boxes {
@include position(absolute, null null null 50%);
@include transition(all 300ms ease-in);
transition: transform 300ms ease-in;
margin: 75px 0 0 -262px;
width: 524px;

&--loading {
@include transform(scale(1.3));
transform: scale(1.3);
opacity: 0;
}

&--loaded {
@include transform(scale(1));
transform: scale(1);
opacity: 1;
}

&--leaving {
@include transform(scale(1.3));
transform: scale(1.3);
opacity: 0;
}

Expand Down Expand Up @@ -55,7 +55,7 @@
width: 100%;

&-link {
@include transition(color 150ms ease-in-out);
transition: color 150ms ease-in-out;
color: $text-light;
text-decoration: none;
position: absolute;
Expand Down
14 changes: 7 additions & 7 deletions frontend/components/UserBlock/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.user-block {
@include transition(all 300ms ease-in-out);
transition: border 300ms ease-in-out, background-color 300ms ease-in-out;
background-color: $white;
display: inline-block;
height: 440px;
Expand All @@ -20,7 +20,7 @@
}

&__header {
@include transition(all 300ms ease-in-out);
transition: color 300ms ease-in-out, background-color 300ms ease-in-out;
background-color: $bg-light;
border-bottom: 1px solid $accent-light;
color: $text-ultradark;
Expand Down Expand Up @@ -73,7 +73,7 @@

&__avatar {
@include size(100px);
@include transition(all 300ms ease-in-out);
transition: border 300ms ease-in-out;
border: 1px solid $text-medium;
filter: none;
display: block;
Expand All @@ -92,7 +92,7 @@
}

&__status-label {
@include transition(color 300ms ease-in-out);
transition: color 300ms ease-in-out;
float: left;
font-weight: $bold;
font-size: $medium;
Expand All @@ -101,7 +101,7 @@
}

&__status-text {
@include transition(color 300ms ease-in-out);
transition: color 300ms ease-in-out;
float: right;
text-transform: uppercase;
font-weight: $light;
Expand All @@ -122,7 +122,7 @@
}

&__username {
@include transition(color 300ms ease-in-out);
transition: color 300ms ease-in-out;
color: $text-medium;
font-size: $medium;
text-transform: uppercase;
Expand Down Expand Up @@ -154,7 +154,7 @@
}

&__email {
@include transition(all 300ms ease-in-out);
transition: color 300ms ease-in-out;
color: $link;
font-size: $small;
line-height: $larger;
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/buttons/Button/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ $base-class: 'button';
}

.#{$base-class} {
@include user-select(none);
@include transition(color 150ms ease-in-out, background 150ms ease-in-out, top 50ms ease-in-out, box-shadow 50ms ease-in-out, border 50ms ease-in-out);
@include button-variant($link);
user-select: none;
transition: color 150ms ease-in-out, background 150ms ease-in-out, top 50ms ease-in-out, box-shadow 50ms ease-in-out, border 50ms ease-in-out;
position: relative;
height: 38px;
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/buttons/EllipsisMenu/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.ellipsis-menu {
@include user-select(none);
user-select: none;
display: inline-block;
position: absolute;

Expand Down
10 changes: 5 additions & 5 deletions frontend/components/flash_messages/FlashMessage/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
}

.flash-message {
@include display(flex);
@include align-items(center);
@include justify-content(center);
@include position(fixed, 0 0 null $nav-width);
display: flex;
align-items: center;
justify-content: center;
color: $white;
padding: $pad-half;
z-index: 2;
Expand Down Expand Up @@ -41,7 +41,7 @@
}

&__content {
@include flex-grow(1);
flex-grow: 1;
text-align: center;

span {
Expand Down Expand Up @@ -69,7 +69,7 @@
margin-left: 15px;

.kolidecon {
@include transition(color 150ms ease-in-out);
transition: color 150ms ease-in-out;
color: $text-light;
font-size: 24px;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
}

.persistent-flash {
@include display(flex);
@include align-items(center);
@include justify-content(center);
@include position(fixed, 0 0 null $nav-width);
display: flex;
align-items: center;
justify-content: center;
color: $white;
padding: $pad-half;
z-index: 2;
Expand All @@ -25,7 +25,7 @@
}

&__content {
@include flex-grow(1);
flex-grow: 1;
text-align: center;

i {
Expand All @@ -39,4 +39,3 @@
}
}
}

4 changes: 2 additions & 2 deletions frontend/components/forms/ChangeEmailForm/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.change-email-form {
&__btn-wrap {
@include display(flex);
@include flex-direction(row-reverse);
display: flex;
flex-direction: row-reverse;
}

&__btn {
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/forms/ChangePasswordForm/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.change-password-form {
&__btn-wrap {
@include display(flex);
@include flex-direction(row-reverse);
display: flex;
flex-direction: row-reverse;
}

&__btn {
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/forms/InviteUserForm/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
}

&__btn-wrap {
@include display(flex);
@include flex-direction(row-reverse);
display: flex;
flex-direction: row-reverse;
}

&__btn {
Expand Down
9 changes: 4 additions & 5 deletions frontend/components/forms/LoginForm/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
.login-form {
@include transition(all 300ms ease-in);
@include transform(scale(1));
transition: transform 300ms ease-in;
transform: scale(1);
margin-top: -260px;
opacity: 1;
width: 460px;
align-self: center;

&--hidden {
@include transform(scale(1.3));
transform: scale(1.3);
opacity: 0;
}

&__container {
@include display(flex);
display: flex;
align-items: center;
background-color: $white;
border-top-left-radius: 0;
border-top-right-radius: 0;
box-sizing: border-box;
display: flex;
flex-direction: column;
padding: 30px;
width: 460px;
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/forms/LogoutForm/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.logout-form {
@include align-self(center);
align-self: center;
width: 460px;

&__container {
@include display(flex);
@include align-items(center);
@include flex-direction(column);
display: flex;
align-items: center;
flex-direction: column;
background-color: $white;
box-sizing: border-box;
padding: 30px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
}

&__import {
@include user-select(none);
user-select: none;
font-size: 14px;
font-weight: $light;
line-height: 1.71;
Expand Down
16 changes: 8 additions & 8 deletions frontend/components/forms/RegistrationForm/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.user-registration {
@include display(flex);
@include align-content(center);
@include justify-content(center);
@include flex-grow(1);
display: flex;
align-content: center;
justify-content: center;
flex-grow: 1;

&__container {
@include align-self(center);
@include size(500px 520px);
align-self: center;
border-radius: 4px;
background-color: $bg-light;
box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.3);
Expand All @@ -29,15 +29,15 @@
}

&__form {
@include transform(translateY(-85px));
@include position(absolute, 49% 0 null null);
transform: translateY(-85px);
width: 100%;
height: 470px;
box-sizing: border-box;
padding: 25px 0;

@include breakpoint(tablet) {
@include transform(translateY(-100px));
transform: translateY(-100px);
}

&--step1-complete {
Expand Down Expand Up @@ -135,7 +135,7 @@
}

&__field-wrapper {
@include transition(left 300ms ease);
transition: left 300ms ease;
width: 430px;
min-height: 420px;
padding-bottom: 75px;
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/forms/fields/Checkbox/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
}

&::before {
@include transform(rotate(45deg));
@include position(absolute, 50% null null 50%);
transform: rotate(45deg);
box-sizing: border-box;
display: block;
width: 7px;
Expand All @@ -34,12 +34,12 @@
&__tick {
@include size(20px);
@include position(absolute, 50% null null 0);
@include transform(translateY(-10px));
transform: translateY(-10px);
display: inline-block;

&::after {
@include transition(border 75ms ease-in-out, background 75ms ease-in-out);
@include size(20px);
transition: border 75ms ease-in-out, background 75ms ease-in-out;
border-radius: 2px;
border: solid 2px $border-medium;
content: '';
Expand Down
Loading

0 comments on commit 759a69b

Please sign in to comment.