-
Notifications
You must be signed in to change notification settings - Fork 12
Printer friendly CSS in host mode #3889
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,6 +107,7 @@ export default class HostModeContent extends Component<Signature> { | |
| <HostModeCard | ||
| @cardId={{@primaryCardId}} | ||
| @displayBoundaries={{not this.isWideCard}} | ||
| @isPrimary={{true}} | ||
| @openInteractSubmode={{@openInteractSubmode}} | ||
| class='current-card' | ||
| /> | ||
|
|
@@ -125,7 +126,7 @@ export default class HostModeContent extends Component<Signature> { | |
| align-items: center; | ||
| justify-content: center; | ||
| width: 100%; | ||
| max-height: 100vh; | ||
| min-height: 100vh; | ||
| overflow: hidden; | ||
|
Comment on lines
+129
to
130
|
||
| padding: var(--boxel-sp); | ||
| position: relative; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ import { randomUUID } from 'crypto'; | |||||||||||||||||||||
| test.describe('Host mode', () => { | ||||||||||||||||||||||
| let publishedRealmURL: string; | ||||||||||||||||||||||
| let publishedCardURL: string; | ||||||||||||||||||||||
| let publishedWhitePaperCardURL: string; | ||||||||||||||||||||||
| let connectRouteURL: string; | ||||||||||||||||||||||
| let username: string; | ||||||||||||||||||||||
| let password: string; | ||||||||||||||||||||||
|
|
@@ -51,6 +52,54 @@ test.describe('Host mode', () => { | |||||||||||||||||||||
| `, | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| await postCardSource( | ||||||||||||||||||||||
| page, | ||||||||||||||||||||||
| realmURL, | ||||||||||||||||||||||
| 'white-paper-card.gts', | ||||||||||||||||||||||
| ` | ||||||||||||||||||||||
| import { CardDef, Component } from 'https://cardstack.com/base/card-api'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| export class WhitePaperCard extends CardDef { | ||||||||||||||||||||||
| static prefersWideFormat = true; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| static isolated = class Isolated extends Component<typeof this> { | ||||||||||||||||||||||
| <template> | ||||||||||||||||||||||
| <article class='white-paper' data-test-white-paper> | ||||||||||||||||||||||
| <section class='page-block'>Page 1</section> | ||||||||||||||||||||||
| <section class='page-block'>Page 2</section> | ||||||||||||||||||||||
| <section class='page-block'>Page 3</section> | ||||||||||||||||||||||
| </article> | ||||||||||||||||||||||
| <style scoped> | ||||||||||||||||||||||
| .white-paper { | ||||||||||||||||||||||
| padding: 0; | ||||||||||||||||||||||
| margin: 0; | ||||||||||||||||||||||
| font-family: serif; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .page-block { | ||||||||||||||||||||||
| height: 9.5in; | ||||||||||||||||||||||
| padding: 0.75in; | ||||||||||||||||||||||
| box-sizing: border-box; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @media print { | ||||||||||||||||||||||
| .page-block { | ||||||||||||||||||||||
| break-after: page; | ||||||||||||||||||||||
| page-break-after: always; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .page-block:last-child { | ||||||||||||||||||||||
| break-after: auto; | ||||||||||||||||||||||
| page-break-after: auto; | ||||||||||||||||||||||
|
Comment on lines
+88
to
+93
|
||||||||||||||||||||||
| page-break-after: always; | |
| } | |
| .page-block:last-child { | |
| break-after: auto; | |
| page-break-after: auto; | |
| } | |
| .page-block:last-child { | |
| break-after: auto; |
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.
Nice, I didn’t know Playwright could do this, very useful!
Uh oh!
There was an error while loading. Please reload this page.