From 12d3766bd81bd33824b3c8ed50524c936db5e7c5 Mon Sep 17 00:00:00 2001 From: nstriedinger Date: Wed, 13 Mar 2019 13:31:14 -0400 Subject: [PATCH 1/5] Add new classes in --- src/components/results/_pagination.scss | 114 +++++++------- src/components/results/_search-results.scss | 49 +++--- src/styles.css | 161 ++++++++++---------- 3 files changed, 163 insertions(+), 161 deletions(-) diff --git a/src/components/results/_pagination.scss b/src/components/results/_pagination.scss index a0d7f6e..410ee9e 100644 --- a/src/components/results/_pagination.scss +++ b/src/components/results/_pagination.scss @@ -38,81 +38,81 @@ @include breakpoint($bp2) { margin-right: rhythm(.25); } +} - // Link styles - a { - @include trans(); - @include adjust-font-size-to(.9em, 1); - font-weight: 700; - display: flex; - justify-content: center; - align-items: center; - border: 0; - text-align: center; - padding: rhythm(.25); - - @include breakpoint($bp0) { - background-color: $c-secondary; - color: $white; - border-radius: 3px; - width: rhythm(1.5); - height: rhythm(1.5); - padding: 0; - } +// Active page +.search-pager__item.is-active .search-pager__item-link { + @include adjust-font-size-to($text, 1); - @include breakpoint($bp2) { - @include adjust-font-size-to($label, .9); - width: rhythm(1.2); - height: rhythm(1.2); - } + @include breakpoint($bp0) { + background-color: $link-color; + color: $white; &:hover, &:active { - text-decoration: underline; - color: $white; - background-color: $c-secondary; - - @include breakpoint($bp0) { - @include adjust-font-size-to($text, 1); - background-color: $c-secondary-dark; - } - - svg { - fill: $c-primary-dark; - } + background-color: $c-primary-dark; } + } +} - svg { - height: 1.3em; - fill: $white; - display: block; +.search-pager__item.not-active .search-pager__item-link{ + display: none; - @include breakpoint($bp0) { - height: 1em; - } - } + @include breakpoint($bp0) { + display: inline-block; + } +} + +// Link styles +.search-pager__item-link { + @include trans(); + @include adjust-font-size-to(.9em, 1); + font-weight: 700; + display: flex; + justify-content: center; + align-items: center; + border: 0; + text-align: center; + padding: rhythm(.25); + + @include breakpoint($bp0) { + background-color: $c-secondary; + color: $white; + border-radius: 3px; + width: rhythm(1.5); + height: rhythm(1.5); + padding: 0; + } + + @include breakpoint($bp2) { + @include adjust-font-size-to($label, .9); + width: rhythm(1.2); + height: rhythm(1.2); } - // Active page - &.is-active a { - @include adjust-font-size-to($text, 1); + &:hover, + &:active { + text-decoration: underline; + color: $white; + background-color: $c-secondary; @include breakpoint($bp0) { - background-color: $link-color; - color: $white; + @include adjust-font-size-to($text, 1); + background-color: $c-secondary-dark; + } - &:hover, - &:active { - background-color: $c-primary-dark; - } + svg { + fill: $c-primary-dark; } } - &.not-active { - display: none; + svg { + height: 1.3em; + fill: $white; + display: block; @include breakpoint($bp0) { - display: inline-block; + height: 1em; } } } diff --git a/src/components/results/_search-results.scss b/src/components/results/_search-results.scss index 82bd7b2..9f1d7af 100644 --- a/src/components/results/_search-results.scss +++ b/src/components/results/_search-results.scss @@ -2,7 +2,7 @@ * search-form.scss * Define search results styles. * - * @copyright Copyright (c) 2017 Palantir.net + * @copyright Copyright (c) 2019 Palantir.net */ .search-results { @@ -47,33 +47,32 @@ margin-top: .25em; padding: 0; line-height: calc(100% + 50%); +} - a { - /** - * 1. Remove the gray background on active links in IE 10. - * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. - */ - @include trans(); - background-color: transparent; /* 1 */ - /* stylelint-disable property-no-vendor-prefix */ - -webkit-text-decoration-skip: objects; /* 2 */ - /* stylelint-enable */ - color: $link-color; - text-decoration: none; - border-bottom: 2px dashed $link-color; +.search-results__heading-link { + /** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + @include trans(); + background-color: transparent; /* 1 */ + /* stylelint-disable property-no-vendor-prefix */ + -webkit-text-decoration-skip: objects; /* 2 */ + /* stylelint-enable */ + color: $link-color; + text-decoration: none; - /** - * Remove the outline on focused links when they are also active or hovered - * in all browsers (opinionated). - */ + /** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ - &:active, - &:hover { - outline-width: 0; - color: $link-hover; - background-color: $gray-light; - border-bottom: 2px solid $link-hover; - } + &:active, + &:hover { + outline-width: 0; + color: $link-hover; + background-color: $gray-light; + border-bottom: 2px solid $link-hover; } } diff --git a/src/styles.css b/src/styles.css index dc72519..c367e8c 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1380,7 +1380,7 @@ aside { * search-form.scss * Define search results styles. * - * @copyright Copyright (c) 2017 Palantir.net + * @copyright Copyright (c) 2019 Palantir.net */ .search-results li { margin-bottom: 1.46667em; @@ -1412,30 +1412,30 @@ aside { margin-top: .25em; padding: 0; line-height: calc(100% + 50%); } - .search-results__heading a { - /** - * 1. Remove the gray background on active links in IE 10. - * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. - */ - transition: all 0.3s ease; - background-color: transparent; - /* 1 */ - /* stylelint-disable property-no-vendor-prefix */ - -webkit-text-decoration-skip: objects; - /* 2 */ - /* stylelint-enable */ - color: #737373; - text-decoration: none; - border-bottom: 2px dashed #737373; - /** - * Remove the outline on focused links when they are also active or hovered - * in all browsers (opinionated). - */ } - .search-results__heading a:active, .search-results__heading a:hover { - outline-width: 0; - color: black; - background-color: #e5e5e5; - border-bottom: 2px solid black; } + +.search-results__heading-link { + /** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + transition: all 0.3s ease; + background-color: transparent; + /* 1 */ + /* stylelint-disable property-no-vendor-prefix */ + -webkit-text-decoration-skip: objects; + /* 2 */ + /* stylelint-enable */ + color: #737373; + text-decoration: none; + /** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ } + .search-results__heading-link:active, .search-results__heading-link:hover { + outline-width: 0; + color: black; + background-color: #e5e5e5; + border-bottom: 2px solid black; } .search-results__teaser { margin-bottom: 0.73333em; } @@ -1577,63 +1577,66 @@ aside { @media (min-width: 900px) { .search-pager__item { margin-right: 0.36667em; } } - .search-pager__item a { - transition: all 0.3s ease; - font-size: 0.9em; - line-height: 1.62963em; - font-weight: 700; - display: flex; - justify-content: center; - align-items: center; - border: 0; - text-align: center; - padding: 0.36667em; } - @media (min-width: 450px) { - .search-pager__item a { - background-color: #0000ff; - color: #fff; - border-radius: 3px; - width: 2.2em; - height: 2.2em; - padding: 0; } } - @media (min-width: 900px) { - .search-pager__item a { - font-size: 0.8em; - line-height: 1.65em; - width: 1.76em; - height: 1.76em; } } - .search-pager__item a:hover, .search-pager__item a:active { - text-decoration: underline; + +.search-pager__item.is-active .search-pager__item-link { + font-size: 1em; + line-height: 1.46667em; } + @media (min-width: 450px) { + .search-pager__item.is-active .search-pager__item-link { + background-color: #737373; + color: #fff; } + .search-pager__item.is-active .search-pager__item-link:hover, .search-pager__item.is-active .search-pager__item-link:active { + background-color: black; } } + +.search-pager__item.not-active .search-pager__item-link { + display: none; } + @media (min-width: 450px) { + .search-pager__item.not-active .search-pager__item-link { + display: inline-block; } } + +.search-pager__item-link { + transition: all 0.3s ease; + font-size: 0.9em; + line-height: 1.62963em; + font-weight: 700; + display: flex; + justify-content: center; + align-items: center; + border: 0; + text-align: center; + padding: 0.36667em; } + @media (min-width: 450px) { + .search-pager__item-link { + background-color: #0000ff; color: #fff; - background-color: #0000ff; } - @media (min-width: 450px) { - .search-pager__item a:hover, .search-pager__item a:active { - font-size: 1em; - line-height: 1.46667em; - background-color: navy; } } - .search-pager__item a:hover svg, .search-pager__item a:active svg { - fill: black; } - .search-pager__item a svg { - height: 1.3em; - fill: #fff; - display: block; } - @media (min-width: 450px) { - .search-pager__item a svg { - height: 1em; } } - .search-pager__item.is-active a { - font-size: 1em; - line-height: 1.46667em; } + border-radius: 3px; + width: 2.2em; + height: 2.2em; + padding: 0; } } + @media (min-width: 900px) { + .search-pager__item-link { + font-size: 0.8em; + line-height: 1.65em; + width: 1.76em; + height: 1.76em; } } + .search-pager__item-link:hover, .search-pager__item-link:active { + text-decoration: underline; + color: #fff; + background-color: #0000ff; } @media (min-width: 450px) { - .search-pager__item.is-active a { - background-color: #737373; - color: #fff; } - .search-pager__item.is-active a:hover, .search-pager__item.is-active a:active { - background-color: black; } } - .search-pager__item.not-active { - display: none; } + .search-pager__item-link:hover, .search-pager__item-link:active { + font-size: 1em; + line-height: 1.46667em; + background-color: navy; } } + .search-pager__item-link:hover svg, .search-pager__item-link:active svg { + fill: black; } + .search-pager__item-link svg { + height: 1.3em; + fill: #fff; + display: block; } @media (min-width: 450px) { - .search-pager__item.not-active { - display: inline-block; } } + .search-pager__item-link svg { + height: 1em; } } /** * search-results-stat.scss From 1ced4738648def9572ce8093beb101bf9b36f04c Mon Sep 17 00:00:00 2001 From: nstriedinger Date: Wed, 13 Mar 2019 13:34:41 -0400 Subject: [PATCH 2/5] code cleanup --- src/components/results/_pagination.scss | 2 +- src/components/results/_search-results.scss | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/results/_pagination.scss b/src/components/results/_pagination.scss index 410ee9e..cc3f30d 100644 --- a/src/components/results/_pagination.scss +++ b/src/components/results/_pagination.scss @@ -55,7 +55,7 @@ } } -.search-pager__item.not-active .search-pager__item-link{ +.search-pager__item.not-active .search-pager__item-link { display: none; @include breakpoint($bp0) { diff --git a/src/components/results/_search-results.scss b/src/components/results/_search-results.scss index 9f1d7af..0466f4b 100644 --- a/src/components/results/_search-results.scss +++ b/src/components/results/_search-results.scss @@ -66,7 +66,6 @@ * Remove the outline on focused links when they are also active or hovered * in all browsers (opinionated). */ - &:active, &:hover { outline-width: 0; From a1f915ea59b3a18d2c80e499e69c9272c6cf8dc3 Mon Sep 17 00:00:00 2001 From: nstriedinger Date: Wed, 13 Mar 2019 16:45:33 -0400 Subject: [PATCH 3/5] prune line height, borders, background -- stuff thats hard to override --- src/components/results/_pagination.scss | 56 ++----------- .../results/_search-results-stat.scss | 1 - src/components/results/_search-results.scss | 16 ---- src/styles.css | 82 +++---------------- 4 files changed, 20 insertions(+), 135 deletions(-) diff --git a/src/components/results/_pagination.scss b/src/components/results/_pagination.scss index cc3f30d..933889c 100644 --- a/src/components/results/_pagination.scss +++ b/src/components/results/_pagination.scss @@ -13,8 +13,6 @@ display: flex; align-items: center; justify-content: space-between; - border-radius: 3px; - background-color: $gray-pale; padding: 0 rhythm(2); margin: rhythm(3) 0; @@ -38,36 +36,22 @@ @include breakpoint($bp2) { margin-right: rhythm(.25); } -} - -// Active page -.search-pager__item.is-active .search-pager__item-link { - @include adjust-font-size-to($text, 1); - @include breakpoint($bp0) { - background-color: $link-color; - color: $white; - - &:hover, - &:active { - background-color: $c-primary-dark; - } + &.is-active .search-pager__item-link { + font-weight: bold; } -} -.search-pager__item.not-active .search-pager__item-link { - display: none; + &.not-active .search-pager__item-link { + display: none; - @include breakpoint($bp0) { - display: inline-block; + @include breakpoint($bp0) { + display: inline-block; + } } } // Link styles .search-pager__item-link { - @include trans(); - @include adjust-font-size-to(.9em, 1); - font-weight: 700; display: flex; justify-content: center; align-items: center; @@ -75,32 +59,8 @@ text-align: center; padding: rhythm(.25); - @include breakpoint($bp0) { - background-color: $c-secondary; - color: $white; - border-radius: 3px; - width: rhythm(1.5); - height: rhythm(1.5); - padding: 0; - } - - @include breakpoint($bp2) { - @include adjust-font-size-to($label, .9); - width: rhythm(1.2); - height: rhythm(1.2); - } - &:hover, &:active { - text-decoration: underline; - color: $white; - background-color: $c-secondary; - - @include breakpoint($bp0) { - @include adjust-font-size-to($text, 1); - background-color: $c-secondary-dark; - } - svg { fill: $c-primary-dark; } @@ -108,7 +68,7 @@ svg { height: 1.3em; - fill: $white; + fill: $black; display: block; @include breakpoint($bp0) { diff --git a/src/components/results/_search-results-stat.scss b/src/components/results/_search-results-stat.scss index 4e6afde..d51a3e9 100644 --- a/src/components/results/_search-results-stat.scss +++ b/src/components/results/_search-results-stat.scss @@ -6,7 +6,6 @@ */ .search-results-stat { - @include adjust-font-size-to(.9em, 1); color: $gray-medium; &:focus { diff --git a/src/components/results/_search-results.scss b/src/components/results/_search-results.scss index 0466f4b..909df45 100644 --- a/src/components/results/_search-results.scss +++ b/src/components/results/_search-results.scss @@ -12,12 +12,6 @@ margin-bottom: rhythm(1); display: flex; } - - em { - font-style: normal; - font-weight: 700; - background-color: transparentize($c-secondary, .7); - } } .search-results__container--left { @@ -34,19 +28,14 @@ } .search-results__label { - @include adjust-font-size-to($label, .7); - font-weight: 500; color: $gray-medium; display: block; } .search-results__heading { - font-weight: 700; - @include trailer(.25, $h3-font-size); margin-bottom: .33333em; margin-top: .25em; padding: 0; - line-height: calc(100% + 50%); } .search-results__heading-link { @@ -54,8 +43,6 @@ * 1. Remove the gray background on active links in IE 10. * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. */ - @include trans(); - background-color: transparent; /* 1 */ /* stylelint-disable property-no-vendor-prefix */ -webkit-text-decoration-skip: objects; /* 2 */ /* stylelint-enable */ @@ -70,8 +57,6 @@ &:hover { outline-width: 0; color: $link-hover; - background-color: $gray-light; - border-bottom: 2px solid $link-hover; } } @@ -80,7 +65,6 @@ } .search-results__meta { - @include adjust-font-size-to($label, .8); margin-bottom: rhythm(.5); color: $gray-medium; display: block; diff --git a/src/styles.css b/src/styles.css index c367e8c..91388e7 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1386,11 +1386,6 @@ aside { margin-bottom: 1.46667em; display: flex; } -.search-results em { - font-style: normal; - font-weight: 700; - background-color: rgba(0, 0, 255, 0.3); } - .search-results__container--left { flex: 1 0 0; margin-right: 3%; } @@ -1399,28 +1394,19 @@ aside { flex: 3 0 0; } .search-results__label { - font-size: 0.8em; - line-height: 1.28333em; - font-weight: 500; color: #555; display: block; } .search-results__heading { - font-weight: 700; - margin-bottom: 0.36667em; margin-bottom: .33333em; margin-top: .25em; - padding: 0; - line-height: calc(100% + 50%); } + padding: 0; } .search-results__heading-link { /** * 1. Remove the gray background on active links in IE 10. * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. */ - transition: all 0.3s ease; - background-color: transparent; - /* 1 */ /* stylelint-disable property-no-vendor-prefix */ -webkit-text-decoration-skip: objects; /* 2 */ @@ -1433,16 +1419,12 @@ aside { */ } .search-results__heading-link:active, .search-results__heading-link:hover { outline-width: 0; - color: black; - background-color: #e5e5e5; - border-bottom: 2px solid black; } + color: black; } .search-results__teaser { margin-bottom: 0.73333em; } .search-results__meta { - font-size: 0.8em; - line-height: 1.46667em; margin-bottom: 0.73333em; color: #555; display: block; } @@ -1557,8 +1539,6 @@ aside { display: flex; align-items: center; justify-content: space-between; - border-radius: 3px; - background-color: #eff0f1; padding: 0 2.93333em; margin: 4.4em 0; } @media (min-width: 450px) { @@ -1577,62 +1557,26 @@ aside { @media (min-width: 900px) { .search-pager__item { margin-right: 0.36667em; } } - -.search-pager__item.is-active .search-pager__item-link { - font-size: 1em; - line-height: 1.46667em; } - @media (min-width: 450px) { - .search-pager__item.is-active .search-pager__item-link { - background-color: #737373; - color: #fff; } - .search-pager__item.is-active .search-pager__item-link:hover, .search-pager__item.is-active .search-pager__item-link:active { - background-color: black; } } - -.search-pager__item.not-active .search-pager__item-link { - display: none; } - @media (min-width: 450px) { - .search-pager__item.not-active .search-pager__item-link { - display: inline-block; } } + .search-pager__item.is-active .search-pager__item-link { + font-weight: bold; } + .search-pager__item.not-active .search-pager__item-link { + display: none; } + @media (min-width: 450px) { + .search-pager__item.not-active .search-pager__item-link { + display: inline-block; } } .search-pager__item-link { - transition: all 0.3s ease; - font-size: 0.9em; - line-height: 1.62963em; - font-weight: 700; display: flex; justify-content: center; align-items: center; border: 0; text-align: center; padding: 0.36667em; } - @media (min-width: 450px) { - .search-pager__item-link { - background-color: #0000ff; - color: #fff; - border-radius: 3px; - width: 2.2em; - height: 2.2em; - padding: 0; } } - @media (min-width: 900px) { - .search-pager__item-link { - font-size: 0.8em; - line-height: 1.65em; - width: 1.76em; - height: 1.76em; } } - .search-pager__item-link:hover, .search-pager__item-link:active { - text-decoration: underline; - color: #fff; - background-color: #0000ff; } - @media (min-width: 450px) { - .search-pager__item-link:hover, .search-pager__item-link:active { - font-size: 1em; - line-height: 1.46667em; - background-color: navy; } } - .search-pager__item-link:hover svg, .search-pager__item-link:active svg { - fill: black; } + .search-pager__item-link:hover svg, .search-pager__item-link:active svg { + fill: black; } .search-pager__item-link svg { height: 1.3em; - fill: #fff; + fill: #222; display: block; } @media (min-width: 450px) { .search-pager__item-link svg { @@ -1645,8 +1589,6 @@ aside { * @copyright Copyright (c) 2017 Palantir.net */ .search-results-stat { - font-size: 0.9em; - line-height: 1.62963em; color: #555; } .search-results-stat:focus { outline: 0; } From 197ff2ecd4b925e75ac45a5f85a5c30fcc0ee097 Mon Sep 17 00:00:00 2001 From: nstriedinger Date: Wed, 13 Mar 2019 16:52:46 -0400 Subject: [PATCH 4/5] remove one more silly background thing --- src/components/results/_pagination.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/results/_pagination.scss b/src/components/results/_pagination.scss index 933889c..336489e 100644 --- a/src/components/results/_pagination.scss +++ b/src/components/results/_pagination.scss @@ -5,7 +5,6 @@ * @copyright Copyright (c) 2017 Palantir.net */ .search-pager { - background-color: transparent; } .search-pager__items { From 68601a568a0c70078738fe04cce4e389500e27a0 Mon Sep 17 00:00:00 2001 From: Jes Constantine Date: Thu, 14 Mar 2019 09:15:48 -0400 Subject: [PATCH 5/5] use text-decoration for accessible hover states --- src/components/results/_pagination.scss | 3 +++ src/components/results/_search-results.scss | 12 +++++++--- src/styles.css | 25 ++++++++++++--------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/components/results/_pagination.scss b/src/components/results/_pagination.scss index 336489e..3f03940 100644 --- a/src/components/results/_pagination.scss +++ b/src/components/results/_pagination.scss @@ -60,8 +60,10 @@ &:hover, &:active { + text-decoration: underline; svg { fill: $c-primary-dark; + border-bottom: 1px solid $black; } } @@ -69,6 +71,7 @@ height: 1.3em; fill: $black; display: block; + border-bottom: 1px solid transparent; @include breakpoint($bp0) { height: 1em; diff --git a/src/components/results/_search-results.scss b/src/components/results/_search-results.scss index 909df45..e6c7862 100644 --- a/src/components/results/_search-results.scss +++ b/src/components/results/_search-results.scss @@ -46,7 +46,7 @@ /* stylelint-disable property-no-vendor-prefix */ -webkit-text-decoration-skip: objects; /* 2 */ /* stylelint-enable */ - color: $link-color; + color: $blue; text-decoration: none; /** @@ -56,7 +56,7 @@ &:active, &:hover { outline-width: 0; - color: $link-hover; + text-decoration: underline; } } @@ -70,6 +70,12 @@ display: block; } -.search-results__citation { +.search-results__citation a { font-style: normal; + color: $gray-medium; + text-decoration: none; + + &:hover { + text-decoration: underline; + } } diff --git a/src/styles.css b/src/styles.css index 91388e7..7e16f65 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1411,7 +1411,7 @@ aside { -webkit-text-decoration-skip: objects; /* 2 */ /* stylelint-enable */ - color: #737373; + color: #0000ff; text-decoration: none; /** * Remove the outline on focused links when they are also active or hovered @@ -1419,7 +1419,7 @@ aside { */ } .search-results__heading-link:active, .search-results__heading-link:hover { outline-width: 0; - color: black; } + text-decoration: underline; } .search-results__teaser { margin-bottom: 0.73333em; } @@ -1429,8 +1429,12 @@ aside { color: #555; display: block; } -.search-results__citation { - font-style: normal; } +.search-results__citation a { + font-style: normal; + color: #555; + text-decoration: none; } + .search-results__citation a:hover { + text-decoration: underline; } /** * search-scope.scss @@ -1532,9 +1536,6 @@ aside { * * @copyright Copyright (c) 2017 Palantir.net */ -.search-pager { - background-color: transparent; } - .search-pager__items { display: flex; align-items: center; @@ -1572,12 +1573,16 @@ aside { border: 0; text-align: center; padding: 0.36667em; } - .search-pager__item-link:hover svg, .search-pager__item-link:active svg { - fill: black; } + .search-pager__item-link:hover, .search-pager__item-link:active { + text-decoration: underline; } + .search-pager__item-link:hover svg, .search-pager__item-link:active svg { + fill: black; + border-bottom: 1px solid #222; } .search-pager__item-link svg { height: 1.3em; fill: #222; - display: block; } + display: block; + border-bottom: 1px solid transparent; } @media (min-width: 450px) { .search-pager__item-link svg { height: 1em; } }