← Back to Book Detail

40 Customizing your Exports with Custom Styles (39/46) -- Maricopa Open Digital Press Guide

Browse
84%

40 Customizing your Exports with Custom Styles

40 Customizing your Exports with Custom Styles Pressbooks allows you to modify our themes using CSS. You can use custom styles to customize your web, ebook (EPUB and MOBI) and PDF (print and digital) files. Please note that Pressbooks does not offer support for comprehensive CSS formatting. This chapter covers the following: NOTE: If you are currently using the Pressbooks Custom CSS theme, you can continue to do so — there is no need to switch to the Custom Styles option on your existing books. However, do note that if you switch away from the Pressbooks Custom CSS theme in future, you will not be able to return to it, as it has been retired in favor of the new Custom Styles feature. 1. What are Custom Styles? Custom styles allow you to add CSS to your book’s stylesheet, meaning you can add, change and override the formatting in any of our themes. If you’re fluent in CSS, this means you can take one of our existing themes and adjust it to meet your needs by adding colours, changing margins or making any other number of adjustments you wish. The advantage of handling custom styles as additions to an existing theme, instead of being able to edit the stylesheet directly, is that your book will continue to benefit from updates and bug fixes that improve your experience with Pressbooks. If you have previously used the Pressbooks Custom CSS theme to edit your book’s CSS, see the section below for what you need to know. 2. How to Add Custom Styles To add custom styles to your book, follow the steps below: i. Go to the Custom Styles Menu Once you have selected a theme for your book, go to Appearance → Custom Styles. ii. Select the Export Format you would like to customize Pressbooks prepares files in multiple formats, including PDF, ebook, and web. Each format is created using a specific stylesheet designed for its unique requirements, so you will need to select which you edit every time, and make sure you make changes in all three stylesheets if you would like the three formats to reflect each other. To do switch between formats, choose from the dropdown menu at the top of the custom styles page. You can select either web, ebook, or PDF. iii. Add your CSS code to the “Your Styles” section Any additions that you want to make to the theme can be entered in the “Your Styles” section. The “Theme Styles” section contains the stylesheet for the entire theme, and is not editable, but is very useful for reference. iv. Save, and view your changes Once you’ve added in your custom code, you can click save, and view your changes either in the webbook or export formats (depending on which format you customized). Pressbooks saves the last 10 revisions of any changes you make in each stylesheet (web, ebook, and PDF). You can access these revisions on the Custom Styles page below the save button. Note that when using your browser’s back arrow or backspace function while navigating between the stylesheets, you may be switching between different formats’ stylesheets with
← Previous Chapter Next Chapter →