Options

Custom CSS in Theme vs. Custom CSS on Entire Site

gatorussgatoruss Registered Users Posts: 27 Big grins
edited September 24, 2015 in SmugMug Customization
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?

Comments

  • Options
    CarnageCarnage Registered Users Posts: 8 Big grins
    edited September 24, 2015
    Hi,

    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
  • Options
    AllenAllen Registered Users Posts: 10,012 Major grins
    edited September 24, 2015
    I remember Legacy CSS, it was one huge block affecting everything, very confusing sometimes
    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 ...".
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    JtringJtring Registered Users Posts: 675 Major grins
    edited September 24, 2015
    Carnage wrote: »
    Hi,

    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

    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.
    Jim Ringland . . . . . jtringl.smugmug.com
  • Options
    pilotdavepilotdave Registered Users Posts: 785 Major grins
    edited September 24, 2015
    gatoruss wrote: »
    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?

    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
  • Options
    gatorussgatoruss Registered Users Posts: 27 Big grins
    edited September 24, 2015
    Thank you. All of these responses have been very helpful.
  • Options
    Hikin' MikeHikin' Mike Registered Users Posts: 5,458 Major grins
    edited September 24, 2015
    I guess I'm the odd man (my wife agrees) because I prefer adding all of my CSS to my Theme CSS. Maybe because I work with WordPress and that's how they do it, so that's how I run my SM too.
Sign In or Register to comment.