{"id":2308,"date":"2024-12-30T12:27:30","date_gmt":"2024-12-30T17:27:30","guid":{"rendered":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/?post_type=chapter&#038;p=2308"},"modified":"2025-12-13T15:00:41","modified_gmt":"2025-12-13T20:00:41","slug":"customize-css","status":"publish","type":"chapter","link":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/chapter\/customize-css\/","title":{"raw":"Customize CSS","rendered":"Customize CSS"},"content":{"raw":"<div class=\"textbox outer\">\r\n<h2>Making your Customizations in<\/h2>\r\n<div class=\"textbox inner\">\r\n<h2>Pressbooks<\/h2>\r\n<\/div>\r\nCSS modifications can tailor your open textbook in Pressbooks.\r\n\r\n<\/div>\r\nThere may be customizations that you\u2019d like to make that are not currently available in your Theme Options. You will need to consider whether you have the time, resources, and expertise required to create your own Custom Styles, which are any CSS (Cascading Style Sheet) changes that you add to your book's base theme.\r\n<div class=\"menu-table-wrapper h5p-display\">\r\n<div class=\"menu-table\" style=\"width: 50%\"><span class=\"menu-table-title\">Start With<\/span>\r\n<a class=\"menu-table-panel large-menu-panel\" href=\"#basics\">The Basics<\/a><\/div>\r\n<div class=\"menu-table\" style=\"width: 50%\"><span class=\"menu-table-title\">Go To<\/span>\r\n<a class=\"menu-table-panel large-menu-panel\" href=\"#advanced\">Important Points\r\nfor Advanced Users<\/a><\/div>\r\n<\/div>\r\n<h2><a id=\"basics\"><\/a>The Basics<\/h2>\r\n<h3>View the Base Theme CSS<\/h3>\r\nYou can readily view the CSS for your book's base theme. From the left sidebar menu of your book\u2019s dashboard, go to Appearance &gt;&gt; Custom Styles. The stylesheets are divided into three sections, corresponding to the web, e-book, and PDF formats, allowing for modifications to the base theme CSS.\r\n<h3>Theme Web Styles<\/h3>\r\nThe first section of the Custom Styles page, Theme Web Styles, will include a scrolling box that contains the entire stylesheet (aforementioned CSS code) for a given format. The contents of the stylesheet are dependent on the theme you\u2019ve chosen. This section is not editable but is very useful for reference. To fully understand the changes you can make using CSS, study this stylesheet\u00a0<span style=\"margin: 0px;padding: 0px\">carefully to identify the current design and create a design plan outlining the modifications you would like to make<\/span>.\r\n\r\n<img class=\"size-full wp-image-2312\" src=\"http:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-content\/uploads\/sites\/55\/2024\/12\/Screen-Shot-2024-12-30-at-12.30.25-PM.png\" alt=\"Screenshot of Theme Web Styles (Jacobs) for Custom Styles in the Appearance section.\" width=\"3020\" height=\"1016\" \/>\r\n<div class=\"textbox textbox--examples attributions\">\r\n<div class=\"textbox__content\">\r\n\r\n<strong>Image:<\/strong> Accessing Custom Styles on Pressbooks.\r\n\r\n<\/div>\r\n<\/div>\r\n<h3>Your Web Styles<\/h3>\r\n<img class=\"alignnone size-full wp-image-2313\" src=\"http:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-content\/uploads\/sites\/55\/2024\/12\/Screen-Shot-2024-12-30-at-12.30.33-PM.png\" alt=\"Screenshot of Your Web Styles for Customization in the Appearance Section.\" width=\"3016\" height=\"762\" \/>\r\n<div class=\"textbox textbox--examples attributions\">\r\n<div class=\"textbox__content\">\r\n\r\n<strong>Image:<\/strong> Accessing Your Web Styles on Pressbooks.\r\n\r\n<\/div>\r\n<\/div>\r\nThe second section of the Custom Styles page, titled \"Your Web Styles,\" is where you can make edits or additions to the stylesheet. Any CSS added in this section will override existing styles for the same class. After identifying the element-specific styles, you can copy the corresponding code to override the original theme styles for that element. You can also create your own components or classes to use in the textbook.\r\n\r\n<strong>Recommended Practice: <\/strong>Create a private page to test any CSS modifications. Have a design plan in place before making any modifications.\r\n<h3>CSS for Web, E-book, and PDF<\/h3>\r\nPressbooks prepares files in multiple formats, including web, e-book, and PDF. Each format is created using a specific stylesheet designed for its unique requirements, so you will need to select which one you edit each time and ensure that you make changes in all three stylesheets if you want the three formats to reflect each other. Choose from the dropdown menu at the top of the Custom Styles page to switch between formats. You can select either web, e-book, or PDF.\r\n\r\n<hr \/>\r\n\r\n<h2><a id=\"advanced\"><\/a>Important Points for Advanced Users<\/h2>\r\nSome users may already be familiar with CSS. Even if you\u2019re fluent in CSS, remember that each of the formats Pressbooks produces operates slightly differently, so what you may be used to using for a web page won\u2019t necessarily translate to a PDF or e-book.\r\n<ul>\r\n \t<li>Pressbooks doesn\u2019t allow you to write an entire theme in CSS; instead, you modify the existing ones by overriding the default theme\u2019s stylesheet. Therefore, even if you have used CSS before, there are some changes in how you write code. Explore the Theme Stylesheet (First Section of Custom Styles).<\/li>\r\n \t<li>When studying the Theme Stylesheet, use XHTML export to isolate particular classes and elements.<\/li>\r\n \t<li>When creating a new class, make sure to create the formatting for different text types (e.g. <span class=\"inline-code blue-text\">p<\/span>, <span class=\"inline-code blue-text\">h1<\/span>, <span class=\"inline-code blue-text\">h2<\/span>, etc.) so that when the <span class=\"inline-code green-text\">div<\/span> tag is used in the HTML of a particular section or part, you can make the whole class separate from the rest of the page.<\/li>\r\n \t<li>The <a href=\"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/chapter\/complex-css-appendix\/\" rel=\"noopenner noreferrer\">Complex CSS Appendix<\/a> chapter in the back matter of this book features some advanced customized CSS designs created by the Library\u2019s OER Team. Feel free to explore this section and the relevant CSS code for inspiration.<\/li>\r\n \t<li>Comment your CSS code.<\/li>\r\n<\/ul>\r\n<strong>Recommended Practice: <\/strong>After creating a design plan, make a private page to perform trials for any CSS modifications. Keep your design plan updated.\r\n<div class=\"textbox textbox--learning-objectives\">\r\n<div class=\"textbox__content\">Considering modifying the default theme beyond the theme options provided as part of your Pressbooks project with Concordia University Library? If so, please include your intentions to customize the Cascading Style Sheets (CSS) in the project plan for your open textbook or open guidebook.\u00a0We additionally recommend creating a <a href=\"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/chapter\/design-appendix\/\">design plan<\/a>.<\/div>\r\n<\/div>","rendered":"<div class=\"textbox outer\">\n<h2>Making your Customizations in<\/h2>\n<div class=\"textbox inner\">\n<h2>Pressbooks<\/h2>\n<\/div>\n<p>CSS modifications can tailor your open textbook in Pressbooks.<\/p>\n<\/div>\n<p>There may be customizations that you\u2019d like to make that are not currently available in your Theme Options. You will need to consider whether you have the time, resources, and expertise required to create your own Custom Styles, which are any CSS (Cascading Style Sheet) changes that you add to your book&#8217;s base theme.<\/p>\n<div class=\"menu-table-wrapper h5p-display\">\n<div class=\"menu-table\" style=\"width: 50%\"><span class=\"menu-table-title\">Start With<\/span><br \/>\n<a class=\"menu-table-panel large-menu-panel\" href=\"#basics\">The Basics<\/a><\/div>\n<div class=\"menu-table\" style=\"width: 50%\"><span class=\"menu-table-title\">Go To<\/span><br \/>\n<a class=\"menu-table-panel large-menu-panel\" href=\"#advanced\">Important Points<br \/>\nfor Advanced Users<\/a><\/div>\n<\/div>\n<h2><a id=\"basics\"><\/a>The Basics<\/h2>\n<h3>View the Base Theme CSS<\/h3>\n<p>You can readily view the CSS for your book&#8217;s base theme. From the left sidebar menu of your book\u2019s dashboard, go to Appearance &gt;&gt; Custom Styles. The stylesheets are divided into three sections, corresponding to the web, e-book, and PDF formats, allowing for modifications to the base theme CSS.<\/p>\n<h3>Theme Web Styles<\/h3>\n<p>The first section of the Custom Styles page, Theme Web Styles, will include a scrolling box that contains the entire stylesheet (aforementioned CSS code) for a given format. The contents of the stylesheet are dependent on the theme you\u2019ve chosen. This section is not editable but is very useful for reference. To fully understand the changes you can make using CSS, study this stylesheet\u00a0<span style=\"margin: 0px;padding: 0px\">carefully to identify the current design and create a design plan outlining the modifications you would like to make<\/span>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2312\" src=\"http:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-content\/uploads\/sites\/55\/2024\/12\/Screen-Shot-2024-12-30-at-12.30.25-PM.png\" alt=\"Screenshot of Theme Web Styles (Jacobs) for Custom Styles in the Appearance section.\" width=\"3020\" height=\"1016\" \/><\/p>\n<div class=\"textbox textbox--examples attributions\">\n<div class=\"textbox__content\">\n<p><strong>Image:<\/strong> Accessing Custom Styles on Pressbooks.<\/p>\n<\/div>\n<\/div>\n<h3>Your Web Styles<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2313\" src=\"http:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-content\/uploads\/sites\/55\/2024\/12\/Screen-Shot-2024-12-30-at-12.30.33-PM.png\" alt=\"Screenshot of Your Web Styles for Customization in the Appearance Section.\" width=\"3016\" height=\"762\" \/><\/p>\n<div class=\"textbox textbox--examples attributions\">\n<div class=\"textbox__content\">\n<p><strong>Image:<\/strong> Accessing Your Web Styles on Pressbooks.<\/p>\n<\/div>\n<\/div>\n<p>The second section of the Custom Styles page, titled &#8220;Your Web Styles,&#8221; is where you can make edits or additions to the stylesheet. Any CSS added in this section will override existing styles for the same class. After identifying the element-specific styles, you can copy the corresponding code to override the original theme styles for that element. You can also create your own components or classes to use in the textbook.<\/p>\n<p><strong>Recommended Practice: <\/strong>Create a private page to test any CSS modifications. Have a design plan in place before making any modifications.<\/p>\n<h3>CSS for Web, E-book, and PDF<\/h3>\n<p>Pressbooks prepares files in multiple formats, including web, e-book, and PDF. Each format is created using a specific stylesheet designed for its unique requirements, so you will need to select which one you edit each time and ensure that you make changes in all three stylesheets if you want the three formats to reflect each other. Choose from the dropdown menu at the top of the Custom Styles page to switch between formats. You can select either web, e-book, or PDF.<\/p>\n<hr \/>\n<h2><a id=\"advanced\"><\/a>Important Points for Advanced Users<\/h2>\n<p>Some users may already be familiar with CSS. Even if you\u2019re fluent in CSS, remember that each of the formats Pressbooks produces operates slightly differently, so what you may be used to using for a web page won\u2019t necessarily translate to a PDF or e-book.<\/p>\n<ul>\n<li>Pressbooks doesn\u2019t allow you to write an entire theme in CSS; instead, you modify the existing ones by overriding the default theme\u2019s stylesheet. Therefore, even if you have used CSS before, there are some changes in how you write code. Explore the Theme Stylesheet (First Section of Custom Styles).<\/li>\n<li>When studying the Theme Stylesheet, use XHTML export to isolate particular classes and elements.<\/li>\n<li>When creating a new class, make sure to create the formatting for different text types (e.g. <span class=\"inline-code blue-text\">p<\/span>, <span class=\"inline-code blue-text\">h1<\/span>, <span class=\"inline-code blue-text\">h2<\/span>, etc.) so that when the <span class=\"inline-code green-text\">div<\/span> tag is used in the HTML of a particular section or part, you can make the whole class separate from the rest of the page.<\/li>\n<li>The <a href=\"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/chapter\/complex-css-appendix\/\" rel=\"noopenner noreferrer\">Complex CSS Appendix<\/a> chapter in the back matter of this book features some advanced customized CSS designs created by the Library\u2019s OER Team. Feel free to explore this section and the relevant CSS code for inspiration.<\/li>\n<li>Comment your CSS code.<\/li>\n<\/ul>\n<p><strong>Recommended Practice: <\/strong>After creating a design plan, make a private page to perform trials for any CSS modifications. Keep your design plan updated.<\/p>\n<div class=\"textbox textbox--learning-objectives\">\n<div class=\"textbox__content\">Considering modifying the default theme beyond the theme options provided as part of your Pressbooks project with Concordia University Library? If so, please include your intentions to customize the Cascading Style Sheets (CSS) in the project plan for your open textbook or open guidebook.\u00a0We additionally recommend creating a <a href=\"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/chapter\/design-appendix\/\">design plan<\/a>.<\/div>\n<\/div>\n","protected":false},"author":1,"menu_order":4,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[48],"contributor":[],"license":[],"class_list":["post-2308","chapter","type-chapter","status-publish","hentry","chapter-type-numberless"],"part":4781,"_links":{"self":[{"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/pressbooks\/v2\/chapters\/2308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":97,"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/pressbooks\/v2\/chapters\/2308\/revisions"}],"predecessor-version":[{"id":6529,"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/pressbooks\/v2\/chapters\/2308\/revisions\/6529"}],"part":[{"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/pressbooks\/v2\/parts\/4781"}],"metadata":[{"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/pressbooks\/v2\/chapters\/2308\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/wp\/v2\/media?parent=2308"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/pressbooks\/v2\/chapter-type?post=2308"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/wp\/v2\/contributor?post=2308"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/opentextbooks.concordia.ca\/pressbooksuserguide\/wp-json\/wp\/v2\/license?post=2308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}