Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: links in article content #3171

Merged
merged 3 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
</style>
Expand Down
45 changes: 28 additions & 17 deletions client/src/document/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
}

.article {
.main-page-content {
schalkneethling marked this conversation as resolved.
Show resolved Hide resolved
padding: ($base-spacing / 2) $base-spacing $base-spacing;

@media #{$mq-small-desktop-and-up} {
Expand All @@ -62,33 +62,39 @@
@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);

@media #{$mq-tablet-and-up} {
margin-bottom: ($base-unit * 6);
}

code {
color: $neutral-100;
}

a:link,
a:visited {
color: $neutral-100;
Expand All @@ -101,10 +107,6 @@
}

h3 {
code {
color: $neutral-600;
}

a:link,
a:visited {
color: $neutral-600;
Expand All @@ -116,6 +118,15 @@
}
}

h2,
h3,
h4 {
a:link,
a:visited {
text-decoration: none;
}
}

table {
margin-bottom: $base-spacing * 2;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/document/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function Document(props /* TODO: define a TS interface for this */) {
/>
</React.Suspense>
)}
<article className="article" lang={doc.locale}>
<article className="main-page-content" lang={doc.locale}>
<h1>{doc.title}</h1>
<RenderDocumentBody doc={doc} />
</article>
Expand Down
5 changes: 5 additions & 0 deletions client/src/document/organisms/metadata/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 0 additions & 11 deletions client/src/site-search/index.scss
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion client/src/site-search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function SiteSearch() {
}, [query, page, ga]);

return (
<div className="site-search">
<div className="site-search main-page-content">
<PageContentContainer>
{query ? (
<h1>
Expand Down
6 changes: 4 additions & 2 deletions client/src/site-search/search-results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@
padding: 0;

a {
color: $neutral-100;
text-decoration: none;
&:link,
&:visited {
color: $neutral-100;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/site-search/search-results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function ExplainBadRequestError({ errors }: { errors: FormErrors }) {
function ExplainServerOperationalError({ statusCode }: { statusCode: number }) {
return (
<div className="notecard warning">
<p>The search failed because the server failed to response.</p>
<p>The search failed because the server failed to respond.</p>
<p>
If you're curious, it was a <b>{statusCode}</b> error.
</p>
Expand Down