Responsive Base, a child theme for Thematic

Responsive Base is a child theme built on the mobile-first approach to responsive web design. It was created not to just be responsive, but to act as a template or starting point for child theme development for the Thematic Theme Framework.

After creating quite a few Thematic based sites, I felt I needed a solid base starting point which saves a little time by being already set up with some very useful modifications I frequently use.

Responsive Base is ideal for me, I created it for me. Although others working with responsive themes for Thematic will find it useful and refreshing. It is intended to work best with the latest version of Thematic, but works fine on 9.7.7 and above.

Responsive Base Theme Image

Demo Responsive Base Theme

Download Responsive Base Theme

View the demo to take a peek, or visit GitHub to download or view the code. Special thanks to Kathy for inspiration from her adaptive layouts for Thematic.

Responsive Base Highlights

The CSS

Thematic has a great minimalistic style by default, but I prefer not to have those default styles at the start of every child theme.

  • The reset.css has been replaced by normalize.css which preserves the browser defaults and also corrects common browser inconsistencies.
  • Original style sheets have had a ton of the unnecessary styles removed and condensed, while also building everything with a mobile first approach to responsive web design.
  • Added HTML5Boilerplate print styles for clean printing and HTML5Boilerplate helper classes to take advantage of the latest best practices for things like clear fixes and image replacement.

The Functions PHP

  • Adds my snippet to add conditional classes for Thematic to the header to target old versions of IE. This also now adds the meta viewport for correct scaling on mobile devices. By default this responsive theme will display a static mobile version with a little CSS for IE7 and IE8 based on a post by Joni Korpi called leaving old IE behind.
  • Includes a few functions to clean up the head of the document of lines of code that are loaded by default.
  • Helps optimize script loading in WordPress by providing a template to promote good habits. Combining scripts, loading custom scripts in a custom.js file instead of on page and loading scripts in the footer unless they are required to load in the header.
  • Loads Modernizr which includes the html5shiv for getting IE to recognize new HTML5 elements, also Modernizr does a ton more, especially useful for providing CSS3 fallbacks. Responsive Base child theme comes bundled with the full version of Modernizr, you should however use the build script to only include what you need.
  • Loads FitVids JavaScript which handles the resizing of videos for responsive websites.
  • Also provides a bunch of handy functions I tend to use on most child theme builds. Such as PHP snippets to add a Favicon, register additional menus in WordPress, a fourth subsidiary widget (good for footer menus), optimized Google Analytics and also a snippet to hide widget locations in the admin area.

Responsive Base File Structure

Includes necessary folders and files already setup in the child theme to promote well structured themes.

  • /images/
  • /js/
    • custom.js
    • jquery.fitvids.js
    • modernizr.js
  • favicon.ico
  • functions.php
  • screenshot.png
  • style.css
  • style.scss (for SASS/Compass)

Last Thoughts

While this theme is intended for developers to dive right in to responsive design with Thematic, it would also help people who are new to child themes get an idea on how things can be done in a clean and efficient way. Getting started in mobile-first responsive design can be rough at first, so hopefully you find this child theme template useful and be sure to always get the latest version or fork your own from GitHub.

Child Themes using Responsive Base

Feel free to post your creations with the Responsive Base child theme in the comments, or if you think of anything to add, shoot me a pull request on GitHub. :)

Update: Now made to comply to with Idiomatic-CSS guidelines and also added a style.scss file for a basic SASS structure which also follows the guidelines. If you don’t use SASS, just delete the style.scss file.

Update: Now works with the Thematic HTML5 Plugin by Karin at invistruct.com.

48 Comments

  1. Posted November 12, 2012 at 7:08 am | Permalink

    Hey Scott, I lost some changes/styles and I think it has to do with Thematic updating. I ended up with a 500 error. Basically the Home Page would show the RSS icon normally and than the 5 query posts as full images. So my site is down and I’m thinking, should I learn Less or SASS? Suggestions?

    • Posted November 15, 2012 at 7:53 pm | Permalink

      That is odd things broke, was it throwing an error if you turn on WP Debug, they changed the way the post classes are and it broke one of my sites where I had a static page, but that was easy to fix by using WP’s default for calling post classes.

      Also, SASS is very easy to learn since technically CSS will pass for SASS and really it boils down to how far you want to push it. There are tons of video tutorials on SASS out there, while it would be good to learn as it is the future of CSS (imo), if you aren’t developing continuously, then it may not be necessary to bother with it. Personally, I love it. ;)

  2. Posted November 22, 2012 at 3:38 pm | Permalink

    Hi Scott,
    I’m using your Responsive Base for my new blog: http://byfilipinowriters.com/ so I drop by to say: Thank You! I did very minimal changes to your theme’s css file (I added the @font-face) and functions (added the code for header widget and menu attribute). The customizations I made, I entered them in the WP: Dashboard -> Appearance -> Edit CSS. Cool coz I don’t need to changes the default on your theme’s css. :) I’ll use Responsive Base for my other personal blog.

    • Posted November 25, 2012 at 10:09 pm | Permalink

      Nice, interesting color scheme. :)
      Looks like you are still working on it, I will check back every now and then to check the progress.

  3. Dave
    Posted December 13, 2012 at 10:34 am | Permalink

    Just a quick question here: how can I activate the dropdown menus on non-mobile devices?

    • Posted December 13, 2012 at 10:52 am | Permalink

      Well, you can’t.
      The short story is the current script Thematic uses doesn’t work with responsive web design so an alternative solution must be built in.

      The long story is Responsive Menus are complicated, there are so many different ways to do things that inserting a dropdown menu in Responsive Base would almost be a disservice to someone as it would only be one of many solutions. I have been pelted with questions and emails about dropdown menus and I am in the process of creating one for my Child’s Play theme since it is more intended to be finished theme, where in Responsive Base I tried to do the less is more approach to keep things simple. When I finish this (most likely today), I will start working up a quick way to bolt the menu up to Responsive Base for questions like this. But for now, there are many menus out there, you have to build it. The best resource I could point you to would be Brad Frost’s Codepen, where a bunch of responsive menus reside in a minimal format which is perfect for working into this theme, he has a bunch. :)

      • Dave
        Posted December 13, 2012 at 10:54 am | Permalink

        Makes sense to me. I appreciate the quick reply!
        I’m just starting to dive into this theme, and it’s pretty exciting so far. Thank you!

  4. Posted December 13, 2012 at 4:42 pm | Permalink

    I took some time and implemented a solution using suckerfish (or superfish? wtf is it called? Whatever it is that Thematic comes with), and Child’s Play, essentially following someone’s instructions on GitHub that I thought was posted here, and… now can’t find. And unfortunately the site is still in dev, so I can’t post it just yet. So why I’m even responding here I don’t know. To frustrate everyone maybe? :P

    • Posted December 13, 2012 at 6:34 pm | Permalink

      So… about that other version posted on Github. There is a bug in it, the mobile menu (small scale) still has drop down functionality enabled.

      While it may look fine on a desktop version, you are using the mouse to hover over those elements, so without a mouse, those dropdowns won’t be visible (or accessible).

      Example Images: http://www.diigo.com/item/image/3estx/mnk5 and http://www.diigo.com/item/image/3estx/b8g6 show how you need to hover over it to get it to show up, no hover on mobile devices. :(

      As mentioned above, I am 90% done with the solution to this, although….. I may drop it and use one of Brad Frost’s patterns because the way I have it currently is like the most simple functionality. So I may step it up, but for now I should have it pushed up to Github shortly. :)

      • Posted December 13, 2012 at 10:25 pm | Permalink

        Yep I ran into that bug, and then fixed it by implementing buttons into the sub menu top level links. So any menu that has a sub menu gets a button assigned to it. That way if you roll a mouse over it, it expands. If you don’t have a mouse, you have a button to tap to expand.

  5. Posted December 13, 2012 at 10:26 pm | Permalink

    Probably going to wind up being the exact same solution you’ve worked out. :)

    • Posted December 13, 2012 at 10:31 pm | Permalink

      Lol, dang… I haven’t even got that far. I was going to avoid that by showing all the links and have submenus indented. Currently I am working on flyout indicator arrows since I figured that was going to come up. Well…. If worse comes to worst I can steal your solution for the buttons. :P

      I so hate working on menus (well ones with dropdowns), they can be done so many different ways.

  6. Posted January 29, 2013 at 4:54 am | Permalink

    Since you hate working on menus…… Could you point me in the right direction on how to strip out a big chunk of thematic and replace so I can have the Bootstrap style of menu? Been digging through the extensions and even considered jumpig over to Bones/Roots but that’s a new learning curve after a couple of years playing around with thematic.

    I have tried Sass and have Compass installed but yet to get past my thematic code to style.

  7. Posted February 24, 2013 at 7:49 pm | Permalink

    Hi Scott,

    Great work with this theme. Responsive is definitely the way things are heading, but I’m yet to find another option that gives you this much scope to customise and ‘make the theme your own’.

    I was wondering, is there a way of giving the theme breaking points, so that, instead of scaling all the way up to its full width, it ‘snaps’ between layouts?

    Also, how would I go about changing the maximum width that the site stretches to?

    Thanks again,

    Alex

    • Posted February 24, 2013 at 8:52 pm | Permalink

      As far as giving the layout specific breakpoints, this is very easy and is done with the media queries, you just need to add more of them and change the max widths.

      @media only screen and (min-width: 45em) {
      #branding,
      #access .menu,
      #main,
      #subsidiary,
      #siteinfo {
      max-width: 1140px;
      }
      .....
      }

      What may be confusing here is the “min-width: 45em” part of the media query, I used EM measurement instead of PX because there is some edge case usability thing with scaling that pop up and cooler people than myself use it. You can change that to pixel values to make things a little easier to work with (ie. “min-width: 700px”).

      When you talk about specific breakpoints, it sounds like you want to be using an “Adaptive” approach which is often confused as responsive design. Adaptive is actually easier to code, but isn’t recommended since you can’t set breakpoints for every device so you end up catering to popular sizes and if someone has a a 760px device and you end up serving them the layout for a 480px device so there is some extra space on the sides, which isn’t a huge deal. However, with a fluid responsive site the user sees a site which will always fill up the screen size of any device.

      Now, that may be confusing, here is an image which shows that when the browser is scaled down to a certain width the site jumps to the mobile view, all that extra space on the sides is then wasted. Adaptive design is often called responsive design, which is one of my pet peeves and it is very confusing because adaptive is easier, but responsive is better. In the end it is all personal preference.

      So to add specific breakpoints, really you need to just change the media query break points and set the maximum widths, both in the CSS. Technically you could just set a max width on the #wrapper, but in responsive base I opted to do max widths on the internal elements to make it easier for people who want to extend things, like background colors and images so they are full widths (which is most common on sites I build).

      The above is probably confusing, but just change the EM to PX in the media queries and play around with the max widths and you will get it quickly, also if you want the layout to be more adaptive you may need to add another media query completely, so you end up using a few which is totally normal. If that fails, feel free to let me know if you need help with something. ;)

      • Posted February 24, 2013 at 9:25 pm | Permalink

        Thanks for your reply. The main reason I wanted to do this was so that the images don’t do all sorts of strange things as the site reorganises itself as it scales. I figured that, if the overall site had a narrower max-width, most people who look at the site on computer screens will see the same thing, and I will have more control over how the images sit within posts.

        Is there a way you can think of that I could have images go from being left-aligned or justified to being full-width when the site scales to its smallest (mobile) size?

        Thanks for your help. Very thorough!

      • Posted February 24, 2013 at 9:30 pm | Permalink

        Actually, ignore that last one – it works already! Thanks!

  8. Neal
    Posted February 25, 2013 at 8:49 am | Permalink

    Hi Scott. Thanks for posting. What are you using to achieve the three responsive columns on your about page?

    • Posted February 26, 2013 at 8:23 am | Permalink

      On the About page I use a custom version of a columns shortcode plugin I created that I never got around to posting the responsive version, like so many other things I create.

      There is however a plugin that is built better than what I created, it is actually really good and I would highly recommend it. It is called Grid Columns and is by Justin Tadlock. For something like shortcodes you want to use a plugin, that way they stay theme independent.

  9. Jill
    Posted March 14, 2013 at 8:45 pm | Permalink

    Sorry if this is a silly question, but I am relatively new to Thematic (and child themes). I’ve played around and built my own Thematic based child theme. But now, if I want to use Responsive Base, should I create a child theme that uses Responsive base as it’s template? Or can I safely just start modifying Responsive Base leaving Thematic set as the template? Just wondering what happens to my site if you make development change to Responsive Base. Hope this makes sense! Thank you.

    • Posted March 14, 2013 at 9:33 pm | Permalink

      You are going to want to use Responsive Base as a starting point and develop on top of it. While you will not be able update, there really isn’t anything complex about it that will need major changes to warrant an update. I tried to make it as simple as possible so people don’t have to work through stripping Thematic down, I know I got tired of it.

      I have probably built around 15 sites on it so far and by doing that I have worked out most of the minor kinks, mostly all CSS. In fact this layout you are looking at now is one I just put up today, built from Responsive Base and I reworked everything to be extremely SASS/Compass heavy with use of Susy Grids (my current workflow).

      Just use it as a head start starting point and make it your own. Eventually you will probably end up with your own version that is set up best for your workflow. Then anytime you think of anything to add/subtract, just modify your custom version of Responsive Base. :)

      • Jill
        Posted March 15, 2013 at 1:08 pm | Permalink

        Great. Thanks for clarifying. I’m nervous, but I’m diving in…

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>