Skip to content

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

Closed
wants to merge 1 commit into from
Closed

Print fix #19651

wants to merge 1 commit into from

Conversation

sjtrimble
Copy link
Contributor

Improved printing format

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #19599

What is the new behavior?

Cleaner printing format

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@mary-poppins
Copy link

You can preview ec2fd09 at https://pr19651-ec2fd09.ngbuilds.io/.

Copy link
Member

@gkalpak gkalpak left a 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;
Copy link
Member

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?

Copy link
Contributor Author

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 :)

Copy link
Member

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,
Copy link
Member

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?

@sjtrimble
Copy link
Contributor Author

sjtrimble commented Oct 12, 2017

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! :)

@mary-poppins
Copy link

You can preview df70ef6 at https://pr19651-df70ef6.ngbuilds.io/.

Copy link
Member

@gkalpak gkalpak left a 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;
Copy link
Member

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,
Copy link
Member

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?

Copy link
Contributor Author

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"
Copy link
Member

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 😕

Copy link
Contributor Author

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%;
Copy link
Member

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?

@sjtrimble
Copy link
Contributor Author

@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 :/

@mary-poppins
Copy link

You can preview 1391bf3 at https://pr19651-1391bf3.ngbuilds.io/.

Copy link
Member

@gkalpak gkalpak left a 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 with mat-.
  • 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;
Copy link
Member

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?

Copy link
Contributor Author

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;
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

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

This looks bad inside code-examples: guide-qs-code
Could we not apply this style inside code-example/code-pane elements?

margin: 0 auto;
width: 95%;
background-color: white;
page-break-inside: avoid;
Copy link
Member

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?

@ngbot
Copy link

ngbot bot commented Jan 16, 2018

Hello? Don't want to hassle you. Sure you're busy. But this PR has some merge conflicts that you probably ought to resolve.
That is... if you want it to be merged someday...

1 similar comment
@ngbot
Copy link

ngbot bot commented Jan 16, 2018

Hello? Don't want to hassle you. Sure you're busy. But this PR has some merge conflicts that you probably ought to resolve.
That is... if you want it to be merged someday...

@IgorMinar IgorMinar mentioned this pull request Jan 24, 2018
34 tasks
@IgorMinar IgorMinar added this to the v6-candidates milestone Feb 6, 2018
@IgorMinar
Copy link
Contributor

@sjtrimble can you please finish this PR? It's currently listed as something we'd like to get done for v6 (March 2018)

@sjtrimble
Copy link
Contributor Author

Ready for review @IgorMinar and @gkalpak :)

@mary-poppins
Copy link

You can preview 651d236 at https://pr19651-651d236.ngbuilds.io/.

@IgorMinar IgorMinar self-requested a review February 9, 2018 05:46
@IgorMinar IgorMinar added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release and removed state: WIP labels Feb 9, 2018
Copy link
Contributor

@IgorMinar IgorMinar left a 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.

@IgorMinar
Copy link
Contributor

Can you please squash the changes to get the lint CI status to a green state?

@gkalpak gkalpak removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Feb 9, 2018
@sjtrimble sjtrimble force-pushed the print-fix branch 2 times, most recently from d1a9f6d to f51aaa8 Compare February 9, 2018 18:15
@mary-poppins
Copy link

You can preview f51aaa8 at https://pr19651-f51aaa8.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 60a2b5e at https://pr19651-60a2b5e.ngbuilds.io/.

@sjtrimble
Copy link
Contributor Author

@gkalpak Take a look one last time :) I rebased and cleaned up the dupe aio-code code borer bit.

@gkalpak gkalpak added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Feb 10, 2018
@ngbot
Copy link

ngbot bot commented Feb 10, 2018

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "continuous-integration/travis-ci/pr" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@matsko matsko requested review from IgorMinar and gkalpak February 14, 2018 23:15
@matsko matsko closed this in b54ad05 Feb 14, 2018
matsko pushed a commit that referenced this pull request Feb 14, 2018
matsko added a commit that referenced this pull request Feb 15, 2018
vicb pushed a commit to vicb/angular that referenced this pull request Feb 15, 2018
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
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 target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants