Custom CSS in Theme vs. Custom CSS on Entire Site
gatoruss
Registered Users Posts: 27 Big grins
If I added custom CSS to my Theme would that have the same effect as if I added custom CSS (via a content widget) while in Customization Mode with "Entire Site" selected?
0
Comments
The css that you add to the theme would have the same effect as css added to the entire site. The css would only be effective for pages that you have selected the theme you add the css to. If you select a different theme the css would not be effective. If you add the css to the entire site using a css content block it would be effective even if you used different themes.
Anthony
SmugMug
Support Hero
finding things. In NewSmug I try to add CSS rules into the areas that they affect. Smugmug has
conveniently supplied us with these areas. "entire site", "homepage", "all folders", "all galleries"
and "Just This ...".
My Website index | My Blog
As noted above, if you use multiple themes on one site (which I do) and you attach the CSS to a theme, then that CSS will only apply to pages using that theme. That's good if you want to target the CSS or if the CSS addresses things specific to the theme like colors or fonts. That's bad if you are aiming for a global effect, in which case, updating the CSS means updating it in multiple places.
My personal take is that since themes are really "skins" -- color and font schemes -- only CSS dealing with those elements belong there. Site structure is managed by the entire site template, folder template, gallery template, and individual page customization. I put CSS adjustments of structural adjustments in CSS blocks there, at the appropriate level. That seems the easiest way for me to maintain the code and, indeed, to find where I put CSS mods when I go looking for them later.
When I first started, I was putting all CSS in the theme. But I came to realize how much longer it takes to get to the theme CSS than a CSS content block. Don't try to find it on the page, just click on it in the right (or left) bar. Far fewer clicks.
I'd use the theme CSS if i wanted multiple themes. But since I only use one theme, all my CSS can go into content blocks.
Dave
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk