Skip to content

fix(docs-infra): several style fixes for angular.io - #40802

Closed
gkalpak wants to merge 10 commits into
angular:masterfrom
gkalpak:fix-aio-styles-2
Closed

gkalpak wants to merge 10 commits into
angular:masterfrom
gkalpak:fix-aio-styles-2

Conversation

@gkalpak

@gkalpak gkalpak commented Feb 11, 2021 •

Copy link
Copy Markdown
Member

Several style fixes for angular.io:

fix(docs-infra): clear unneeded DOM nodes in `CodeExample/TabsComponent` (click to expand)

Both CodeExampleComponent and CodeTabsComponent components receive some code via content projection, glab the projected content and pass it through to a CodeComponent instance for formatting and displaying.

Previously, the projected content was kept in the DOM (hidden). This unnecessarily increased the number of DOM nodes.

This commit fixes this by clearing the projected DOM nodes once their content has been captured.


fix(docs-infra): fix vertical alignment of contributor info items (click to expand)

This commit fixes the vertical alignment of info items (i.e. links to bio, Twitter, website) in the contributor list.

Before:

contributor alignment before

After:

contributor alignment after


fix(docs-infra): dim line-numbers in code examples (click to expand)

This commit ensures that the line-numbers in code examples appear "dimmed" to make it clearer that they are not part of the actual code.

Based on the CSS rules, it seems that the intention was to make it so, but the color was incorrectly set on the <ol> elements instead of targeting li::marker.

Before:

line-numbers before

After:

line-numbers after


fix(docs-infra): fix search results top padding when a notification is visible (click to expand)

Previously, when a notification was visible at the top of the page, the search results pane had more top padding than necessary.

This commit fixes it by removing the extra padding.

Before:

search-results after

After:

search-results before


fix(docs-infra): avoid page-breaks inside an image when printing (click to expand)

Previously, when printing, a page-break could be inserted inside an image (contained in a .lightbox element).

This commit ensures no page-breaks are inserted inside .lightbox elements (which contain images).

Before:

print-page-break before

After:

print-page-break after


fix(docs-infra): improve line-spacing between search results (esp. for wrapped lines) (click to expand)

Previously, the line-spacing between different search result itemswas the same as that between wrapped lines of the same result. This made it diffucult to distinguish the different results.

This commit fixes it by reducing the line-spacing between wrapped lines of the same result item and keeping a larger line-spacing between different results.

Before:

search-results before

After:

search-results after


fix(docs-infra): fix sidenav top position on narrow screens (click to expand)

On larger screens the top-bar has a height of 64px. On screens smaller than 600px, the top-bar has a height of 56px. As a result, the sidenav should have a top position of 56px on screens smaller than 600px and 64px on other screens.

Previously, the style setting the top position to 56px was tied to the presense of the .collapsed class, which depends on whether the sidenav is docked or not. The change from docked to collapsed sidenav, however, happens at 992px. As a result, e sidenav had an incorrect top possition (56px instead of 64px) on screens between 600px and 991px.

This commit fixes this by ensuring the change of the top position for the sidenav happens at 600px.


fix(docs-infra): improve line-spacing between TOC items (esp. for wrapped lines) cClick to expand)

Previously, the line-spacing between different TOC items was almost the same as that between wrapped lines of the same item. This made it more diffucult to distinguish the different items.

This commit fixes this by reducing the line-spacing between wrapped lines of the same item and keeping a larger line-spacing between different items.

Before:

toc line-spacing before

After:

toc line-spacing after


fix(docs-infra): fix placement of TOC hover/active markers (dots) (click to expand)

This commit fixes the placement of the TOC hover/active markers (dots) so that they are horizontally in the middle of the marker "rail" and vertically in the middle of the first item line.

This commit also refactor the _toc.scss to be more DRY (wrt ot styling the TOC markers/marker rail) and uses Sass variables and mixins to ensure that the styling is kept up-to-date wrt to future typography changes to TOC items.

Before:

toc marker before

After:

toc marker after


fix(docs-infra): fix top padding of main content when a notification is visible (click to expand)

This commit fixes the top padding of the main content on the homepage and other pages when a notification is visible at the top of the page.
The problem was particularly obvious on the homepage (see images below).

Before:

homepage top-right before

After:

homepage top-right after

@google-cla google-cla Bot added the cla: yes label Feb 11, 2021
@gkalpak gkalpak added comp: docs-infra target: patch This PR is targeted for the next patch release type: bug/fix and removed cla: yes labels Feb 11, 2021
@ngbot ngbot Bot added this to the Backlog milestone Feb 11, 2021
@google-cla google-cla Bot added the cla: yes label Feb 11, 2021
@ngbot ngbot Bot modified the milestone: Backlog Feb 11, 2021
@google-cla

This comment has been minimized.

@gkalpak gkalpak modified the milestones: Backlog, docs-infra-aio-app Feb 11, 2021
@mary-poppins

Copy link
Copy Markdown

@gkalpak
gkalpak marked this pull request as ready for review February 11, 2021 16:48
@gkalpak gkalpak added the action: merge The PR is ready for merge by the caretaker label Feb 11, 2021
@mary-poppins

Copy link
Copy Markdown

@petebacondarwin

petebacondarwin commented Feb 13, 2021 •

Copy link
Copy Markdown
Contributor

Commit typo in fix(docs-infra): fix placement of TOC hover/active markers (dots)

This commit also refactors the _toc.scss to be more DRY (wrt to styling

@petebacondarwin

petebacondarwin commented Feb 13, 2021 •

Copy link
Copy Markdown
Contributor

Commit typos in: fix(docs-infra): fix sidenav top position on narrow screens

presence of the .collapsed class, which depends on whether the sidenav
...
happens at 992px. As a result, the sidenav had an incorrect top possition
(56px instead of 64px) on screens between 600px and 991px.

@petebacondarwin

Copy link
Copy Markdown
Contributor

Commit typo in fix(docs-infra): improve line-spacing between search results (esp. for wrapped lines)

Previously, the line-spacing between different search result items _ was
...
difficult to distinguish the different results.

@petebacondarwin

Copy link
Copy Markdown
Contributor

Typo in commit fix(docs-infra): clear unneeded DOM nodes in CodeExample/TabsComponent

some code via content projection, grab the projected content and pass it

@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.

Awesome improvements @gkalpak - I love love love the before and after screenshots.

@petebacondarwin petebacondarwin added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Feb 13, 2021
Both `CodeExampleComponent` and `CodeTabsComponent` components receive
some code via content projection, grab the projected content and pass it
through to a `CodeComponent` instance for formatting and displaying.

Previously, the projected content was kept in the DOM (hidden). This
unnecessarily increased the number of DOM nodes.

This commit fixes this by clearing the projected DOM nodes once their
content has been captured.
This commit ensures that the line-numbers in code examples appear
"dimmed" to make it clearer that they are not part of the actual code.

Based on the CSS rules, it seems that the intention was to make it so,
but the color was incorrectly set on the `<ol>` elements instead of
targeting `li::marker`.

Before: ![line-numbers before][1]
After: ![line-numbers after][2]

[1]: https://user-images.githubusercontent.com/8604205/106937191-23aeab80-6726-11eb-9178-bdc067fa3d09.png
[2]: https://user-images.githubusercontent.com/8604205/106937184-227d7e80-6726-11eb-81d1-f709537b6a56.png
…s visible

Previously, when a notification was visible at the top of the page, the
search results pane had more top padding than necessary.

This commit fixes it by removing the extra padding.

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

[1]: https://user-images.githubusercontent.com/8604205/106938100-3970a080-6727-11eb-8ae8-4e7a33af1daf.png
[2]: https://user-images.githubusercontent.com/8604205/106938103-3aa1cd80-6727-11eb-96f5-f607bde314be.png
Previously, when printing, a page-break could be inserted inside an
image (contained in a `.lightbox` element).

This commit ensures no page-breaks are inserted inside `.lightbox`
elements (which contain images).

Before: ![print-page-break before][1]
After: ![print-page-break after][2]

[1]: https://user-images.githubusercontent.com/8604205/106939709-48f0e900-6729-11eb-912c-e5cd0cb40897.png
[2]: https://user-images.githubusercontent.com/8604205/106939707-48585280-6729-11eb-8d5f-a12312f32056.png
This commit fixes the placement of the TOC hover/active markers (dots)
so that they are horizontally in the middle of the marker "rail" and
vertically in the middle of the item's first line.

This commit also refactors the `_toc.scss` to be more DRY (wrt styling
the TOC markers/marker rail) and uses Sass variables and mixins to
ensure that the styling is kept up-to-date wrt future typography changes
to TOC items.

Before: ![toc marker before][1]
After: ![toc marker after][2]

[1]: https://user-images.githubusercontent.com/8604205/107270751-03e3f400-6a54-11eb-9d77-5b0a3cfb1c2b.png
[2]: https://user-images.githubusercontent.com/8604205/107270758-047c8a80-6a54-11eb-82c0-98b832c109a3.png
…is visible

This commit fixes the top padding of the main content on the homepage
and other pages when a notification is visible at the top of the page.
The problem was particularly obvious on the homepage (see images below).

Before: ![homepage top-right before][1]
After: ![homepage top-right after][2]

[1]: https://user-images.githubusercontent.com/8604205/107394349-74e2e480-6b04-11eb-8853-71a153cdc459.png
[2]: https://user-images.githubusercontent.com/8604205/107394336-71e7f400-6b04-11eb-9ef0-ff82f6f27875.png
@gkalpak gkalpak removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Feb 13, 2021
@mary-poppins

Copy link
Copy Markdown

josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…nt` (#40802)

Both `CodeExampleComponent` and `CodeTabsComponent` components receive
some code via content projection, grab the projected content and pass it
through to a `CodeComponent` instance for formatting and displaying.

Previously, the projected content was kept in the DOM (hidden). This
unnecessarily increased the number of DOM nodes.

This commit fixes this by clearing the projected DOM nodes once their
content has been captured.

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
This commit ensures that the line-numbers in code examples appear
"dimmed" to make it clearer that they are not part of the actual code.

Based on the CSS rules, it seems that the intention was to make it so,
but the color was incorrectly set on the `<ol>` elements instead of
targeting `li::marker`.

Before: ![line-numbers before][1]
After: ![line-numbers after][2]

[1]: https://user-images.githubusercontent.com/8604205/106937191-23aeab80-6726-11eb-9178-bdc067fa3d09.png
[2]: https://user-images.githubusercontent.com/8604205/106937184-227d7e80-6726-11eb-81d1-f709537b6a56.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…s visible (#40802)

Previously, when a notification was visible at the top of the page, the
search results pane had more top padding than necessary.

This commit fixes it by removing the extra padding.

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

[1]: https://user-images.githubusercontent.com/8604205/106938100-3970a080-6727-11eb-8ae8-4e7a33af1daf.png
[2]: https://user-images.githubusercontent.com/8604205/106938103-3aa1cd80-6727-11eb-96f5-f607bde314be.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
)

Previously, when printing, a page-break could be inserted inside an
image (contained in a `.lightbox` element).

This commit ensures no page-breaks are inserted inside `.lightbox`
elements (which contain images).

Before: ![print-page-break before][1]
After: ![print-page-break after][2]

[1]: https://user-images.githubusercontent.com/8604205/106939709-48f0e900-6729-11eb-912c-e5cd0cb40897.png
[2]: https://user-images.githubusercontent.com/8604205/106939707-48585280-6729-11eb-8d5f-a12312f32056.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…r wrapped lines) (#40802)

Previously, the line-spacing between different search result items was
the same as that between wrapped lines of the same result. This made it
difficult to distinguish the different results.

This commit fixes it by reducing the line-spacing between wrapped lines
of the same result item and keeping a larger line-spacing between
different results.

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

[1]: https://user-images.githubusercontent.com/8604205/107229685-ca48c400-6a26-11eb-8161-0c0768b10a2d.png
[2]: https://user-images.githubusercontent.com/8604205/107229691-ccab1e00-6a26-11eb-9594-d4c37d0d72b2.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
On larger screens the top-bar has a height of 64px. On screens smaller
than 600px, the top-bar has a height of 56px. As a result, the sidenav
should have a top position of 56px on screens smaller than 600px and
64px on other screens.

Previously, the style setting the top position to 56px was tied to the
presence of the `.collapsed` class, which depends on whether the sidenav
is docked or not. The change from docked to collapsed sidenav, however,
happens at 992px. As a result, the sidenav had an incorrect top position
(56px instead of 64px) on screens between 600px and 991px.

This commit fixes this by ensuring the change of the top position for
the sidenav happens at 600px.

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…pped lines) (#40802)

Previously, the line-spacing between different TOC items was almost the
same as that between wrapped lines of the same item. This made it more
diffucult to distinguish the different items.

This commit fixes this by reducing the line-spacing between wrapped
lines of the same item and keeping a larger line-spacing between
different items.

Before: ![toc line-spacing before][1]
After: ![toc line-spacing after][2]

[1]: https://user-images.githubusercontent.com/8604205/107255272-ccb81780-6a40-11eb-9612-4e7b2058417d.png
[2]: https://user-images.githubusercontent.com/8604205/107255280-cd50ae00-6a40-11eb-8f60-9ce8fba10e12.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…0802)

This commit fixes the placement of the TOC hover/active markers (dots)
so that they are horizontally in the middle of the marker "rail" and
vertically in the middle of the item's first line.

This commit also refactors the `_toc.scss` to be more DRY (wrt styling
the TOC markers/marker rail) and uses Sass variables and mixins to
ensure that the styling is kept up-to-date wrt future typography changes
to TOC items.

Before: ![toc marker before][1]
After: ![toc marker after][2]

[1]: https://user-images.githubusercontent.com/8604205/107270751-03e3f400-6a54-11eb-9d77-5b0a3cfb1c2b.png
[2]: https://user-images.githubusercontent.com/8604205/107270758-047c8a80-6a54-11eb-82c0-98b832c109a3.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…is visible (#40802)

This commit fixes the top padding of the main content on the homepage
and other pages when a notification is visible at the top of the page.
The problem was particularly obvious on the homepage (see images below).

Before: ![homepage top-right before][1]
After: ![homepage top-right after][2]

[1]: https://user-images.githubusercontent.com/8604205/107394349-74e2e480-6b04-11eb-8853-71a153cdc459.png
[2]: https://user-images.githubusercontent.com/8604205/107394336-71e7f400-6b04-11eb-9ef0-ff82f6f27875.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
This commit ensures that the line-numbers in code examples appear
"dimmed" to make it clearer that they are not part of the actual code.

Based on the CSS rules, it seems that the intention was to make it so,
but the color was incorrectly set on the `<ol>` elements instead of
targeting `li::marker`.

Before: ![line-numbers before][1]
After: ![line-numbers after][2]

[1]: https://user-images.githubusercontent.com/8604205/106937191-23aeab80-6726-11eb-9178-bdc067fa3d09.png
[2]: https://user-images.githubusercontent.com/8604205/106937184-227d7e80-6726-11eb-81d1-f709537b6a56.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…s visible (#40802)

Previously, when a notification was visible at the top of the page, the
search results pane had more top padding than necessary.

This commit fixes it by removing the extra padding.

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

[1]: https://user-images.githubusercontent.com/8604205/106938100-3970a080-6727-11eb-8ae8-4e7a33af1daf.png
[2]: https://user-images.githubusercontent.com/8604205/106938103-3aa1cd80-6727-11eb-96f5-f607bde314be.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
)

Previously, when printing, a page-break could be inserted inside an
image (contained in a `.lightbox` element).

This commit ensures no page-breaks are inserted inside `.lightbox`
elements (which contain images).

Before: ![print-page-break before][1]
After: ![print-page-break after][2]

[1]: https://user-images.githubusercontent.com/8604205/106939709-48f0e900-6729-11eb-912c-e5cd0cb40897.png
[2]: https://user-images.githubusercontent.com/8604205/106939707-48585280-6729-11eb-8d5f-a12312f32056.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…r wrapped lines) (#40802)

Previously, the line-spacing between different search result items was
the same as that between wrapped lines of the same result. This made it
difficult to distinguish the different results.

This commit fixes it by reducing the line-spacing between wrapped lines
of the same result item and keeping a larger line-spacing between
different results.

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

[1]: https://user-images.githubusercontent.com/8604205/107229685-ca48c400-6a26-11eb-8161-0c0768b10a2d.png
[2]: https://user-images.githubusercontent.com/8604205/107229691-ccab1e00-6a26-11eb-9594-d4c37d0d72b2.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
On larger screens the top-bar has a height of 64px. On screens smaller
than 600px, the top-bar has a height of 56px. As a result, the sidenav
should have a top position of 56px on screens smaller than 600px and
64px on other screens.

Previously, the style setting the top position to 56px was tied to the
presence of the `.collapsed` class, which depends on whether the sidenav
is docked or not. The change from docked to collapsed sidenav, however,
happens at 992px. As a result, the sidenav had an incorrect top position
(56px instead of 64px) on screens between 600px and 991px.

This commit fixes this by ensuring the change of the top position for
the sidenav happens at 600px.

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…pped lines) (#40802)

Previously, the line-spacing between different TOC items was almost the
same as that between wrapped lines of the same item. This made it more
diffucult to distinguish the different items.

This commit fixes this by reducing the line-spacing between wrapped
lines of the same item and keeping a larger line-spacing between
different items.

Before: ![toc line-spacing before][1]
After: ![toc line-spacing after][2]

[1]: https://user-images.githubusercontent.com/8604205/107255272-ccb81780-6a40-11eb-9612-4e7b2058417d.png
[2]: https://user-images.githubusercontent.com/8604205/107255280-cd50ae00-6a40-11eb-8f60-9ce8fba10e12.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…0802)

This commit fixes the placement of the TOC hover/active markers (dots)
so that they are horizontally in the middle of the marker "rail" and
vertically in the middle of the item's first line.

This commit also refactors the `_toc.scss` to be more DRY (wrt styling
the TOC markers/marker rail) and uses Sass variables and mixins to
ensure that the styling is kept up-to-date wrt future typography changes
to TOC items.

Before: ![toc marker before][1]
After: ![toc marker after][2]

[1]: https://user-images.githubusercontent.com/8604205/107270751-03e3f400-6a54-11eb-9d77-5b0a3cfb1c2b.png
[2]: https://user-images.githubusercontent.com/8604205/107270758-047c8a80-6a54-11eb-82c0-98b832c109a3.png

PR Close #40802
josephperrott pushed a commit that referenced this pull request Feb 16, 2021
…is visible (#40802)

This commit fixes the top padding of the main content on the homepage
and other pages when a notification is visible at the top of the page.
The problem was particularly obvious on the homepage (see images below).

Before: ![homepage top-right before][1]
After: ![homepage top-right after][2]

[1]: https://user-images.githubusercontent.com/8604205/107394349-74e2e480-6b04-11eb-8853-71a153cdc459.png
[2]: https://user-images.githubusercontent.com/8604205/107394336-71e7f400-6b04-11eb-9ef0-ff82f6f27875.png

PR Close #40802
@gkalpak
gkalpak deleted the fix-aio-styles-2 branch February 16, 2021 16:50
@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 19, 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 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.

3 participants