-
Couldn't load subscription status.
- Fork 699
Kara/print and export #758
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
Conversation
1. Default printTheme to overwrite the colors for a more suitable printing experience (needs to be changed later) 1. Add logic to src/theme/index.js to check whether there is a print query and if so apply the printTheme to the mergedTheme. 1. Add logic to slide to remove background color and change it to white for printing when print query.
1. Added exportMode to useDeck. 1. Changed layout of slides depending on `?exportMode=true` using print-deck. 1. Added @print media query to fullscreen and progress components.
2f50eeb to
422135b
Compare
src/components/slide.js
Outdated
| : { | ||
| transform: `scale(${ratio})`, | ||
| transformOrigin: `${origin.x} ${origin.y}` | ||
| } |
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.
This is starting to get a little big, perhaps time to move to a React.useMemo?
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.
Sure can do!
src/components/slide.js
Outdated
| transformOrigin: `${origin.x} ${origin.y}` | ||
| }} | ||
| backgroundColor={ | ||
| window.location.search.includes('print') ? '#ffffff' : backgroundColor |
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.
Could we get this from the useUrlRouting hook?
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.
Missed this, will get this done!
| return merged; | ||
| }, deepCopy(defaultTheme)); | ||
|
|
||
| export const mergeTheme = theme => { |
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.
@kiraarghy and I slack chatted a minor refactor here.
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.
Looks absolutely fantastic!
Co-authored-by: Ryan Roemer <ryan.roemer@formidable.com>
This ticket implements the export and print functionality that was in original Spectacle.
When a user uses the

exportModeflag, when they print it will output each slide as a single page.When a user uses the
printModeflag, it will apply a print theme and a white background, saving on printing.The printTheme has alright contrast at the moment, though am more than happy to take input on it @alex-saunders you're pretty good at this kinda thing.
I have also added a lightTheme for the codepane when in
printMode.