Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Conversation

josephperrott
Copy link
Member

  • Make navbar "sticky" on all pages
  • Show table of contents (non-sticky) at the top of pages on mobile
  • Shrink landing page spacing on mobile to increase density
  • Move navbar to a two row version on mobile
  • Use md-icon for angular and github icons in navbar
  • Enforce word breaks for p tags in docs, preventing x axis overflows
  • Decrease height of Guides subheader to match other pages
  • Shrink docs-api table spacing on mobile to increase density

<img class="docs-angular-logo"
src="../../../assets/img/homepage/angular-white-transparent.svg"
alt="angular">
<md-icon class="angular-logo" svgIcon="angular"></md-icon>
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to make this change? Switch to md-icon does incur a cost, and we don't need to have an SVG here since we don't style the Angular logo

(same for github logo)

Copy link
Member Author

Choose a reason for hiding this comment

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

I was looking to use md-icon-button for the github icon on mobile, and while it doesn't require that a md-icon is actually the ContentChild, I wanted to do it "correctly". Then I figured it made sense to do it for both rather than just one of them.

Copy link
Member

Choose a reason for hiding this comment

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

I think it should be okay to keep using img; I want to get better about encouraging people to only use md-icon when there'd be some advantage in doing so

@@ -12,6 +12,10 @@ material-docs-app > app-component-sidenav {
flex: 1 1 auto;
}

material-docs-app > :last-child {
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment that describes what you're targeting here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

.docs-navbar {
display: none;

.docs-nav-link {
Copy link
Member

Choose a reason for hiding this comment

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

Can this rule be un-nested?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

}
}

.show-small {
Copy link
Member

Choose a reason for hiding this comment

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

Missing prefix (here and elsewhere). The prefix is typically something like docs-navbar-

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

// Prevent p tags from not breaking, causing x axis overflows.
.docs-api > p {
word-break: break-word;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why direct child?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did direct child because it is the case we are seeing in the issue with. My concern with doing all indirect matching was messing up how the code formatted boxes handled word and line breaks.

@@ -1,2 +1,2 @@
<app-navbar [class.mat-elevation-z6]="showShadow"></app-navbar>
<app-navbar class="mat-elevation-z6"></app-navbar>
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way to only make the elevation show once the page has been scrolled and stickiness has taken effect? If not, I think showShadow can be refactored out of the component class.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't believe its worth the effort to make the elevation only when scrolled, especially since we are faking the stickiness of the header. I have removed showShadow as you mentioned.

@willshowell
Copy link
Contributor

Also please consider #236! The code sample wrapping makes it really hard to read on mobile!

@josephperrott josephperrott force-pushed the mobile-friendly branch 5 times, most recently from d4ffc28 to dc80642 Compare September 13, 2017 22:16
@jelbourn
Copy link
Member

Looks like a unit test is failing

- Make navbar "sticky" on all pages
- Show table of contents (non-sticky) at the top of pages on mobile
- Shrink landing page spacing on mobile to increase density
- Move navbar to a two row version on mobile
- Use md-icon for angular and github icons in navbar
- Enforce word breaks for p tags in docs, preventing x axis overflows
- Decrease height of Guides subheader to match other pages
- Shrink docs-api table spacing on mobile to increase density
@josephperrott
Copy link
Member Author

@jelbourn unit test issue resolved

@jelbourn jelbourn merged commit 62706dc into angular:master Sep 19, 2017
@josephperrott josephperrott deleted the mobile-friendly branch October 10, 2017 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants