Skip to content

refactor(docs-infra): clean up CSS styles - #40704

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

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

Conversation

@gkalpak

@gkalpak gkalpak commented Feb 4, 2021

Copy link
Copy Markdown
Member

This PR contains several refactoring commits that clean up our angular.io styles. All commits are refactorings (i.e. no feature/fix), so there should be no visual difference in the built app. (If there is, that is a mistake 😱)

See the individual commits for details.

NOTES:

  • Most commits are easier to review with whitespace changes ignored. (In GitHub, this can be achieved by appending ?w=1 to the URL.)
  • I have tried to limit changes to a signle file/component in each commit (to keep them easier to review).
  • There are three main types of clean-ups:
    • Removing unused styles.
    • Merging blocks that target the same elements.
    • Scope styles to specific components/elements.

@gkalpak gkalpak added 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 4, 2021
@gkalpak gkalpak added this to the docs-infra-aio-app milestone Feb 4, 2021
@google-cla google-cla Bot added the cla: yes label Feb 4, 2021
@mary-poppins

Copy link
Copy Markdown

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

Nice tidy up. A couple of comments but otherwise LGTM.

Comment thread aio/src/styles/1-layouts/_sidenav.scss Resolved
Comment thread aio/src/styles/1-layouts/_sidenav.scss Resolved
Comment thread aio/src/styles/1-layouts/_top-menu.scss Resolved
Comment thread aio/src/styles/2-modules/_toc.scss Resolved
@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 4, 2021
This commit removes some styles from `_content-layout.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).
This commit removes some styles from `_footer.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).
This commit cleans up the styles in `_footer.scss` by merging together
blocks that target the same elements.
This commit ensures that all styles for the page footer (which are
defined in `_footer.scss`) only apply to elements inside an
`<aio-footer>` element. This will prevent the styles accidentally taking
effect on a different part of the app.
This commit removes some styles from `_layout-global.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).
This commit removes some styles from `_sidenav.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).
This commit cleans up the styles in `_sidenav.scss` by merging
together blocks that target the same elements.

It also applies the equivalent changes in `_notification.scss` rules
that override sidenav styles.
…lement

This commit ensures that all styles for the sidenav nav-items (which are
defined in `_sidenav.scss`) only apply to elements inside an
`<aio-nav-item>` element. This will prevent the styles accidentally
taking effect on a different part of the app.
This commit cleans up the styles in `_top-menu.scss` by merging
together blocks that target the same elements.

It also makes similar changes to selectors in `_notification.scss` rules
that override top-menu styles (for consistency).
…ment

This commit ensures that all styles for the app top-menu (which are
defined in `_top-menu.scss`) only apply to elements inside an
`.app-toolbar` element. This will prevent the styles accidentally taking
effect on a different part of the app.
…s.scss`

Both `<aio-contributor-list>` and `<aio-resource-list>` contain
`.group-buttons` elements. Previously, global styles for
`.group-buttons` were defined in `_contributor.scss` (i.e. the styles
from `_contributor.scss` were also applied to `.group-buttons` in
`<aio-resource-list>`). Also, `_contributor.scss` and `_resources.scss`
defined some duplicate styles for `.group-buttons`.

This commit moves the `.group-buttons` styles to `_buttons.scss`, which
contains common button-related styles.
This commit removes some styles from `_code.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).
This commit cleans up the styles in `_code.scss` by merging together
blocks that target the same elements.

It also normalizes the rules targeting Angular Material tabs to use
consistent selectors and use class names instead of tag names.
…lement

This commit ensures that all styles for the code examples (which are
defined in `_code.scss`) only apply to elements inside an `<aio-code>`
element. This will prevent the styles accidentally taking effect on a
different part of the app.
This commit removes some styles from `_contributor.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).
…ributor-list>` element

This commit ensures that all styles for the contributor list (which are
defined in `_contributor.scss`) only apply to elements inside an
`<aio-contributor-list>` element. This will prevent the styles
accidentally taking effect on a different part of the app.
This commit cleans up the styles in `_details.scss` by merging
together blocks that target the same elements.

It also changes the `summary` selector to `details > summary`, but that
should not make any difference in practice, since `<summary>` elements
always appear as direct childs of `<details>`.
This commit removes the `_edit-page-cta.scss` file, which is no longer
used (i.e. the rules it contains do not match any element in the app).
This commit makes the indentation in `_label.scss` consistent with that
in most other `.scss` files in `aio/`.
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…s` (#40704)

The `.code-anchor` class can be used anywhere where we have code
examples (including API pages and docs guides). Previously, global
styles for `.code-anchor` were defined in `_api-list.scss` (i.e. the
styles from `_api-list.scss` were also applied to `.code-anchor`
elements in other pages/components).

This commit moves the `.code-anchor` styles to `_code.scss`, which
contains other common code-related styles.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…lement (#40704)

This commit ensures that all styles for the API list page (which are
defined in `_api-list.scss`) only apply to elements inside an
`<aio-api-list>` element. This will prevent the styles accidentally
taking effect on a different part of the app.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…ontainer (#40704)

Previously, the API list container (in the template of the
`<aio-api-list>` component) had three different CSS classes
(`.api-list-container`, `.docs-content`, `.l-content-small`) that were
all used for styling it. This seemed unnecessary and made it more difficult
to see what styles were applied to the container.

This commit removes the extra classes and consolidates the styles under
the `.api-list-container` class (which was the most descriptive one).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
#40704)

This commit removes some styles from `_content-layout.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit removes some styles from `_footer.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_footer.scss` by merging together
blocks that target the same elements.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…nt (#40704)

This commit ensures that all styles for the page footer (which are
defined in `_footer.scss`) only apply to elements inside an
`<aio-footer>` element. This will prevent the styles accidentally taking
effect on a different part of the app.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…#40704)

This commit removes some styles from `_layout-global.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit removes some styles from `_sidenav.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_sidenav.scss` by merging
together blocks that target the same elements.

It also applies the equivalent changes in `_notification.scss` rules
that override sidenav styles.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…lement (#40704)

This commit ensures that all styles for the sidenav nav-items (which are
defined in `_sidenav.scss`) only apply to elements inside an
`<aio-nav-item>` element. This will prevent the styles accidentally
taking effect on a different part of the app.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_top-menu.scss` by merging
together blocks that target the same elements.

It also makes similar changes to selectors in `_notification.scss` rules
that override top-menu styles (for consistency).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…ment (#40704)

This commit ensures that all styles for the app top-menu (which are
defined in `_top-menu.scss`) only apply to elements inside an
`.app-toolbar` element. This will prevent the styles accidentally taking
effect on a different part of the app.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…s.scss` (#40704)

Both `<aio-contributor-list>` and `<aio-resource-list>` contain
`.group-buttons` elements. Previously, global styles for
`.group-buttons` were defined in `_contributor.scss` (i.e. the styles
from `_contributor.scss` were also applied to `.group-buttons` in
`<aio-resource-list>`). Also, `_contributor.scss` and `_resources.scss`
defined some duplicate styles for `.group-buttons`.

This commit moves the `.group-buttons` styles to `_buttons.scss`, which
contains common button-related styles.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit removes some styles from `_code.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_code.scss` by merging together
blocks that target the same elements.

It also normalizes the rules targeting Angular Material tabs to use
consistent selectors and use class names instead of tag names.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…lement (#40704)

This commit ensures that all styles for the code examples (which are
defined in `_code.scss`) only apply to elements inside an `<aio-code>`
element. This will prevent the styles accidentally taking effect on a
different part of the app.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…40704)

This commit removes some styles from `_contributor.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…ributor-list>` element (#40704)

This commit ensures that all styles for the contributor list (which are
defined in `_contributor.scss`) only apply to elements inside an
`<aio-contributor-list>` element. This will prevent the styles
accidentally taking effect on a different part of the app.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_details.scss` by merging
together blocks that target the same elements.

It also changes the `summary` selector to `details > summary`, but that
should not make any difference in practice, since `<summary>` elements
always appear as direct childs of `<details>`.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit removes the `_edit-page-cta.scss` file, which is no longer
used (i.e. the rules it contains do not match any element in the app).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit makes the indentation in `_label.scss` consistent with that
in most other `.scss` files in `aio/`.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit removes some styles from `_label.scss` that are no longer
used (i.e. their CSS selectors do not match any element in the app).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_label.scss` by merging together
blocks that target the same elements.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_presskit.scss` by merging together
blocks that target the same elements.

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
…0704)

This commit removes some styles from `_resources.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
alxhub pushed a commit that referenced this pull request Feb 9, 2021
This commit cleans up the styles in `_resources.scss` by merging
together blocks that target the same elements.

PR Close #40704
@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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants