-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Print fix #19651
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
Print fix #19651
Conversation
You can preview ec2fd09 at https://pr19651-ec2fd09.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the content take up the whole width, you also need a style like:
@media print {
.mat-sidenav-content {
margin: 0 !important;
}
}
@media print { | ||
|
||
.no-print { | ||
display: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are some elements hidden with the no-print
class and others are explcitly mentioned in the rule below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is still a WIP and I wanted to ask to see if we had a preference on how to handle :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are some elements still hidden with the no-print
class and others are explicitly mentioned in the rule below? 😛
aio-nav-menu, | ||
md-sidenav, | ||
md-sidenav.sidenav.mat-sidenav, | ||
.toc-container, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this have the no-print
class and also be included here?
I tried moving as much as I could to the no-print class so it can be used in the future. @gkalpak thanks for the sidenav content margin hint! :) |
You can preview df70ef6 at https://pr19651-df70ef6.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good 👍
I left a couple of comments.
I wish we could do a better job with tabbed code panes (e.g. as seen near the bottom of guide/displaying-data), but I don't think it is even possible with CSS only 😞
@media print { | ||
|
||
.no-print { | ||
display: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are some elements still hidden with the no-print
class and others are explicitly mentioned in the rule below? 😛
} | ||
|
||
md-sidenav.sidenav.mat-sidenav, | ||
.toc-container, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this has to be here? Doesn't it already have the no-print
class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The md-sidenav.sidenav.mat-sidenav is the only one I can't figure out how to do without. It works fine when the sidenav is closed, but not when open.
@@ -31,7 +31,7 @@ const defaultLineNumsCount = 10; // by default, show linenums over this number | |||
selector: 'aio-code', | |||
template: ` | |||
<pre class="prettyprint lang-{{language}}"> | |||
<button *ngIf="!hideCopy" class="material-icons copy-button" | |||
<button *ngIf="!hideCopy" class="material-icons copy-button no-print" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can still see copy buttons 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this :)
} | ||
|
||
md-sidenav-container.sidenav-container.has-floating-toc { | ||
width: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be covered by the rule right above?
@gkalpak Will you take a look again :) I made a few more changes and addressed all but 1 of your comments. I'm also not sure what to do about the md-tabs :/ |
You can preview 1391bf3 at https://pr19651-1391bf3.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments/questions to go!
Also:
- Once build(aio): update to @angular/core@5.0.0-rc.5 #19702 is merged, the
md-
prefix of material components needs to be replaced withmat-
. - As I said before, there is not much we can do for tabs. Can you at least add a special style for
.mat-tab-label-active
elements to show what the active tab is. (E.g. make the text bold or something.)
} | ||
|
||
img { | ||
max-width: 100% !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this make a difference? Can you point out an example where this is needed/desired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is an example currently but it would prevent any image that is specifically sized in pixels from being cut off on a printed page.
} | ||
|
||
p { | ||
widows: 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I had never heard of this one!
} | ||
|
||
.content code { | ||
border: 0.5px solid $lightgray; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
margin: 0 auto; | ||
width: 95%; | ||
background-color: white; | ||
page-break-inside: avoid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary here? What does it do?
Hello? Don't want to hassle you. Sure you're busy. But this PR has some merge conflicts that you probably ought to resolve. |
1 similar comment
Hello? Don't want to hassle you. Sure you're busy. But this PR has some merge conflicts that you probably ought to resolve. |
@sjtrimble can you please finish this PR? It's currently listed as something we'd like to get done for v6 (March 2018) |
Ready for review @IgorMinar and @gkalpak :) |
You can preview 651d236 at https://pr19651-651d236.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on various pages and it looks good to me. Definitely a huge improvement compared to the current state.
But let's wait for George to lgtm this as well as he's more familiar with the implementation of our stylesheets.
Can you please squash the changes to get the lint CI status to a green state? |
d1a9f6d
to
f51aaa8
Compare
You can preview f51aaa8 at https://pr19651-f51aaa8.ngbuilds.io/. |
printfix
You can preview 60a2b5e at https://pr19651-60a2b5e.ngbuilds.io/. |
@gkalpak Take a look one last time :) I rebased and cleaned up the dupe |
printfix PR Close angular#19651
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Improved printing format
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #19599
What is the new behavior?
Cleaner printing format
Does this PR introduce a breaking change?