Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(drawer): allow drawer below top app bar #4028

Merged
merged 16 commits into from
Nov 7, 2018

Conversation

moog16
Copy link
Contributor

@moog16 moog16 commented Oct 31, 2018

related material-components/material-components-web-react#377

  • Add screenshot tests for dismissible and permanent drawers to appear below top app bar
  • removed top css property from dismissible drawer class

@@ -160,6 +160,62 @@ Drawers can contain a header element which will not scroll with the rest of the
</aside>
```

### Drawer Below Top App Bar
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove this section and keep the one in Usage with Top App Bar section?

Copy link
Contributor Author

@moog16 moog16 Oct 31, 2018

Choose a reason for hiding this comment

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

This is the permanent below top app bar...it is slightly different. Do you still wanna remove it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's keep just one example for Dismissible drawer variant to avoid maintaining two different variations of this version.

@@ -556,6 +556,14 @@
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/21/16_50_45_748/spec/mdc-dialog/mixins/title-ink-color.html.windows_ie_11.png"
}
},
"spec/mdc-drawer/classes/dismissible-below-top-app-bar.html": {
"public_url": "https://storage.googleapis.com/mdc-web-screenshot-tests/travis/2018/10/31/20_39_25_363/spec/mdc-drawer/classes/dismissible-below-top-app-bar.html?utm_source=golden_json",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like the main content is not scrollable in this demo. Also the drawer is being clipped at the bottom when I resize the browser small viewport.

We need to update the docs too to layout main content and drawer correctly.

@@ -160,6 +160,62 @@ Drawers can contain a header element which will not scroll with the rest of the
</aside>
```

### Drawer Below Top App Bar
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's keep just one example for Dismissible drawer variant to avoid maintaining two different variations of this version.

@@ -263,7 +365,6 @@ body {
.app-bar {
position: absolute;
}
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert this line.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this change updated. This breaks the formatting.

```scss
// Note: these styles do not account for any paddings/margins that you may need.

.below-top-app-bar-container {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm sure we need more additional styles than these to get correct layout for this variant. The z-index of app-bar need to be updated to stay on top of drawer. --fixed-adjust needs to be applied to drawer root and app-content individually. Also the main content should be scrollable.

Please take a look at this example:
https://stackblitz.com/edit/mdc-drawer-demo-fiqbfg?file=index.scss

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you mean. It looks like both areas independently scroll from each other.

@@ -556,6 +556,14 @@
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/21/16_50_45_748/spec/mdc-dialog/mixins/title-ink-color.html.windows_ie_11.png"
}
},
"spec/mdc-drawer/classes/dismissible-below-top-app-bar.html": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding screenshot test 🎉

The CSS to match it looks like this:
##### Dismissible Drawer Below Top App Bar

In cases where the drawer appears below the top app bar you will want to follow the markup shown below. The `mdc-drawer__content` and `main-content` elements will also scroll independently of each other. The `mdc-top-app-bar` and `mdc-top-app-bar--fixed-adjust` will be sit sibling to each other. The `mdc-top-app-bar--fixed-adjust` element will contain the `mdc-drawer--dismissible` and `mdc-drawer-app-content` elements.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"The mdc-top-app-bar, mdc-drawer and mdc-drawer-app-content will be sibling to each other. The mdc-top-app-bar--fixed-adjust helper class will be applied to mdc-drawer and mdc-drawer-app-content elements to adjust the position with top app bar."

@@ -263,7 +365,6 @@ body {
.app-bar {
position: absolute;
}
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this change updated. This breaks the formatting.

@@ -0,0 +1,233 @@
<!DOCTYPE html>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We might not need to screenshot test this. Dismissible & permanent drawers have exact same styles except the JS logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true - i'll remove

Copy link
Collaborator

@abhiomkar abhiomkar left a comment

Choose a reason for hiding this comment

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

LGTM.

Please update golden.json file.

@@ -574,6 +582,14 @@
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/26/06_08_27_877/spec/mdc-drawer/classes/modal.html.windows_ie_11.png"
}
},
"spec/mdc-drawer/classes/permanant-below-top-app-bar.html": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you've removed this from screenshot tests, remove these from golden.json too.

@@ -556,6 +556,14 @@
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/21/16_50_45_748/spec/mdc-dialog/mixins/title-ink-color.html.windows_ie_11.png"
}
},
"spec/mdc-drawer/classes/dismissible-below-top-app-bar.html": {
"public_url": "https://storage.googleapis.com/mdc-web-screenshot-tests/travis/2018/10/31/20_39_25_363/spec/mdc-drawer/classes/dismissible-below-top-app-bar.html?utm_source=golden_json",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update golden.json with latest changes.

@mdc-web-bot
Copy link
Collaborator

@moog16 moog16 merged commit ebdb084 into master Nov 7, 2018
@moog16 moog16 deleted the fix/drawer/below-top-app-bar branch November 7, 2018 22:53
adrianschmidt pushed a commit to Lundalogik/material-components-web that referenced this pull request Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants