Commit Graph

921 Commits

Author SHA1 Message Date
Pete Bacon Darwin 14a64acb72 build(docs-infra): store search dictionary as a string (#41447)
Previously, the search index info file contained an array of strings that is
the dictionary of terms in the corpus.
Storing this as a space separated string reduces the size of the file.

PR Close #41447
2021-04-07 13:51:08 -07:00
Pete Bacon Darwin fccffc647b refactor(docs-infra): include more info in search index data (#41368)
The AIO search index is built in a WebWorker on the browser from a set
of page information that is downloaded as a JSON file (`search-data.json`).
We want to keep this file as small as possible while providing enough
data to generate a useful index to query against.

Previously, we only included one copy of each (non-ignored) term from each
doc but this prevents more subtle ranking of query results, since the number
of occurences of a term in a doc is lost.

This commit changes the generated file in the following ways:

- All non-ignored terms are now included in the order in which they appear
  in the doc.
- The terms are indexed into a dictonary to avoid the text of the term being
  repeated in every doc that contains the term.
- Each term is pre-"stemmed" using the same Porter Stemming algorith that the
  Lunr search engine uses.

The web-worker has been updated to decode the new format of the file.
Now that all terms are included, it may enable some level of phrase based
matching in the future.

The size of the generated file is considerably larger than previously, but
on production HTTP servers the data is sent compressed, which reduces the
size dramatically.

PR Close #41368
2021-04-01 12:02:37 -07:00
Pete Bacon Darwin 55f7f1d446 feat(docs-infra): improve search query processing (#41368)
This commit tries to improve the search results by processing
the query and attempting progressively less restrictive searches
until a non-zero set of pages is matched.

The new procesing includes:

* stripping off quote marks, which were causing searches to fail
* first attempting to match pages where ALL the query terms exist
* second attempting to match pages where ANY of the query terms exist
* third attempting to match pages where the title contains partial word matches

The first query attempt approximates, quite well, the idea of searching
for multi-word phrases. This is given the technical nature of the terms
and the fairly small size of the corpus.

PR Close #41368
2021-04-01 12:02:37 -07:00
George Kalpakas 3470ea17d5 fix(docs-infra): increase the max width of the `file-not-found` page (#41275)
Previously, the max width of the `file-not-found` page was limited to
50rem (800px by default). This allowed little space for showing
potentially helpful search results, which are shown in columns).

This commit increases the max width of the `file-not-found` page to
84rem (1344px by default) to allow search results to be visible without
requiring scrolling. This will not negatively affect UX, because the
page uses a multi-column layout and therefore there will rarely be long
lines of text to scan.

PR Close #41275
2021-04-01 11:36:44 -07:00
George Kalpakas 3cda3e6a32 fix(docs-infra): correctly show search results on narrow screens (#41275)
Previously, some part of the search results would be hidden and
inaccessible on narrow screens. This was caused by an issue with the
flexbox layout. See [here][1] for more info on the issue and the
available solutions.
NOTE: This issue affected both the search results shown when using the
search box (on the top right of the page) as well as the search results
shown in the `file-not-found` page.

This commit changes how the layout of search results is achieved to
ensure they are always accessible via scrolling on all screen sizes
(while keeping the same layout on larger screens).

Before: ![search results at 768px before][2]
After: ![search results at 768px after][3]

[1]: https://stackoverflow.com/questions/33454533/cant-scroll-to-top-of-flex-item-that-is-overflowing-container#33455342
[2]: https://user-images.githubusercontent.com/8604205/111772790-efe2ac00-88b5-11eb-925d-a80faeaa5369.png
[3]: https://user-images.githubusercontent.com/8604205/111772810-f5d88d00-88b5-11eb-8b2a-60bdc3736ea3.png

PR Close #41275
2021-04-01 11:36:44 -07:00
George Kalpakas 8d457ab2e1 fix(docs-infra): fix `<code-tabs>` in IE11 (#41183)
Previously, `<code-tabs>` did not work correctly in IE11. More
specifically, due to how IE11 handles updates to `innerHTML`, the
contents of `<code-pane>` elements were cleared before we could capture
them and pass them to the `<aio-code>` components.

This commit fixes it by ensuring we capture the `<code-pane>` contents
before clearing unneeded HTML.

Before: ![code tabs in IE11 before][1]
After: ![code tabs in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110815248-f4460e00-8292-11eb-868e-eca7ba5e9cd3.png
[2]: https://user-images.githubusercontent.com/8604205/110815253-f5773b00-8292-11eb-80a6-1a0b1ea44d8f.png

PR Close #41183
2021-03-12 13:22:57 -08:00
George Kalpakas ea00e2c0b4 fix(docs-infra): fix display of AngularJS logo on the "Press kit" page in IE11 (#41183)
Previously, the AngularJS SVG logo shown on the "Press kit" page was not
displayed correctly in IE11 (see the image below).

This commit fixes it by explicitly specifying the SVG `viewBox` on the
logo.

Before: ![presskit AngularJS logo in IE11 before][1]
After: ![presskit AngularJS logo in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110812629-7123b880-8290-11eb-9f71-0ae910536fa5.png
[2]: https://user-images.githubusercontent.com/8604205/110812633-7254e580-8290-11eb-896c-84f595d273b8.png

PR Close #41183
2021-03-12 13:22:57 -08:00
George Kalpakas 0d1b3fe55e fix(docs-infra): fix the layout of the "Features" page in IE11 (#41183)
IE11 does not support `justify-content: space-evenly` and therefore
falls back to the default (`flex-start`), breaking the layout of the
items in the "Features" page (see the image below).

This commit fixes the layout by specifying `space-around` as a fallback
for `justify-content`, which keeps the layout closer to the intended.

Before: ![features page layout in IE11 before][1]
After: ![features page layout in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110811038-045bee80-828f-11eb-8027-d5851762a5eb.png
[2]: https://user-images.githubusercontent.com/8604205/110811076-0a51cf80-828f-11eb-98a0-2f2928128dd0.png

PR Close #41183
2021-03-12 13:22:57 -08:00
George Kalpakas 5c0122f7fd fix(docs-infra): fix the layout of docs pages in IE11 (#41183)
IE11 does not recognize the `<main>` element as a block element and
therefore it does not apply margin/paddings/widths as expected. This
resulted in the layout of docs pages being broken in IE11 (see the image
below).

This commit fixes the layout by explicitly setting `.sidenav-content`
(which is a `<main>` element) to `display: block`.

Before: ![docs pages layout in IE11 before][1]
After: ![docs pages layout in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110808902-1b014600-828d-11eb-9eef-c1234dc2d436.png
[2]: https://user-images.githubusercontent.com/8604205/110808907-1ccb0980-828d-11eb-91d9-06e5cfafc894.png

PR Close #41183
2021-03-12 13:22:57 -08:00
George Kalpakas 8c939dcb40 fix(docs-infra): fix angular.io on browsers that support Custom Elements but not ES2015 (#41183)
Before #41162, angular.io was broken on IE 11 due to missing a polyfill
for an API (`Reflect.construct()`) needed by the Custom Elements ES5
shim. #41162 tried to fix this by loading the necessary polyfill
(`es.reflect.construct.js`) on browsers that do not support ES2015
modules (including IE 11).

It turns out that the fix in #41162 was itself broken, because the
`es.reflect.consruct.js` script (included directly in the page via a
`<script>` tag) was in CommonJS format (which cannot run in the browser
as is). By chance, this still allowed browsers that supported neither
Custom Elements nor ES2015 modules (such as IE 11) to work correctly as
a side-effect of loading the `@webcomponents/custom-elements` polyfill
after the Custom Elements ES5 shim (`native-shim.js`). However, on the
few browsers that natively support Custom Elements but not ES2015
modules, angular.io would still be broken.

This commit correctly fixes angular.io on all browsers by properly
bundling the polyfills and transpiling to ES5.

Implementation-wise, we use [esbuild][1] for bundling the polyfills (and
converting from CommonJS to a browser-compatible, IIFE-based format) and
[swc][2] for downleveling the code to ES5 (since `esbuild` only supports
ES2015+).

[1]: https://esbuild.github.io/
[2]: https://swc.rs/

PR Close #41183
2021-03-12 13:22:57 -08:00
George Kalpakas e1e766a880 fix(docs-infra): generate the `404.html` page correctly (#41163)
Previously, the generated `404.html` page did not include a `<body>`
tag. In some browsers (such as IE 11), this was causing warnings in the
console.

This commit ensures the generated page contains a `<body>` tag. It also
fixes the indentation in the generated page.

PR Close #41163
2021-03-11 09:30:03 -08:00
George Kalpakas 79e21b966e fix(docs-infra): fix angular.io on IE 11 (#41162)
Previously, the angular.io app was broken on IE 11. In particular, pages
that included Custom Elements would fail to load, because the
`Reflect.construct()` method (which the Custom Elements ES5 shim relies
on) was not available.

This commit fixes this by loading the polyfill for `Reflect.construct()`
on browsers that do not support ES2015 (including IE 11).

PR Close #41162
2021-03-11 09:25:32 -08:00
George Kalpakas d368fa2fa4 fix(docs-infra): avoid unnecessarily loading Custom Elements ES5 shim (#41162)
The custom elements spec is not compatible with ES5 style classes. This
means ES2015 code compiled to ES5 will not work with a native
implementation of Custom Elements. To support browsers that natively
support Custom Elements but not ES2015 modules, we load
`@webcomponents/custom-elements/src/native-shim.js`, which minimally
augments the native implementation to be compatible with ES5 code.
(See [here][1] for more details.)

Previously, the shim was included in `polyfills.ts`, which meant it was
loaded in all browsers (even those supporting ES2015 modules and thus
not needing the shim).

This commit moves the shim from `polyfills.ts` to a `nomodule` script
tag in `index.html`. This will ensure that it is only loaded in browsers
that do not support ES2015 modules and thus do not needed the shim.

NOTE:
This commit also reduces size of the polyfills bundle by ~400B
(52609B --> 52215B).

[1]: https://www.npmjs.com/package/@webcomponents/custom-elements#es5-vs-es2015

PR Close #41162
2021-03-11 09:25:32 -08:00
George Kalpakas f281310d39 fix(docs-infra): print info to help debugging SW cache issue (#41106)
From time to time, an angular.io page fails to load due to requesting a
file that cannot be found neither on the server nor in the cache. We
believe this is caused by the browser's partially clearing a cache.
See #28114 for more details.

Some time ago, we introduced [SwUpdate#unrecoverable][1] to help work
around this issue by [reloading the page][2] when such an error is
detected.

However, this issue still pops up occasionally (for example, #41073).

In an attempt to help diagnose the issue, this commit prints more info
regarding the SW state and cache content when this error occurs. It will
result in something like the following being printed to the console:

```
ServiceWorker: activated

Cache: ngsw:/:db:control (2 entries)
  - https://angular.io/assignments: {"f5f02035-ee1f-463c-946c-e8b85badca25":"5c95f89a85255a6fefb4045a20f751ef32b2f3a4"}
  - https://angular.io/latest: {"latest":"5c95f89a85255a6fefb4045a20f751ef32b2f3a4"}

Cache: ngsw:/:5c95f89a85255a6fefb4045a20f751ef32b2f3a4:assets:app-shell:cache (24 entries)
  - https://angular.io/0-es2015.867022f8bb092ae1efb1.worker.js
  - https://angular.io/announcement-bar-announcement-bar-module-es2015.1b5b762c9c8837c770f8.js
  - https://angular.io/api-api-list-module-es2015.40a43cd22f50f64d63bb.js
  ...

Cache: ngsw:/:db:ngsw:/:5c95f89a85255a6fefb4045a20f751ef32b2f3a4:assets:app-shell:meta (1 entries)
  - https://angular.io/https://fonts.gstatic.com/s/robotomono/v13/L0x5DF4xlVMF-BfR8bXMIjhLq3-cXbKD.woff2:
      {"ts":1615031956601,"used":true}

If you see this error, please report an issue at https://github.com/angular/angular/issues/new?template=3-docs-bug.md
including the above logs.
```

NOTE:
This change increases the main bundle by 1649B (0.37%), but it can be
reverted as soon as we gather enough info to diagnose the issue.

[1]: https://angular.io/api/service-worker/SwUpdate#unrecoverable
[2]: https://github.com/angular/angular/blob/c676ec1ce5d586d4bc46/aio/src/app/sw-updates/sw-updates.service.ts#L55-L61

PR Close #41106
2021-03-09 08:54:52 -08:00
George Kalpakas 7a27cd262f refactor(docs-infra): simplify code snippet indentation in the "Cheat sheet" guide (#41051)
Previously, the indentation of code snippets in the "Cheat sheet" guide
was done using `<br>` elements (for line breaks) and `&emsp;` HTML
entities (for space). This was laborious and put the onus on the author
to remember to use these symbols (instead of regular whitespace
characters).
(Discussed in
https://github.com/angular/angular/pull/41051#discussion_r585651621.)

This commit changes the way `<code>` elements are styles inside the
"Cheat sheet" guide to allow using regular whitespace characters in code
snippets. It also changes all `<br>`/`&emsp;` occurrences to `\n`/`  `
respectively to make code snippets more readable in the source code.

PR Close #41051
2021-03-09 08:52:52 -08:00
George Kalpakas d7398d3025 fix(docs-infra): improve the layout of the "Features" page on medium screens (#41051)
The "Features" page organizes features in groups/rows of 3 features
each. On wide screens, all 3 paragraphs of a group/row can be shown next
to each other. On narrow screens (between 768px and 1057px), the layout
changes to stack the paragraphs vertically. On medium screens, however,
there is not enough space to show more than two paragraphs next to each
other.

Previously, the 3rd paragraph was wrapped over to the next line.

This commit improves the layout on medium screens by switching to
immediately stacking the paragraphs vertically as soon as there is not
enough space for them to be displayed in one row. Since the total width
is still too much for one paragraph, the paragraphs are limited to 80%
of the total width.

Before (on 1000px width): [features page (on 1000px) before][1]
After (on 1000px width): [features page (on 1000px) after][2]

[1]: https://user-images.githubusercontent.com/8604205/109825316-62128a00-7c42-11eb-8391-650201257274.png
[2]: https://user-images.githubusercontent.com/8604205/109825323-6343b700-7c42-11eb-86c1-e8307c5a727a.png

PR Close #41051
2021-03-09 08:52:52 -08:00
George Kalpakas 1054d554d8 fix(docs-infra): avoid truncating several API list items (#41051)
Previously, with the min width of 220px per item, several API list items
were truncated.

This commit increases the min width per item to 330px, which allows
almost all items to have their full text shown. It also increases the
API list page's max content width from 50em (800px) to 62.5em (1000px)
to allow items to be shown on three columns despite their increased
width. This increase in the content width shouldn't negatively affect
UX, since the API list page uses a multi-column layout (i.e. it does not
contain 1000px-lines of text.)

Before: ![api-list before][1]
After: ![api-list after][2]

[1]: https://user-images.githubusercontent.com/8604205/109396457-5f5e1f00-793a-11eb-80cf-1418f409325a.png
[2]: https://user-images.githubusercontent.com/8604205/109396659-499d2980-793b-11eb-95d3-f54250f7fab5.png

PR Close #41051
2021-03-09 08:52:52 -08:00
George Kalpakas a926fd020b fix(docs-infra): show ellipsis when text overflows in API list items (#41051)
Previously, when an API list item's text overflowed its container, it
was just hidden. This made it often difficult to realize that there was
more text.

This commit fixes this by ensuring an ellipsis (`...`) is shown when the
text overflows.

Before: ![api-list truncated before][1]
After: ![api-list truncated after][2]

[1]: https://user-images.githubusercontent.com/8604205/109396186-0cd03300-7939-11eb-921c-00621a3889a4.png
[2]: https://user-images.githubusercontent.com/8604205/109396187-0e016000-7939-11eb-9f3b-4535be083417.png

PR Close #41051
2021-03-09 08:52:52 -08:00
George Kalpakas 304a32b655 fix(docs-infra): limit max content width on "Contributors" and "Cheat sheet" pages (#41051)
Previously, the content width on the "Contributors" page (`/about`) and
the "Cheat sheet" guide (`/guide/cheatsheet`) was unlimited (i.e. the
content would take up all the available space horizontally). This was
not very ergonomic on large screens. Especially on the "Cheat sheet"
guide there was a lot of unnecessary whitespace between the code shown
on the left column and the description shown on the right column.

This commit fixes this by setting a max content width for both pages of
84em (1404px by default). This keeps the content at a more manageable
width and avoids unnecessary whitespace.

Before (contributors): ![contributors page on 2500px before][1]
Before (cheatsheet): ![cheatsheet on 2500px before][2]
After (contributors): ![contributors page on 2500px after][3]
After (cheatsheet): ![cheatsheet on 2500px after][4]

[1]: https://user-images.githubusercontent.com/8604205/109394323-1bb1e800-792f-11eb-9cd6-c5b83e5ae921.png
[2]: https://user-images.githubusercontent.com/8604205/109394329-1fde0580-792f-11eb-91c0-4ed7ad408b17.png
[3]: https://user-images.githubusercontent.com/8604205/109394319-181e6100-792f-11eb-9463-a281dfe80448.png
[4]: https://user-images.githubusercontent.com/8604205/109394330-210f3280-792f-11eb-9837-ddc7a8d01d19.png

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas 4907d644bb refactor(docs-infra): use more consistent content width on marketing pages (#41051)
Previously, each marketing page used a different limit for its content's
width (if it had a limit at all) and implemented the width limiting in a
different way. Besides resulting in an inconsistent UX, this also made
it difficult to apply site-wide layout changes.

This commit makes the limit for most marketing pages consistent and uses
the same CSS class to make it easier to apply site-wide changes in the
future. The chosen limit is slightly larger than that of docs pages
(62.5em/1000px vs 50em/800px), because marketing pages have a different
type of content and layout (i.e. images, multi-column layout, etc.).
Finally, this commit also removes obsolete wrapper elements, CSS classes
and CSS styles, that are no longer necessary after the changes.

Notably, the homepage (`/`) and the "Contributors" page (`/about`) have
remained unchanged, because the former has its own layout that is
different from other marketing pages and the latter would offer a worse
UX with a small content width limit (as the one used on other marketing
pages).

The content widths of the rest of the marketing pages change slightly as
a result of the changes in this commit, but not in a way that would have
a negative impact on UX. More specifically:

| Page (URL)    | Size before | Size after |
|:--------------|------------:|-----------:|
| `/contribute` |       880px |     1000px |
| `/events`     |   unlimited |     1000px |
| `/features`   |       996px |     1000px |
| `/presskit`   |       800px |     1000px |
| `/resources`  |       800px |     1000px |

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas 8365bc8946 refactor(docs-infra): fix code indentation in `ContributorListComponent`'s template (#41051)
This commit fixes the indentation of the template of
`ContributorListComponent` to make it more readable.

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas 76daca800e refactor(docs-infra): remove unnecessary wrapper `<div>` from the "Cheat sheet" guide (#41051)
This commit removes an unnecessary wrapper `<div>` from the
"Cheat sheet" guide. The CSS styles that referenced the element's ID
(`#cheatsheet`) have been updated to use `.page-guide-cheatsheet`
instead.

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas f85a178a49 fix(docs-infra): fix `<code>` styling in the "Cheat sheet" guide (#41051)
Since #40944, `<code>` elements have a distinctive background to make
them stand out from regular text. However, this styling is not desirable
in certain cells of the "Cheat sheet" guide's tables, which exclusively
contain code.

This commit updates the `<code>` styling to remove the distinctive
background in those "Cheat sheet" cells.

Before #40944: ![cheatsheet code before PR 40944][1]
Since #40944: ![cheatsheet code since PR 40944][2]
After this commit: ![cheatsheet code after][3]

[1]: https://user-images.githubusercontent.com/8604205/109383633-4f215200-78f0-11eb-95e2-2a2c4fb3a31f.png
[2]: https://user-images.githubusercontent.com/8604205/109383634-50527f00-78f0-11eb-8c48-ff5f96918c4d.png
[3]: https://user-images.githubusercontent.com/8604205/109383635-50eb1580-78f0-11eb-9cf2-98851692ddd9.png

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas d80d6ea3f6 fix(docs-infra): fix styling of `<code>` elements on older browsers (#41051)
Previously, styling of `<code>` elements utilized the `:not()` CSS
pseudo-class with multiple selectors (`:not(h1, h2, ...)`). It turns out
that older browsers (such as IE11) do not support multiple selectors in
a single `:not()` instance.
(See [MDN][1] and [CanIUse][2] for more info.)

This commit fixes `<code>` styling to use multiple separate `:not()`
instances instead (`:not(h1):not(h2)...`), so that they are styled
correctly on older browsers as well.

NOTE:
This change seems to trigger some kind of bug in LightHouse that causes
the a11y score of `/start` to be calculated as 0 (which is clearly
wrong). This happens on Linux (tested on CI and locally using the
Windows Subsystem for Linux (WSL)) - on Windows the score is computed
correctly as 98/100.
([Example failure][3])

The bug seems to be related to the layout of the content and goes away
if we change the viewport size (for example, switching to LightHouse's
`desktop` config) or make another change that affects the content's
layout (for example, reducing the padding of `<code>` elements).

To work around the issue, this commit updates the `test-aio-a11y.js`
script to test `/start-routing` instead of `/start`.

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/:not#description:~:text=Using%20two%20selectors
[2]: https://caniuse.com/css-not-sel-list
[3]: https://circleci.com/gh/angular/angular/931038

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas 269d7e4d22 fix(docs-infra): improve the layout of the "Features" page on medium screens (#41051)
The "Features" page organizes features in groups/rows of 3 features
each. On wide screens, all 3 paragraphs of a group/row can be shown next
to each other. On narrow screens, the layout changes to stack the
paragraphs vertically. On medium screens, however, the 3rd paragragh is
wrapped over to the next line.

Previously, the wrapped content was left-aligned, which left a lot of
empty space on the right.

This commit improves the layout on medium screens by ensuring the
paragraphs are horizontally centered (with space distributed evenly
around them).

Before: ![features page before][1]
After: ![features page after][2]

[1]: https://user-images.githubusercontent.com/8604205/109344670-b64ef000-7877-11eb-9013-890562ff2f3d.png
[2]: https://user-images.githubusercontent.com/8604205/109344678-b7801d00-7877-11eb-9224-d7715f7d7235.png

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas 27bb6f6a04 fix(docs-infra): use a fixed top-menu on marketing pages as well (#41051)
Previously, in contrast to docs pages, marketing pages had a non-fixed
top-menu, which meant that the top-menu would scroll out of the viewport
along with the rest of the content. This had a couple of downsides:
- The UI was different between pages (i.e. different top-menu behavior
  on docs vs marketing pages).
- Since some of the marketing pages are long, it was not easy for people
  to navigate to a different page (i.e. they had to scroll all the way
  back up).

This commit improves the UX by using the same, fixed top-menu on all
pages, which restores consistency and allows the user to navigate around
more easily.

NOTE:
The old behavior (non-fixed top-menu) is kept on the homepage, since its
top-menu design in a little different than other pages (e.g. it uses a
transparent top-menu) and would not play well with a fixed top-menu.

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas 7944ee2c30 fix(docs-infra): do not underline link icons on hover (#41051)
The external links in the docs content and the download links in the
"Press kit" page have icons next to their text (an external link icon
and a download icon respectively).

Previously, when hovering over one of those links, the icons used to get
underlined along with the link text, which was not desirable.

This commit fixes it by changing the mechanics of how these icons are
positioned inside the anchor elements so that only the link text is
underlined on hover.

Before: ![external links on hover before][1]
Before: ![presskit links on hover before][2]
After: ![external links on hover after][3]
After: ![presskit links on hover after][4]

[1]: https://user-images.githubusercontent.com/8604205/109340455-b64bf180-7871-11eb-923b-3113a237b8d8.png
[2]: https://user-images.githubusercontent.com/8604205/109340461-b815b500-7871-11eb-9c9d-91b6ffb17346.png
[3]: https://user-images.githubusercontent.com/8604205/109340458-b77d1e80-7871-11eb-884c-c1093ec83e66.png
[4]: https://user-images.githubusercontent.com/8604205/109340462-b815b500-7871-11eb-8f00-702b2b61f6ac.png

PR Close #41051
2021-03-09 08:52:51 -08:00
George Kalpakas 21f0deeaa6 build(docs-infra): update Angular framework, Material and CLI to latest methods (#40994)
This commit updates the Angular framework, Angular CDK/Material and
Angular CLI to latest stable versions (11.2.3, 11.2.2 and 11.2.2
respectively).

This update also fixes a Lighthouse audit fail due to
`@angular/core@11.0.0` being identified as vulnerable to XSS:
https://snyk.io/vuln/SNYK-JS-ANGULARCORE-1070902

Regarding the payload size increases, they are mostly attributed to
Angular Material:
- Before this commit:     448461 B
- After framework update: 448554 B ( +93 B)
- After Material update:  449292 B (+738 B)
- After CLI update:       449310 B ( +18 B)

PR Close #40994
2021-03-03 09:43:56 -08:00
George Kalpakas cb16035fd3 fix(docs-infra): correctly display event dates on all timezones (#41053)
Previously, the event dates displayed on the angular.io "Events" page
(`/events`) was off by one day on timezones with a negative offset from
UTC. See
https://github.com/angular/angular/pull/41050#issuecomment-788958888.

This commit fixes it by using the `getUTC*` methods of the `Date` object
to extract the date info, which are not affected by the user's timezone.

PR Close #41053
2021-03-03 09:37:21 -08:00
twerske be8893fd1d docs: add youtube to social icons (#40987)
PR Close #40987
2021-02-26 15:50:36 -08:00
George Kalpakas 272b5645c4 fix(docs-infra): improve the layout of the "Resources" page (#40944)
This commit improves the readability of the "Resources" page by limiting
the content's max width to 50em (which is 800px by default).

It also gets rid of custom color values and either uses the default
color or colors specified via Sass variables.

Before: ![resources page before][1]
After: ![resources page after][2]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108601949-104b4380-73a8-11eb-864b-948db8c36f80.png
[2]: https://user-images.githubusercontent.com/8604205/108602036-894a9b00-73a8-11eb-870d-39bea9b46d97.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas d3eff182e3 refactor(docs-infra): clean up styling of the `<aio-resource-list>` component (#40944)
This commit cleans up the styles and the elements/classes used for
styling the content of the `<aio-resource-list>` component.

This change has been extracted from #36045.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas 00562ed935 fix(docs-infra): center the "Contribute" page (#40944)
This commit improves the layout of the "Contribute" page by centering
the content (similar to other marketing pages).

Before: ![contribute layout before][1]
After: ![contribute layout after][2]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108595056-5b545f00-7386-11eb-97b6-c3606dbfb5fa.png
[2]: https://user-images.githubusercontent.com/8604205/108595060-5becf580-7386-11eb-91fa-b2877f2a4691.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas c4a9c003cb fix(docs-infra): remove unwanted underline when hovering over contributor info links (#40944)
This commit removes an unwanted underline effect when hovering over
contributor info links (`.contributor-info > .info-item`). This was
accidentally introduced in #40427.

Before: ![contributor info on hover before][1]
After: ![contributor info on hover after][2]

[1]: https://user-images.githubusercontent.com/8604205/108560170-045a7580-7305-11eb-98d2-4302d98581c6.png
[2]: https://user-images.githubusercontent.com/8604205/108560176-058ba280-7305-11eb-97eb-74cf2c830a39.png

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas d97b45d82a fix(docs-infra): make inline code stand out more (#40944)
This commit improves the styling of inline code blocks to make them
stand out more.

Before: ![code formatting before][1]
After: ![code formatting after][2]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108554295-8e521080-72fc-11eb-94e8-09246ae334c8.png
[2]: https://user-images.githubusercontent.com/8604205/108553733-c9077900-72fb-11eb-8001-1f0baf8b95bc.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas 516de34778 fix(docs-infra): improve the appearance of `.filter-button` elements (#40944)
This commit improves the appearance of `.filter-button` elements used to
jump between different categories in "Contributors" and "Resources" pages.

Before (wide screen): ![contributors buttons (wide screen) before][1]
Before (narrow screen): ![contributors buttons (narrow screen) before][2]
After (wide screen): ![contributors buttons (wide screen) after][3]
After (narrow screen): ![contributors buttons (narrow screen) after][4]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108414895-72376c00-7235-11eb-9537-7a7b059d09fe.png
[2]: https://user-images.githubusercontent.com/8604205/108414923-782d4d00-7235-11eb-8ba4-87a3a9ae14cd.png
[3]: https://user-images.githubusercontent.com/8604205/108414929-78c5e380-7235-11eb-807a-109b4200e64e.png
[4]: https://user-images.githubusercontent.com/8604205/108414942-7cf20100-7235-11eb-8ef0-9b2da397b3ee.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas ae50e40216 refactor(docs-infra): move `.filter-button` styles inside `.group-buttons` (#40944)
Since `.filter-button` elements only appear inside `.group-buttons`
elements, this commit moves `.filter-button` CSS styles inside
`.group-buttons` styles.

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas d6f6197728 fix(docs-infra): put the license references in a separate paragraph in the footer (#40944)
This commit improves how sentences are broken up into lines in the
footer (due to the limited max-width of the content) by moving the
license references in a separate paragraph.

Before: ![footer before][1]
After: ![footer after][2]

[1]: https://user-images.githubusercontent.com/8604205/108595211-593ed000-7387-11eb-8ee5-f13c8bf522f4.png
[2]: https://user-images.githubusercontent.com/8604205/108595214-5a6ffd00-7387-11eb-9a9d-dbaa2175f51f.png

PR Close #40944
2021-02-26 15:39:29 -08:00
George Kalpakas 2475dbe7b2 refactor(docs-infra): remove redundant Sass mixin (#40944)
This commit removes the `bp()` Sass mixin, which was only used in one
place (and also included several unused code-branches).

PR Close #40944
2021-02-26 15:39:28 -08:00
George Kalpakas 2a518fb44c refactor(docs-infra): use Sass variables for colors used in themes (#40944)
This change has been extracted from #36045.

NOTE:
The color names for the RC theme were computed using
https://www.color-blindness.com/color-name-hue.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:28 -08:00
George Kalpakas 6275346871 fix(docs-infra): increase margin of header-links (#40944)
This change has been extracted from #36045.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:28 -08:00
George Kalpakas 117c49f799 fix(docs-infra): more clearly separate different sections on the "Press kit" page (#40945)
This commit adds a horizontal line and some extra spacing between
different sections of the "Press kit" page to make it easier to identify
where one section ends and the next begins.

Before: ![presskit sections before][1]
After: ![presskit sections after][2]

[1]: https://user-images.githubusercontent.com/8604205/108739638-8208c600-753d-11eb-99bb-ea119640de39.png
[2]: https://user-images.githubusercontent.com/8604205/108745297-95b72b00-7543-11eb-9a35-56325477534b.png

PR Close #40945
2021-02-26 08:28:22 -08:00
George Kalpakas 78a70498b5 fix(docs-infra): improve the layout and appearance of the "Press kit" page (#40945)
This commit improves the layout and appearance of the "Press kit" page.
Most notable changes include:
- Center content and limit max width to 50em (which is 50px by default).
- Remove uppercase transform for headings.
- Use a two-column layout for icons (instead of one icon per row).
- Show "download" icons next to download links.

Before (wide): ![presskit page (wide) before][1]
Before (narrow 1/2): ![presskit page (narrow 1/2) before][2]
Before (narrow 2/2): ![presskit page (narrow 2/2) before][3]
After (wide): ![presskit page (wide) after][4]
After (narrow 1/2): ![presskit page (narrow 1/2) after][5]
After (narrow 2/2): ![presskit page (narrow 2/2) after][6]

This change is based on code from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108739632-80d79900-753d-11eb-8ddc-ac542ec5b3ac.png
[2]: https://user-images.githubusercontent.com/8604205/108739641-82a15c80-753d-11eb-9b20-8119ad117460.png
[3]: https://user-images.githubusercontent.com/8604205/108739643-83d28980-753d-11eb-8afa-2d7a5e87d586.png
[4]: https://user-images.githubusercontent.com/8604205/108739638-8208c600-753d-11eb-99bb-ea119640de39.png
[5]: https://user-images.githubusercontent.com/8604205/108739642-8339f300-753d-11eb-9b25-5c1988adb1dd.png
[6]: https://user-images.githubusercontent.com/8604205/108739645-846b2000-753d-11eb-8ef3-b6a8b7c6d1ff.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40945
2021-02-26 08:28:21 -08:00
Alan Agius d51d39cb4c docs: update docs to use new zone.js entry-points (#40823)
In CLI version 12, the old style of imports is no longer supported.

PR Close #40823
2021-02-24 07:58:29 -08:00
Daniel Díaz b84f719747 docs: update year (#40925)
PR Close #40925
2021-02-22 12:37:40 -08:00
George Kalpakas 09e1e1935a refactor(docs-infra): convert Sass mixin from camelCase to kebab-case 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
https://github.com/angular/angular/pull/40881#discussion_r577961617.

PR Close #40881
2021-02-19 09:14:59 -08:00
George Kalpakas 4b3e6b5a00 refactor(docs-infra): create mixin for styling marketing pages (#40881)
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
2021-02-19 09:14:59 -08:00
George Kalpakas c5231ce1da refactor(docs-infra): remove duplicate or unused CSS styles (#40881)
This commit removes some CSS styles that have no effect (i.e. are
duplicates or overridden by other rules).

PR Close #40881
2021-02-19 09:14:59 -08:00
George Kalpakas 717590a732 fix(docs-infra): fix top margin of "Press kit" page on small screens (#40881)
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][1]
After: ![presskit top section margin after][2]

[1]: https://user-images.githubusercontent.com/8604205/107988545-efb27080-6fd8-11eb-91d6-79651f2dffaf.png
[2]: https://user-images.githubusercontent.com/8604205/107988547-f04b0700-6fd8-11eb-9c4b-d444b39a34fe.png

PR Close #40881
2021-02-19 09:14:59 -08:00
George Kalpakas c704162800 fix(docs-infra): use consistent padding in marketing pages (#40881)
This commit makes the padding of the "Events", "Features" and
"Press kit" pages consistent with that of other marketing pages.

Before: ![presskit padding before][1]
After: ![presskit padding after][2]

[1]: https://user-images.githubusercontent.com/8604205/107986067-f8547800-6fd3-11eb-9164-51793e431d05.png
[2]: https://user-images.githubusercontent.com/8604205/107986064-f7234b00-6fd3-11eb-9050-ed7ec04e7443.png

PR Close #40881
2021-02-19 09:14:59 -08:00