This book won’t debate whether responsive web design (RWD) is a good idea or worth our time pursuing. I can guess you’ve already made up your mind on that account just as I have. I consider RWD crucial for any modern web site. Given that common ground we can move forward with a goal of advancing the craft. We can put together a complete toolbox dedicated to helping you develop and, more importantly, debug your responsive web design.
I hope this book helps you when you most need an answer. Making your daily professional pursuit easier is my singular goal in writing this. Discovering a set of techniques enabling and amplifying your effort is what will happen as you travel through the pages. Reading from chapter to chapter, you’ll assemble a box full of time-saving tools that build upon one another, forming a strong chain.
You will discover hands-on examples of effectively using these tools. You’ll receive nuts-and-bolts examples discussing how to use them and, more significantly, when and why. Talking about problems that need solving and how to go about approaching them will empower you when replacing tools becomes necessary. Why replace tools? Some become obsolete. Some become boring, and a desire for something different drives creative inspiration.
Why should we assemble a powerful toolbox? Because debugging responsive web design isn’t easy! Imagining how a page layout appears across phones, tablets, laptops, and super-wide monitors is a brain-bending exercise. Seeing how HTML, CSS, and JavaScript work across a wide selection of devices is complicated. The list of devices commonly found out in the wild isn’t shrinking, either. In fact it’s expanding as Android devices grow and exotic machines appear. You may already be targeting glasses, watches, and thermostats.
This book will share immediately useful concepts, helping you more safely navigate one of the most difficult things we tackle: building websites that respond to a world of devices.
When you get to a point that it feels as though you wish you could throttle a website into submission by hammering it into shape, I expect tools and techniques found in this book will give you the confidence and strength to debug your designs into working order.
An audience of technically minded designers will find practical topics in this book such as:
As we review each of these concepts, reason is always applied: reasons we reach for a particular tool, how to wield it, and the creative power it’s meant to amplify. While technology changes and tools are replaced, the reason to use them remains.
Here’s an admission: When I discover a website that’s built responsively, I’ll play with it, seeing how it reacts. I love playing. It’s such a fantastic way to learn. My daughter taught me how to wonder through play without expectation. She’s always curious, open minded, and ready to see.
I try taking on that point of view as I pull my web browser frame from right to left, slowly making it smaller. Small enough until it’s the width of a phone. Then with a pause of admiration, I’ll drag the browser’s right edge back to full screen’s width, watching how it responds to my movement. How does it fill a desktop screen size?
The act of screen layout destruction and creation fascinates me. What pieces decide to shrink down? What sections pop away? What springs into life, hidden until my movements reveal them? How does the site decide to break down anticipating the viewer’s screen width? Responsive design is a brief, choreographed dance performed for my audience of one.
Do you do the same thing? Admire the complicated beauty that unfurls as a sail blowing full in the wind before collapsing down into stillness? Orchestrating that composition is not without heartache. It demands dedication. Making it look smooth and effortless takes tremendous effort. Dynamic, user-driven interaction remains one of the most compelling aspects of our digital world. It’s the reason for responsive web development.
Inspiring the content in this book is a desire to serve technically minded designers and web developers. Anyone wanting to power up their craft of delivering their responsive websites more quickly will find serious tools here.
If we asked a group of people to define responsive web design, what answers would you expect to hear? More than likely, we’d get descriptions. People would tell us qualities of what it is and what it isn’t. Perhaps we’d hear about popular libraries and frameworks used for successfully building responsive designs. Fluidity, adaptivity, grid-based formats, media queries, and breakpoints might be mentioned.
You and I probably share similar expectations for responsive web design. They’re relatively simple given the overall complex topic. For each category of device (phone, tablet, laptop), the site best fits to the capacity of the viewer’s hardware. It’s amazing that all possible views are held within a unified design architecture, showing enough information, enabling our customers to effectively interact with our technology.
Observations on implementation details are honest reflections of our current understanding. It’s informed by engaging in development, consuming responsive sites, and being interested in the community’s best practices.
A few years back, facing the increasingly diverse array of screen sizes our customers view our websites with, our industry had to invent a technique, one promising that our sites look and work well for all. Responsive web design was, and for the most part currently is, the primary solution for that complicated challenge.
Desiring a richer context on the domain, I discovered Ethan Marcotte’s May 2010 article on A List Apart to be one of the earliest opinions on the matter. In his article, Marcotte compares the relatively transient nature of software and websites to the relative permanence of architecture. More significantly, he teases out metaphors drawing upon a building’s foundation, footprint, and potential for flexibility.
There surely is a losing battle in a pursuit of making designs specifically for a given form factor. So many screen resolutions exist that keeping up is traveling a maddening path with only loss of time and sanity found at the end.
We can easily agree with a client’s request for supporting typical screen sizes: “oh yes phone, tablet, laptop.” In that very assurance, we know phones come in 4- and 5-inch versions. We know tablets come in 7- and 10-inch forms. We know computers have all sorts of dimensions as well as external monitors. Further still, my videogame station hooked up to my living room HDTV has a high-end web browser.
Marcotte spells out the underpinning concept so well.
We can design for an optimal viewing experience, but embed standards-based technologies into our designs to make them not only more flexible, but more adaptive to the media that renders them. In short, we need to practice responsive web design.
“Responsive Web Design,” last modified May 25, 2010,
http://alistapart.com/article/responsive-web-design
Seek out that article when you have the time if you’ve not read it. Even more fun for me is that Marcotte’s proof-of-concept web pages remain functional. They demonstrate his techniques, which are relevant today.
As a product engineer, I admire his initiative looking at real-world references, such as buildings and architecture for inspiration and convention that our digital world might use. Often enough, I’m stuck on a horridly demanding problem, and success comes into view as I look at the problem through the lens of other industries.
How many screen sizes are there? What’s a realistic count that we need to support? Is it actually so complicated? Yes, certainly more than we know.
Treating a new user or perspective customer to a sad experience is the worst. Anything less than a great experience lets your audience drift away to your competitor. The viewer doesn’t have an investment hooking them into figuring out your site.
As a study, I’ve reviewed my blog analytics. I found that approximately 350 different screen sizes have shown up while users are reading my articles. Of course I need to serve each and every one of them, or I feel that I’ve failed. Fortunately I’ve built my blog with responsive web design in mind. RWD allows me to satisfy my readers by fitting my content into their screens in the best way possible.
Reading that statistic, someone might exclaim “Three hundred and fifty! How can that many screen sizes exist? Sure, we have many phones, several tablets, lots of computers, and a couple of external monitors, but that’s not possible.” A fair reaction.
Not only mobile devices figure into the count. In fact every time someone resizes their web browser on a computer they’re hitting my blog with a different view. Their experience is uniquely theirs, and if my blog carried ten times the readership traffic, I’m sure I’d see at least double or triple the number of screen sizes.
Looking at the analytics data, I see visitors presenting groups of screen sizes.
| Amount of Visitors | Amount of Screen Sizes |
|
|
|
| 62% | Top five |
| 87% | Top ten |
| 93% | Top fifteen |
Trailing behind the top fifteen is a long tail of random shapes and sizes, probably representing whatever resolution my readers resized their desktop browser to before navigating to my site. Don’t be too worried, because order does emerge from this randomness. Easily recognized sizes typical of phones, tablets, and laptops are counted among the top fifteen most popular visitors to my blog. Similar patterns will show on your site as well.
If you’re looking at that screen size data and thinking its insights are totally useful, I agree. We can turn data into knowledge, understanding what our customers need from us. If you’re thinking I must have labored getting the data in the chart above, that’s the awesome part. Getting those numbers is simple. Because reporting them only takes five minutes, I refer to them often.
Anyone in charge of project budgets thinking responsive web design is a magical solution because “we build it once and it works on anything, all the platforms come for free, and it’s cheaper because we build the UI once instead of three times” misunderstands the technique. It’s more expensive and more difficult than creating a user interface (UI) for a single device. It takes more brain-sweat, more paper prototyping, more mindful consideration of everything your user wants to do on your site. Enabling them to consume your content with devices of any size can feel mind blowing, but we’ll make it easier starting today.
Early on, if we can imagine how our users connect with our website, we can encourage that connection. Ensuring it’s as straight a line as possible without distracting turns down broken paths is compassionate as well as valuable.
Every page of this book supports your goal of crafting a fantastic user experience founded on responsive design principles. Please understand that very little time is spent in the design or implementation of RWD simply because dozens of books and hundreds of blog articles already cover that.
Someone might ask, “Is writing the files making up a responsive website easy?” and I’d answer, “No way.” We do know that many books and articles exist to serve that audience. In fact, every website on the Internet is a functional example showing CSS, HTML, and JavaScript. All that’s needed is a web browser with solid inspection tools.
Given that, I turn your attention to the next steps in the creative workflow:
Where will these next-level tools come from? In many ways, it’s mindfully adapting parts of the tool chain that at first appear to be the exclusive domain of software engineers. Pulling over parts of their toolbox means strengthening the toolset of technically minded designers and developers. The goal is clearly demonstrating in practical ways that you can easily understand, appreciate, and leverage, all in service of making you more productive and elevating you above your peers.
Testing and debugging is a constant focus throughout this book. It’s not good enough to only write all the files making up a website, because at some point, they must be run on user devices. Before they are, we’d better confirm the site operates with an acceptable level of quality. Detecting problems, reproducing them, discovering what causes them, and turning around changes is an ongoing process. Using powerful code-inspection tools makes finding bugs easier.
Rapid iteration makes bug finding and fixing more joyful. Discovering a problem with our work makes us sad pandas, but fixing them quickly brings happiness. How do we shorten that loop? How do we stay in the creative flow more often? One way is bringing live production environments, such as web servers, onto the same computers where we create our work.
Emulating production servers helps us find and fix bugs. If we can create, test, debug, and verify code and art changes on our own computers, development time decreases and happiness increases. Comfort and convenience go a long way. Being on our own machines leads to that. Installing the same web server used in live production on our computer enables us to see our work nearly the same way our users will. We can see our website as they do, identify as them, and meet their needs before they arrive.
Simulating user device screen sizes, again on our work computer, is a fine way to test our design seeing it as our users will. Identifying as them, practically by way of their viewing machines, allows us helpful insight into our creation.
Making all of the tasks easily done, repeatable, means we reality check often. Reducing friction of a process means people will do it more often. In this case, it’s a very good thing indeed. This relates to automation.
Automation is highly valued. The thinking is that as the complexity to do a thing is lowered to a point that it’s free to do, why wouldn’t an individual or team do more of that? Especially when it delivers a better user experience. We will review automation in some chapters because it’s a competitive advantage.
Many excellent sources explaining the design process, from sketching through paper prototyping to authoring source code, are out there. Where their voices grow silent is on the grueling task of developers testing and debugging against an ever-growing array of devices.
This book focuses on filling the gap between writing code and a site appearing on users’ devices. Much time is spent assisting you in more easily testing your design, more rapidly turning around source code changes, and more soundly debugging it. Ways of incorporating reality checks such as simulating production server environments and screen sizes without hardware are crucial topics.
Designers, artists, and developers wanting more guidance on designing and planning ought to look for alternatives. Typical RWD implementation topics like the following are not covered here:
All of these topics are crucial for our craft, and I want every reader of this book to succeed at them. Learn more about them by spending time in the search engine of your choice plugging in those keywords.
Once you’ve internalized those concepts and are building a website, please crack open this book for concrete ways of reviewing and validating your designs. You’ll find that troublesome effort can be done more easily, cheaply, and generally more happily.
In my opinion, “development” incorporates the entire process of building software rather than any particular job. Everyone who has a concrete touchpoint in an application or website is a “developer.” Why does that matter? It’s to assure readers of this book that it’s not written with programmers in mind. In fact, many of us feel that artists are evolving into roles that pull tasks for writing code as well as traditional look, layout, and workflow. In my mind, this is a technically minded designer. It’s high time to raise them up.
Designers are the primary audience for this book, but everyone on the team will take away something useful for making their job easier. Benefits abound for teammates who gleefully cross boundaries but take a deep dive in some specialty skill. Let’s get out from behind our silos and see what other folks are doing!
Working closely together comes naturally for generalists at start-ups. Everyone must seemingly do everything just to willfully pull it off the ground. Furthermore, cross-functional teams are found in any number of companies.
What are key challenges for developing responsive design?
If responsive web development is as complicated as all this, who would ever want to do it? In fact, we know who demands it: our customers, made up of end users and clients paying for modern websites.
What are specific ways this book makes responsive web development easier?
Anyone building modern-day websites will benefit from the lessons contained in this book. It’s not just designers but also technically minded artists, web developers, quality-assurance testers, and leaders managing creative teams.
Technically minded designers will gain insights into the next level of development, incorporating ways of testing websites by emulating how users view their work. Installing servers that closely match final live production environments helps diagnose glitches earlier in the build process, when changes are less costly.
Quality-assurance experts may want to incorporate ways of emulating devices on their own computers with an eye toward delaying expensive hardware orders for as long as possible. Analytics reporting reveals what mobile devices are used the most and are therefore most worth budget spending.
Leaders will take away concrete strategies for reducing time to market and development expenses. Techniques show ways of directing their teams of designers and developers to fail fast. The goal is seeking out problems and glitches before they hit customer-facing environments.
Developers straight-up coding websites will have a new sense of joy when incorporating these tools. The drudgery of making wireframes and design mockups functional by coding them up will be easier as verification techniques are introduced.
Chapters are grouped to introduce you to new tools, explain their use, and then progressively advance your knowledge through new applications of them. Each chapter flows together from end to beginning, but you’ll see a few major groupings.
Chapters 1 and 2 contain an introduction to the book’s mission and the concept of adapting engineering tools and process to your daily workflow.
Chapters 3 through 6 introduce you to the importance of web servers and walk you through the steps necessary for installing, setting up, and using one on your own work machine.
Chapters 7 through 10 each survey a particular tool that will help you raise your expertise in web development, making responsive web development easier.
Chapters 11 and 12 conclude the book with a special project connecting the dots between several open-source tools, creating a highly customized megatool!
You’ll find boxes throughout the chapters pulled away from the regular text. These are totally optional reading, but they are linked to the lessons around them. Each offers additional details explaining some concept introduced in that section. Because they’re deep dives into the related subjects, feel to read them at your leisure or even skip them for a while.
I’ve made a website to accompany this book. Give it a look from time to time to see what’s new. I’ll be sharing on it the latest info I find on new tools that will help you hammer RWD into shape. I’ll also write answers in response to whatever questions I receive from you and your fellow book readers.
Anyone can walk over to the neighborhood hardware store to buy a hammer and screwdriver. It’s one thing to have the tools stacked on a work surface in the garage, but it’s another to know when to use them for solving a recognized problem.
It’s another talent to know when a tool needs to be replaced. Technology changes all the time. Hammers look very much the same as they did a hundred years ago. Software tools are a trickier matter. Compare two that solve the same problem, and they might install, behave, and act differently. Understanding the job you’re trying to finish directly influences what tool you reach for today. It also reveals the capabilities you seek out in its replacement tomorrow.
Ultimately, by following along with this book, you’ll assemble a compete toolbox of modern power tools specifically arranged for your success. Ideally, you’ll meet deadlines more quickly, leapfrog your peers, suffer less frustration, and stay more deeply immersed in the creative flow. You might even be happier!