{"id":2391,"date":"2018-07-21T14:02:43","date_gmt":"2018-07-21T12:02:43","guid":{"rendered":"http:\/\/themanual.local\/?p=2391"},"modified":"2023-08-27T08:24:28","modified_gmt":"2023-08-27T06:24:28","slug":"adding-custom-css-advanced","status":"publish","type":"post","link":"https:\/\/simonbarnett.co.za\/themanual\/adding-custom-css-advanced\/","title":{"rendered":"Adding Custom CSS &#8211; Advanced"},"content":{"rendered":"\n\n\t<p>When considering using Beaver Builder at an advanced level, I think the first thing to know is what to do when and where ie.<\/p>\n<ol>\n<li>when to use the BB tools to style stuff,<\/li>\n<li>when to override using CSS,<\/li>\n<li>and where to put the CSS.<\/li>\n<\/ol>\n<p>I&#8217;ll cover the first two shortly, and mention the third for now:<\/p>\n<h3>3. Where to put the custom CSS.<\/h3>\n<p>The order in which CSS stylesheets are loaded,\u00a0affects the\u00a0<a href=\"https:\/\/css-tricks.com\/precedence-css-order-css-matters\/\" target=\"_blank\" rel=\"noopener\">cascadence \/ preference \/ specificity<\/a>.<\/p>\n<p>There are several places to put CSS which I&#8217;ll mention in order of global vs specific,<\/p>\n<p>But firstly, the <strong>non-editable default CSS<\/strong>, which loads first.<\/p>\n<ol>\n<li>The BB Theme default CSS\n<ol>\n<li>Base CSS<\/li>\n<li>CSS modified by settings<\/li>\n<\/ol>\n<\/li>\n<li>The BB Theme Builder (Themer) default CSS\n<ol>\n<li>Base CSS<\/li>\n<li>CSS modified by settings<\/li>\n<\/ol>\n<\/li>\n<li>The BB Plugin default CSS\n<ol>\n<li>Base CSS<\/li>\n<li>CSS modified by settings<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>Next, <strong>the custom CSS<\/strong>, which loads next.<\/p>\n<p>These are places you can add your custom CSS overrides.<\/p>\n<ol>\n<li>The Customizer\n<ul>\n<li>You can enter custom CSS in the Customizer, but I prefer not to. The window is too small.<\/li>\n<li>There are benefits, such as live-updating.<\/li>\n<\/ul>\n<\/li>\n<li>Appearance &gt; Edit\n<ul>\n<li>We will be using the\u00a0<a href=\"https:\/\/docs.wpbeaverbuilder.com\/bb-theme\/getting-started\/install-the-bb-theme-and-child-theme\/\" target=\"_blank\" rel=\"noopener\">BB Child Theme<\/a>, which requires the BB Theme.<\/li>\n<li>You can edit the Child Theme&#8217;s CSS in Appearance &gt; Edit.<\/li>\n<li><strong>This is where I add theme CSS<\/strong> ie CSS for the structure of the site.<\/li>\n<li>I usually end up also adding content CSS here too<\/li>\n<\/ul>\n<\/li>\n<li>Beaver Builder (plugin) &gt; Global Settings &gt; CSS\n<ul>\n<li>It has a similar scope to 1 and 2 in this list in that CSS added in these places affect the entire site.<\/li>\n<li>This is possibly a good place to add content CSS, ie CSS that applies to all text, headings ie. H tags, lists etc.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>Once you&#8217;ve set the CSS that will be utilised site-wide, you can begin to style individual pages. This is done by starting the builder, clicking the dropdown at the top right of the Builder menu, and selecting &#8220;Layout CSS &amp; Javascript&#8221;. You can add page-specific code here.<\/p>\n<p>To keep the stylesheet trim by only applying CSS where \/ when needed, I use page-specific and row\/column\/module-specific CSS wherever possible.<\/p>\n<p>Repeating content should be made into <a href=\"http:\/\/simonbarnett.co.za\/themanual\/how-to-re-use-a-layout-on-another-page-or-post\/\" target=\"_blank\" rel=\"noopener\">Beaver Builder templates<\/a>, and the CSS for those templates is saved with the template.<\/p>\n<p>Therefore the CSS for a template is only added to pages that use the template, thereby keeping the page or post as trim as possible.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>How, when, where and why to use custom CSS<\/p>\n","protected":false},"author":1,"featured_media":2392,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,28,9,10],"tags":[],"class_list":["post-2391","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced-styling","category-advanced","category-general-advice","category-specific-instruction"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/posts\/2391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/comments?post=2391"}],"version-history":[{"count":0,"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/posts\/2391\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/media\/2392"}],"wp:attachment":[{"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/media?parent=2391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/categories?post=2391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simonbarnett.co.za\/themanual\/wp-json\/wp\/v2\/tags?post=2391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}