Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Themes and Color Overlays
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 1, 2011 - 3:57 pm

As a theme author you provide a basic theme detailing how the simple press installation should look.  Color overlays are a relatively simple way of allowing multiple color variations of your theme or perhaps even more useful, a simple way for a user of your theme to easily change the basic color scheme without redoing the entire theme...

One could think of color overlays as being a child theme...

Color overlays are completely optional and not required to be supported.  If you do not want color overlays, just use a standard .css file for your stylesheet and leave the overlay section of the spTheme.txt file empty.

The best way to understand how color overlays work is to probably look at our default theme and see how it is done... but, I will try to walk you through some of it here...

The simple press api will process the spTheme.txt for available color overlay variants and give uses on the forum - themes - theme list admin panel to select which color variant to use... check out the admin panel.

to do overlays, we use a php file for the stylesheet of the theme rather than css.  this allows us to put php code in the stylesheet.  in the theme/styles/overlays directory  you then create another stylesheet (think child theme here) where you provide the unique overlay settings...

in your main theme stylesheet php file, where you want to allow a color overlay to set a new color or style, use a php tag to grab a variable from the overlay files...  then in your overlay stylesheet, define the php variable and the css value for it...  then when the main stylesheet is processed, it will use the value defined in the overlay...

you dont need to define php variables for all the styles, just the ones you want to allow to be changed by overlays...  you can look at our default theme and its color overlays to see what we did.  you do not need to name them the same or allow the same values to be modified.  its whatever you want to allow to be modified.  in our case, we chose the ones we needed to provide the dozen or so color overlays you see with the default theme.

now we could have done like wp with child themes where css in the child overwrites css in the parent theme, but we dreamed up some wild ideas of what could be done in php vs css and didnt want to limit it to simple css overrides... 

I am not sure this topic does overlays (I keep saying color overlays only because thats what we chose to do with the default theme - so much more than color can be customized) justice, so please ask about any questions...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 643
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17343
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79590