Skip to content

fix(docs-infra): more style fixes for angular.io - #40881

Closed
gkalpak wants to merge 19 commits into
angular:masterfrom
gkalpak:fix-aio-styles-3
Closed

gkalpak wants to merge 19 commits into
angular:masterfrom
gkalpak:fix-aio-styles-3

Conversation

@gkalpak

@gkalpak gkalpak commented Feb 17, 2021

Copy link
Copy Markdown
Member

Several more style fixes for angular.io:

fix(docs-infra): show external link icons for external links on error pages (click to expand)

This commit adds error pages to the list of docs pages that have an external link icon next to links to external URLs.


fix(docs-infra): use relative URLs for internal links on error pages (click to expand)

Previously, some of the links on the error pages had URLs prefixed with https://angular.io/. This caused them to be treated as external URLs, which had the following downsides:

  • Links would always point to angular.io instead of the same version as the error page (e.g. next.angular.io or v11.angular.io).
  • Dgeni would not be able to check that the URLs are valid (i.e. point to existing pages).
  • An external link icon would incorrectly be shown next to the links on angular.io.

This commit fixes the links to use relative URLs.


fix(docs-infra): show the "Errors List" page under "ERRORS" in search results (click to expand)

Previously, the "Errors List" page was appearing under the "OTHER" section in search results.

This commit fixes this to make it appear under the "ERRORS" section.

Before:

search-results before

After:

search-results after


fix(docs-infra): merge `docs` with `guide` and `start` with `tutorial` in search-results (click to expand)

Previously, the docs.md guide was appearing under "OTHER" in search results and the results for the /start* tutorial pages were appearing under "START".

This commit changes this so that docs.md appears under "GUIDES" and /start* appear under "TUTORIALS", since that is where they belong conceptually.

It also changes the header of the guides search-area from "GUIDE" to "GUIDES" and that of tutorials from "TUTORIAL" to "TUTORIALS".

Before:

search-results areas before

After:

search-results areas after


refactor(docs-infra): remove unused CSS for the version selector (click to expand)

This commit removes some CSS rules targeting .doc-version select in the sidenav. These rules do not match any elements any more, since now we use a custom <aio-select> component (instead of the <select> element).


refactor(docs-infra): remove unnecessary `font-family` styles (click to expand)

This commit removes some unnecessary styles setting font-family to $main-font. These styles are redundant, because the targeted elements already inherit this style from <body>.


fix(docs-infra): ensure the main font is applied to search inputs (click to expand)

It turns out that <input> and <button> elements do not inherit the font-family style from <body> by default, but rather use a user-agent defined style. This means that their font-family might be different than the one used in the rest of the page.

This commit fixes it by ensuring <input> (and other) elements inherit their font-family style from their parent element.

Before:

inputs font before

After:

inputs font after

