Skip to content

Commit

Permalink
Stylelint updates (#1022)
Browse files Browse the repository at this point in the history
* Add additional stylelint rules

* Lint SCSS

* Add protocol color tokens
  • Loading branch information
maxxcrawford authored Aug 17, 2021
1 parent fd495b3 commit 0ebfc5a
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 32 deletions.
21 changes: 20 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,32 @@
"static/scss/libs/**"
],
"rules": {
"at-rule-empty-line-before": [
"always",
{
"except": ["after-same-name", "first-nested"],
"ignore": ["after-comment"]
}
],
"at-rule-no-unknown": null,
"block-opening-brace-newline-after": "always",
"block-closing-brace-newline-after": "always",
"color-hex-case": "upper",
"declaration-block-semicolon-newline-after": "always",
"declaration-colon-space-after": "always",
"declaration-colon-space-before": "never",
"function-url-quotes": "always",
"indentation": 4,
"no-descending-specificity": null,
"no-missing-end-of-source-newline": true,
"number-leading-zero": "never",
"rule-empty-line-before": [
"always",
{
"except": ["after-single-line-comment"],
"ignore": ["after-comment"]
}
],
"scss/at-rule-no-unknown": true
}
}
}
24 changes: 19 additions & 5 deletions static/scss/components/banners.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,84 @@
border-radius: $border-radius-md;
padding: $spacing-xl $spacing-lg;
width: 100%;

img {
display: none;
height: auto;
align-self: center;
max-width: 280px;
padding: 0 $spacing-xl;
}

h2 {
font-size: 1.25rem;
margin: 0 0 $spacing-sm;
padding: 0;
color: $color-black;
}

p {
margin: 0 0 $spacing-md;
padding: 0;
}

form {
margin-bottom: $spacing-md;
}

input {
width: 100%;
display: block;
border-radius: $border-radius-sm;
padding: $spacing-sm $spacing-md;
margin-bottom: $spacing-sm;

&[type='text'] {
border: 1px solid #CCCCCC;
border: 1px solid $color-light-gray-20;
width: 100%;
}

}

.warning {
font-size: .9rem;
font-weight: 700;
color: $color-warning;
}

.border {
border-left: 1px solid #ECECEC;
border-left: 1px solid $color-light-gray-20;
display: none;
}
}

@media screen and (min-width: 540px) {
.mpp-choose-subdomain form {

.mpp-choose-subdomain form {
display: flex;

input {
width: auto;

&[type='submit'] {
margin-left: $spacing-md;
}
}
}
}

@media screen and (min-width: 768px) {
.mpp-choose-subdomain {

.mpp-choose-subdomain {
display: flex;

img {
display: block;
}

.border {
display: block;
}

.mpp-choose-subdomain-form {
padding-left: $spacing-xl;
}
Expand Down
4 changes: 3 additions & 1 deletion static/scss/components/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
color: $color-blue-50;
}

.btn--blue {
.btn--blue {
background-color: $color-blue-50;
color: $color-white;
}
Expand All @@ -23,13 +23,15 @@
border: 2px solid $color-blue-50;
color: $color-blue-50;
background: none;

&:hover {
color: $color-white;
background-color: $color-blue-50;
}
}

.c-button-toggle {

form {
display: flex;
align-items: center;
Expand Down
11 changes: 10 additions & 1 deletion static/scss/components/filter-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
margin-bottom: $spacing-md;

.c-filter-search-form {

&.is-hidden {
display: none;
}
Expand All @@ -29,6 +30,7 @@

@media screen and (min-width: 768px) {
justify-content: flex-end;

&.is-search-active {
margin-bottom: $spacing-md;

Expand Down Expand Up @@ -56,13 +58,15 @@
padding-right: 90px;
position: relative;
z-index: 0;

&.is-filtered + .c-filter-search-controls {
opacity: 1;
}

&:focus + .c-filter-search-controls {
opacity: 1;
}

&:focus, &:hover {
background-image: url("/static/images/icon-search-blue.svg");
}
Expand Down Expand Up @@ -91,9 +95,11 @@
@media #{$mq-md} {
align-self: flex-start;
margin-right: auto;

form {
display: block;
}

.c-filter-icon {
display: none;
}
Expand All @@ -102,6 +108,7 @@

.c-filter-action {
margin-left: auto;

@media #{$mq-md} {
margin-left: 0;
}
Expand Down Expand Up @@ -129,13 +136,15 @@
.c-filter-icon-search {
background-size: auto 1.25rem;
background-image: url("/static/images/icon-search.svg");

&.is-enabled, &:hover {
background-image: url("/static/images/icon-search-blue.svg");
}
}

.c-filter-icon-calendar {
background-image: url("/static/images/icon-calendar.svg");

&.is-enabled, &:hover {
background-image: url("/static/images/icon-calendar-blue.svg");
}
Expand Down Expand Up @@ -169,4 +178,4 @@
width: 1rem;
display: block;
}
}
}
2 changes: 1 addition & 1 deletion static/scss/includes/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ $gradient-blue: radial-gradient(100% 100% at 100% 0%, #B833E1 0%, #9059FF 37.1%,
// Base Colors
$color-purple: $color-violet-90;
$color-green: $color-green-50;
$color-grey: $color-grey-60;
$color-grey: $color-grey-60;
1 change: 1 addition & 0 deletions static/scss/partials/banners.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
}

@media screen and (max-width: 800px) {

#micro-survey-banner {
display: none;
}
Expand Down
Loading

0 comments on commit 0ebfc5a

Please sign in to comment.