From 3ed5494dcaeecaa30d23dd6513326289e30a05bb Mon Sep 17 00:00:00 2001 From: Schalk Neethling Date: Tue, 9 Mar 2021 17:58:58 +0200 Subject: [PATCH 1/3] fix: links in article content Fixes underlines and colors of links in main page content. Fix #2901 --- client/src/document/index.scss | 45 ++++++++++++++-------- client/src/document/index.tsx | 2 +- client/src/site-search/index.scss | 11 ------ client/src/site-search/index.tsx | 2 +- client/src/site-search/search-results.scss | 6 ++- client/src/site-search/search-results.tsx | 2 +- 6 files changed, 35 insertions(+), 33 deletions(-) diff --git a/client/src/document/index.scss b/client/src/document/index.scss index c6dcf2a12e91..2fabb76d400a 100644 --- a/client/src/document/index.scss +++ b/client/src/document/index.scss @@ -36,7 +36,7 @@ } } -.article { +.main-page-content { padding: ($base-spacing / 2) $base-spacing $base-spacing; @media #{$mq-small-desktop-and-up} { @@ -62,22 +62,32 @@ @include readable-line-length(); } - a { - &:active { - background-color: $primary-50; - color: $text-color-inverted; - } - } - h2, h3 { code { background-color: transparent; - color: $neutral-100; text-decoration: none; } } + a { + text-decoration: underline; + + &:hover, + &:focus { + text-decoration: none; + } + + &:active { + background-color: $primary-50; + color: $text-color-inverted; + + code { + background-color: transparent; + } + } + } + h2 { margin-bottom: ($base-unit * 2); @@ -85,10 +95,6 @@ margin-bottom: ($base-unit * 6); } - code { - color: $neutral-100; - } - a:link, a:visited { color: $neutral-100; @@ -101,10 +107,6 @@ } h3 { - code { - color: $neutral-600; - } - a:link, a:visited { color: $neutral-600; @@ -116,6 +118,15 @@ } } + h2, + h3, + h4 { + a:link, + a:visited { + text-decoration: none; + } + } + table { margin-bottom: $base-spacing * 2; } diff --git a/client/src/document/index.tsx b/client/src/document/index.tsx index c7da476f379e..20c74126c96f 100644 --- a/client/src/document/index.tsx +++ b/client/src/document/index.tsx @@ -171,7 +171,7 @@ export function Document(props /* TODO: define a TS interface for this */) { /> )} -
+

{doc.title}

diff --git a/client/src/site-search/index.scss b/client/src/site-search/index.scss index 0149c1ac5fd7..f49eecf9abc2 100644 --- a/client/src/site-search/index.scss +++ b/client/src/site-search/index.scss @@ -1,16 +1,5 @@ .site-search { min-height: 500px; - - // This is temporary - // Once https://github.com/mdn/yari/issues/2901 lands we can delete this - a { - text-decoration: underline; - - &:hover, - &:focus { - text-decoration: none; - } - } } .query-string { diff --git a/client/src/site-search/index.tsx b/client/src/site-search/index.tsx index 1598e8184d6a..a68071308ad8 100644 --- a/client/src/site-search/index.tsx +++ b/client/src/site-search/index.tsx @@ -48,7 +48,7 @@ export function SiteSearch() { }, [query, page, ga]); return ( -
+
{query ? (

diff --git a/client/src/site-search/search-results.scss b/client/src/site-search/search-results.scss index 0d9efc0cf28e..7f6bd99b9d6a 100644 --- a/client/src/site-search/search-results.scss +++ b/client/src/site-search/search-results.scss @@ -50,8 +50,10 @@ padding: 0; a { - color: $neutral-100; - text-decoration: none; + &:link, + &:visited { + color: $neutral-100; + } } } diff --git a/client/src/site-search/search-results.tsx b/client/src/site-search/search-results.tsx index 91a376ec7ed2..70a5c86f3c0d 100644 --- a/client/src/site-search/search-results.tsx +++ b/client/src/site-search/search-results.tsx @@ -258,7 +258,7 @@ function ExplainBadRequestError({ errors }: { errors: FormErrors }) { function ExplainServerOperationalError({ statusCode }: { statusCode: number }) { return (
-

The search failed because the server failed to response.

+

The search failed because the server failed to respond.

If you're curious, it was a {statusCode} error.

From 95ce65d8dc5086fddbac5f7a9e36ac20202c6bef Mon Sep 17 00:00:00 2001 From: Schalk Neethling Date: Wed, 10 Mar 2021 14:19:31 +0200 Subject: [PATCH 2/3] update print style rules --- client/public/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/public/index.html b/client/public/index.html index 58c49e8a7d33..d399a05c9efa 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -62,11 +62,11 @@ ul.prev-next { display: none !important; } - .article, - .article pre { + .main-page-content, + .main-page-content pre { padding: 2px; } - .article pre { + .main-page-content pre { border-left-width: 2px; } From f1b9241140aaebd4a70722e17b4d06d3aba95bc0 Mon Sep 17 00:00:00 2001 From: Schalk Neethling Date: Thu, 11 Mar 2021 15:17:57 +0200 Subject: [PATCH 3/3] underline links in meta document footer --- client/src/document/organisms/metadata/index.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/document/organisms/metadata/index.scss b/client/src/document/organisms/metadata/index.scss index 4ffd6edcd1b5..0f3043f865b8 100644 --- a/client/src/document/organisms/metadata/index.scss +++ b/client/src/document/organisms/metadata/index.scss @@ -12,6 +12,11 @@ margin: 0 auto; max-width: $max-width-default; + a:link, + a:visited { + text-decoration: underline; + } + .on-github { margin-bottom: $base-spacing; }