(The difference in font is subtle, but it's there.)


refactor(docs-infra): create mixin for styling docs pages (click to expand)

Previously, in order to apply some styles to docs (i.e. non-marketing) pages, we listed the various .folder-* classes that corresponded to docs pages. This meant that adding/removing a docs area required updates in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to docs pages.


fix(docs-infra): add spacing between past and future events sections (click to expand)

This commit adds some more spacing between the past and future events sections on the "Events" page.

Before:

events spacing before

After:

events spacing after


fix(docs-infra): make the "Contributors" page header similar to other marketing pages (click to expand)

Before (wide screen):

contributors (wide screen) before

Before (narrow screen):

contributors (narrow screen) before

After (wide screen):

contributors (wide screen) after

After (narrow screen):

contributors (narrow screen) after


fix(docs-infra): make top-nav consistent across all marketing pages (click to expand)

Previously, some of the marketing pages had different styles for the top-nav than others (even if they had the same layout and blue-background header). More specifically, the top-nav had a box-shadow and it was absolutely positioned on some marketing pages, while it had no box-shadow and was statically positioned on others.

This commit makes the appearance of marketing pages wrt the top-nav consistent across all marketing pages by changing the styles for the remaining pages:

  • Contributors (/about)
  • Contribute (/contribute)
  • Press kit (/presskit)

Before:

contribute topnav shadow before

After:

contribute topnav shadow after


fix(docs-infra): use consistent padding in marketing pages (click to expand)

This commit makes the padding of the "Events", "Features" and "Press kit" pages consistent with that of other marketing pages.

Before:

presskit padding before

After:

presskit padding after


fix(docs-infra): fix top margin of "Press kit" page on small screens (click to expand)

Previously, the "Press kit" page had a larger top margin on smaller screens, that seemed unnecessary.

This commit removes the extra top margin.

Before:

presskit top section margin before

After:

presskit top section margin after


refactor(docs-infra): remove duplicate or unused CSS styles (click to expand)

This commit removes some CSS styles that have no effect (i.e. are duplicates or overridden by other rules).


refactor(docs-infra): create mixin for styling marketing pages (click to expand)

Previously, in order to apply some styles to marketing (i.e. non-docs) pages, we listed the various .page-* classes that corresponded to docs pages. This meant that adding/removing a marketing page required updates in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to marketing pages.

@gkalpak gkalpak added type: bug/fix action: review The PR is still awaiting reviews from at least one requested reviewer refactoring Issue that involves refactoring or code-cleanup comp: docs-infra target: patch This PR is targeted for the next patch release labels Feb 17, 2021
@gkalpak gkalpak added this to the docs-infra-aio-app milestone Feb 17, 2021
@google-cla google-cla Bot added the cla: yes label Feb 17, 2021
@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@gkalpak
gkalpak marked this pull request as ready for review February 17, 2021 12:47
@pullapprove
pullapprove Bot requested a review from IgorMinar February 17, 2021 12:47
@gkalpak
gkalpak requested review from aikithoughts, kapunahelewong and petebacondarwin and removed request for IgorMinar February 17, 2021 12:47

@kapunahelewong kapunahelewong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super, @gkalpak! Thank you so much! 🌼

LGTM

Reviewed-for: global-docs-approvers

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! A couple of minor NITs that you can consider.

In this commit:

fix(docs-infra): ensure the main font is applied to search inputs

Given that you are also fixing "other inputs" as well, perhaps remove the word search from the commit title?

Comment thread aio/src/styles/1-layouts/_top-menu.scss Resolved
@pullapprove
pullapprove Bot requested a review from alxhub February 17, 2021 15:08

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@pullapprove
pullapprove Bot requested a review from jelbourn February 17, 2021 16:40
@mary-poppins

Copy link
Copy Markdown

Comment thread aio/src/styles/_mixins.scss Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this file already existed, but this might be a good opportunity to move content into more specifically-named files. I consider having files named e.g. "mixins.scss" to be an anti-pattern and would recommend separate files named based on what they target.

(could also be a follow-up at some point in the future)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it for a future clean-up 😁
(TBH, I am not sure what files the mixins would be split out to 😅)

Comment thread aio/src/styles/_mixins.scss Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sass mixins are conventionally named with dash-case (though I see this file already was using camelCase for one)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I had no idea 😁
I updated the newly added mixins and added one more commit to change deployTheme() to deploy-theme().

Comment thread aio/src/styles/_mixins.scss Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SassDoc typically uses a triple-slash (///) rather than block-style comments (/** */) since the latter are CSS-comments that can be emitted into the output CSS rather than Sass comments that are always omitted.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@pullapprove
pullapprove Bot requested a review from jelbourn February 17, 2021 21:39

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: public-api

@pullapprove
pullapprove Bot requested a review from jessicajaniuk February 17, 2021 21:39
atscott pushed a commit that referenced this pull request Feb 19, 2021
Previously, in order to apply some styles to docs (i.e. non-marketing)
pages, we listed the various `.folder-*` classes that corresponded to
docs pages. This meant that adding/removing a docs area required updates
in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to
docs pages.

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
…40881)

Previously, some of the marketing pages had different styles for the
top-nav than others (even if they had the same layout and
blue-background header). More specifically, the top-nav had a box-shadow
and it was absolutely positioned on some marketing pages, while it had
no box-shadow and was statically positioned on others.

This commit makes the appearance of marketing pages wrt the top-nav
consistent across all marketing pages by changing the styles for the
remaining pages:
- Contributors (`/about`)
- Contribute (`/contribute`)
- Press kit (`/presskit`)

Before: ![contribute topnav shadow before][1]
After: ![contribute topnav shadow after][2]

[1]: https://user-images.githubusercontent.com/8604205/107984898-a6aaee00-6fd1-11eb-8bf3-79393c8983ff.png
[2]: https://user-images.githubusercontent.com/8604205/107984900-a7438480-6fd1-11eb-8d9b-a643d69ab692.png

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
atscott pushed a commit that referenced this pull request Feb 19, 2021
This commit removes some CSS styles that have no effect (i.e. are
duplicates or overridden by other rules).

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
Previously, in order to apply some styles to marketing (i.e. non-docs)
pages, we listed the various `.page-*` classes that corresponded to docs
pages. This meant that adding/removing a marketing page required updates
in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to
marketing pages.

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
… to follow Sass conventions (#40881)

This commit converts the last remaining camelCased Sass mixin
(`deployTheme`) to kebab-case (`deploy-theme`) to follow the Sass
conventions.

Discussed in
#40881 (comment).

PR Close #40881
@atscott atscott closed this in 51c7d32 Feb 19, 2021
atscott pushed a commit that referenced this pull request Feb 19, 2021
…40881)

Previously, some of the links on the error pages had URLs prefixed with
`https://angular.io/`. This caused them to be treated as external URLs,
which had the following downsides:
- Links would always point to `angular.io` instead of the same version
  as the error page (e.g. `next.angular.io` or `v11.angular.io`).
- Dgeni would not be able to check that the URLs are valid (i.e. point
  to existing pages).
- An external link icon would incorrectly be shown next to the links on
  `angular.io`.

This commit fixes the links to use relative URLs.

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
atscott pushed a commit that referenced this pull request Feb 19, 2021
…` in search-results (#40881)

Previously, the `docs.md` guide was appearing under "OTHER" in search
results and the results for the `/start*` tutorial pages were appearing
under "START".

This commit changes this so that `docs.md` appears under "GUIDES" and
`/start*` appear under "TUTORIALS", since that is where they belong
conceptually.

It also changes the header of the guides search-area from "GUIDE" to
"GUIDES" and that of tutorials from "TUTORIAL" to "TUTORIALS".

Before: ![search-results areas before][1]
After: ![search-results areas after][2]

[1]: https://user-images.githubusercontent.com/8604205/107811568-0ce80480-6d77-11eb-8652-e7a947c36e63.png
[2]: https://user-images.githubusercontent.com/8604205/107811569-0eb1c800-6d77-11eb-9a69-0000a3703c8a.png

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
)

This commit removes some CSS rules targeting `.doc-version select` in
the sidenav. These rules do not match any elements any more, since now
we use a custom `<aio-select>` component (instead of the `<select>`
element).

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
This commit removes some unnecessary styles setting `font-family` to
`$main-font`. These styles are redundant, because the targeted elements
already inherit this style from `<body>`.

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
It turns out that `<input>` and `<button>` elements do not inherit the
`font-family` style from `<body>` by default, but rather use a
user-agent defined style. This means that their font-family might be
different than the one used in the rest of the page.

This commit fixes it by ensuring `<input>` (and other) elements inherit
their `font-family` style from their parent element.

Before: ![inputs font before][1]
After: ![inputs font after][2]

(The difference in font is subtle, but it's there.)

[1]: https://user-images.githubusercontent.com/8604205/107853245-76bae980-6e1d-11eb-8318-e5f6e13876cc.png
[2]: https://user-images.githubusercontent.com/8604205/107853246-77538000-6e1d-11eb-86f2-e3e7e41158f5.png

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
Previously, in order to apply some styles to docs (i.e. non-marketing)
pages, we listed the various `.folder-*` classes that corresponded to
docs pages. This meant that adding/removing a docs area required updates
in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to
docs pages.

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
…40881)

Previously, some of the marketing pages had different styles for the
top-nav than others (even if they had the same layout and
blue-background header). More specifically, the top-nav had a box-shadow
and it was absolutely positioned on some marketing pages, while it had
no box-shadow and was statically positioned on others.

This commit makes the appearance of marketing pages wrt the top-nav
consistent across all marketing pages by changing the styles for the
remaining pages:
- Contributors (`/about`)
- Contribute (`/contribute`)
- Press kit (`/presskit`)

Before: ![contribute topnav shadow before][1]
After: ![contribute topnav shadow after][2]

[1]: https://user-images.githubusercontent.com/8604205/107984898-a6aaee00-6fd1-11eb-8bf3-79393c8983ff.png
[2]: https://user-images.githubusercontent.com/8604205/107984900-a7438480-6fd1-11eb-8d9b-a643d69ab692.png

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
atscott pushed a commit that referenced this pull request Feb 19, 2021
This commit removes some CSS styles that have no effect (i.e. are
duplicates or overridden by other rules).

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
Previously, in order to apply some styles to marketing (i.e. non-docs)
pages, we listed the various `.page-*` classes that corresponded to docs
pages. This meant that adding/removing a marketing page required updates
in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to
marketing pages.

PR Close #40881
atscott pushed a commit that referenced this pull request Feb 19, 2021
… to follow Sass conventions (#40881)

This commit converts the last remaining camelCased Sass mixin
(`deployTheme`) to kebab-case (`deploy-theme`) to follow the Sass
conventions.

Discussed in
#40881 (comment).

PR Close #40881
@gkalpak
gkalpak deleted the fix-aio-styles-3 branch February 19, 2021 18:48
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes refactoring Issue that involves refactoring or code-cleanup target: patch This PR is targeted for the next patch release type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants