Book Image

Bootstrap Site Blueprints Volume II

By : Matt Lambert
Book Image

Bootstrap Site Blueprints Volume II

By: Matt Lambert

Overview of this book

Bootstrap is the most popular open source project on GitHub today. With a little bit of know-how, this massively popular CSS framework can leveraged for any type of complex web application or website. Bootstrap Site Blueprints Volume II will teach you to build these types of projects in an easy-to-understand fashion. The key to any complex Bootstrap project is a strong development foundation for your project. The book will first teach you how to build a Bootstrap development environment using Harp.js, Node, and Less. In the next chapters, we’ll build on this foundation by creating restaurant and mobile-first aggregator projects. Once you’re warmed up, we’ll move on to more complex projects such as a wiki, a new magazine, a dashboard, and finally a social networking website. Whether you are brand new to Bootstrap or a seasoned expert, this book will provide you with the skills you need to successfully create a number of popular web applications and websites.
Table of Contents (14 chapters)
Bootstrap Site Blueprints Volume II
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Mobile-specific styling


The last thing I'll cover in this chapter is some specific mobile styles that I applied to the layout. You will need to insert these styles at the bottom of theme.less in the /css directory. Before I explain the code, here's a preview of what the mobile version will look like on a phone:

Now, let's review the custom styles that go into the making of this layout:

@media (max-width: 768px) {
  .container {
    padding-right: @padding;
    padding-left: @padding;
  }

  .add-content {
    float: left;
    margin-top: @margin;
  }

  li.desktop-only {
    display: none;
  }

  .modal a {
    font-size: (@font-size * 2);
  }
}

Let me explain how the mobile specific styles work for this project:

  • I'm using the value of 768px in the media query to target tablets and phones with these mobile-specific styles.

  • The styles in the .container class reset the left and right padding. I've added more padding to our desktop containers to squeeze the layout.

  • I want the Add Content button to...