Monday, February 4, 2013

Your Daily digest for Template Designer`s Tools, Tips, Tricks and Tutorials

Blogtrottr
Template Designer`s Tools, Tips, Tricks and Tutorials
Find The Web Design or Corporate Idetity Template That You Are Looking For At http://templates.simplysly.com!
10 Works of Art on Vine
Feb 4th 2013, 20:22


We asked you to get creative with Vine and send us your best works of art and visual creativity, and the Mashable community on Vine did not disappoint!

SEE ALSO: What Makes Vine So Hot?

Vine users shared a plethora of eye-catching videos using the hashtag #VineArt. The submissions we saw ranged from a stop motion man who really needs a cup of coffee to creative visual magic.

Here are some of our favorites. Keep the Vine art coming!

#selfportrait with Vine vine.co/v/b1QqPbtPhiO— Mario Götz (@nimonsta) February 3, 2013

Origami Crane// #howto #fashion #pink #vineart prints by @laurenmoffatt vine.co/v/bJ027nuJZX6— angel (@fluffybubbles) January 30, 2013
Continue reading...

More About: art, Vine

Gay Rights Debate Consumes Boy Scouts' Facebook Page
Feb 4th 2013, 20:12


A fierce debate over gay rights has gripped the Boy Scouts of America's Facebook profile as its leaders meet this week to decide whether to reverse their ban on gay members.

More than 4,000 replies have been sent in response to the Scouts' latest Facebook post -- a simple message providing contact details for those who want to have their voice heard regarding the organization's vote.

The debate over whether to change that policy centers around a struggle between religious teachings and discrimination based on sexual preference.

Religion has long been at the core of the Boy Scouts of America, with more than two-thirds of Scouting groups affiliated with a religious body of some k…
Continue reading...

More About: Facebook, Social Good, US

Curiosity Rover Hammers Into First Mars Rock
Feb 4th 2013, 20:04


NASA's Mars rover Curiosity has pounded into a Red Planet rock with its drill for the first time, bringing the 1-ton robot a big step closer to initiating its first full-bore drilling operations.

The Curiosity rover hammered the rock using the arm-mounted drill's percussive action over the weekend, completing another test along the path toward spinning the bit and biting into rock for the first time.

"We tapped this rock on Mars with our drill. Keep it classy everyone," Curiosity flight director Bobak Ferdowsi — who gained fame as "Mohawk Guy" during the rover's nail-biting landing on the night of Aug. 5, 2012 — wrote in a Twitter post Sunday (Feb. 3), sharing a photo of th…
Continue reading...

More About: Curiosity, Mars, Mars rover, NASA

Google Flights Lets You Search Destinations by Region
Feb 4th 2013, 19:59


Making travel arrangements can be a hassle, especially when booking flights. Oftentimes, picking an airport to fly into can determine vacation budgets, but luckily, Google's got it covered.

Instead of searching by destination, Google Flights Search now allows you to look up regions. The broader set of results lets users see various airports in the area, instead of focusing on a specific location. The web-based tool, launched in 2011, gives the option of booking flights based on your available range of time or budget.

Now, with its new feature, instead of typing in "London" and being automatically directed to a list of flights, you can enter "England, United Kingdom." A list of differ…
Continue reading...

More About: flight search, Google, travel

5 Simple Tips to Digitize and Organize Old Photos
Feb 4th 2013, 19:38


How far back do your Facebook albums go? If you were one of the service's first users in 2004, you were probably still printing pictures at the convenience store -- or using Snapfish, if you were tech-savvy.

So what's a photography nut to do with her digitally undocumented pre-21st century memories? Grab those shoe boxes filled with prints and old-school scrapbooks. It's time to introduce your paper past to its digital destiny.

Keep It Cheap


Some scanning apps offer decent results via your smartphone's camera. Don't expect the highest quality results -- a glaring overhead light will ruin your "scan." However, free apps like DocScan (iOS only) and DocScanner offer a quick…
Continue reading...

More About: apps, contributor, features, photography

Secret Rules Grant Obama the Power to Order a Pre-Emptive Cyberstrike
Feb 4th 2013, 19:33


In case of an imminent threat, President Obama is authorized to order a pre-emptive strike using cyberweapons against the enemy, according to a secret legal review of U.S. cyberwar policies revealed by the New York Times on Monday.

The Obama administration has been drafting rules controlling the use of malware, and the rules of engagement in cyberwarfare. Some of these policies have been revealed by administration officials who spoke to Times on condition of anonymity because the rules are supposed to be highly classified.

Despite warnings by experts, including Obama's former cybersecurity czar Howard Schmidt, it appears the administration is ready to grant broad powers to the Presid…
Continue reading...

More About: cybersecurity, cyberwar, cyberweapons, malware

Watch Super Bowl MVP Joe Flacco Drop an F-Bomb on CBS
Feb 4th 2013, 19:13


This video of Ravens quarterback Joe Flacco after the Super Bowl is awesome ... F---in' awesome, to be precise.

More About: nfl, Sports, Super Bowl

Bones of King Richard III Found Beneath Parking Lot
Feb 4th 2013, 18:52


Analysis confirms a battle-bruised skeleton is the lost king.

More About: England, history, Science

John McCain Compares Ahmadinejad to a Space Monkey
Feb 4th 2013, 18:25


Sen. John McCain found himself in some hot water Monday morning after tweeting a joke implying that Iranian president Mahmoud Ahmadinejad is a space monkey.

"So Ahmadinejad wants to be first Iranian in space - wasn't he just there last week?" tweeted McCain in reference to two recent stories: Iran's claims that it shot a monkey into space
and Ahmadinejad's desire to be the first person Iran sends to space.

So Ahmadinejad wants to be first Iranian in space - wasn't he just there last week? "Iran launches monkey into space" news.yahoo.com/iran-launches-…— John McCain (@SenJohnMcCain) February 4, 2013

The joke was seen by some to be in poor taste:

@senjohnmccain is racis…
Continue reading...

More About: congress, iran, Politics, US, World

Emotional Instagram Captures Beyonce and Jay-Z's Super Bowl Moment
Feb 4th 2013, 18:10


A candid Instagram photo reportedly shot backstage at Super Bowl XLVII shows Beyonce and Jay-Z in an emotional embrace.

More About: beyonce, Music, Super Bowl

Super Bowl Generates 24.1 Million Tweets
Feb 4th 2013, 17:57


Twitter's report for Sunday's Super Bowl game is out, and it was a huge event on the social network, with users posting 24.1 million tweets about the game and the halftime show.

Twitter counts tweet volume in tweets per minute, and by that measure, Beyonce was the biggest star of the event, with the conclusion of her show generating 268,000 TPM.

The end of the game generated 183,000 TPM, and the 108-yard kickoff return TD for the Ravens by Jacoby Jones generated 185,000 TPM. Still, both moments were bested by the power outage in the second half, which generated 231,500 TPM.

As far as individual players go, the most mentioned players during the game were Ray Lewis (@Raylewis), Joe…
Continue reading...

More About: Super Bowl, Twitter

Beyonce's Super Bowl Show Lights Up Instagram, Facebook and Twitter
Feb 4th 2013, 17:43


With your eyes on multiple screens Sunday night, you saw Beyonce get viewers instantly reacting on social media to her sizzling Super Bowl halftime show. But just how furiously were viewers typing their thoughts on Instagram, Facebook and Twitter?

SEE ALSO: Watch Destiny's Child Join Beyonce in Super Bowl Show

TWITTER
The show generated 5.5 million tweets, helping bring the total for the game and halftime to 24.1 million. These moments were the most popular topics.

Conclusion of her show: 268,000 tweets per minute
Destiny's Child reunion on stage: 257,500 tweets per minute
Singing "Single Ladies": 252,500 tweets per minute

Among the tweets was one from first lady Mic…
Continue reading...

More About: beyonce, Destiny's Child, Entertainment, Music, smx social media, Super Bowl

'Tomb Raider' Reboot Explores Lara Croft's Origins and Insecurities
Feb 4th 2013, 17:38


It's harder now than ever to accept a gun-toting badass's heroic qualities at face value. In our fiction, we've come to demand more realism. Who is this character who stepped on screen to save the day? Why is he so powerful and strong, able to take every punch and keep on fighting?

The success of Christopher Nolan's Batman trilogy attests that, nowadays, we prefer flawed heroes, with an extra helping of grit.

Lara Croft's return to the game world borrows from this idea. Crystal Dynamics has spent the last four years working on Tomb Raider, and studio head Darrell Gallagher hopes Lara's "origin story" will deliver a deeper emotional experience for players.

Lara is not in her elemen…
Continue reading...

More About: features, Gaming, tomb raider, video games

Geeks Are the New Guardians of Our Civil Liberties
Feb 4th 2013, 17:30


Recent events have highlighted the fact that hackers, coders, and geeks are behind a vibrant political culture.

More About: ACTA, anonymous, civil liberties, freedom of speech, PIPA, SOPA

Shaq Lip Syncs Beyonce Better Than Beyonce
Feb 4th 2013, 17:26


In a time of darkness -- er, power outage -- Shaq provided all with a little bit of light.

During Beyoncé's Super Bowl halftime performance, most within phone-distance of the stage had their devices pointed in that direction. Not Shaq. The basketball legend filmed a video of himself lip-syncing "Halo." Perhaps Bey should take notes.

SEE ALSO:

More About: beyonce, celebrities, humor, Watercooler

Government Wants to Create Free Public 'Super Wi-Fi'
Feb 4th 2013, 16:56


Looking for public Wi-Fi in your town or city? The hunt may be about to get easier: the Federal Communications Commission is reportedly considering the development of free and public "super Wi-Fi" networks across the United States.

The proposal, first reported by The Washington Post, would require local television stations and broadcasters to sell wireless spectrum to the government. The government would then use that spectrum to build public Wi-Fi networks.

The public networks would be much stronger than average by virtue of the spectrum used to build them --their signal would hypothetically travel for long distances and penetrate thick walls and other objects.

SEE ALSO: How Does
Continue reading...

More About: fcc, spectrum, US, wifi, Wireless

5 Great Online-Only Banking Options
Feb 4th 2013, 16:52


With online banking and mobile apps for managing your accounts, how often do you actually step into your bank to handle transactions anymore? Direct deposit, remote check capture (the feature that allows you to deposit a check by taking a picture of it with your phone) and online bill pay have largely eliminated the need for you to do your banking with a live person.

Enter a new crop of accounts—and even whole banks—that are foregoing their in-person services and instead focusing on innovative online-only features. Want to make the switch to a more tech-savvy financial institution? Whether you're looking for excellent interest rates at no monthly charge, a sleek app that simplifies…
Continue reading...

More About: banks, mobile banking, money management, online banking

9 Brands That Thought Fast on Social Media During the Super Bowl
Feb 4th 2013, 16:52


Advertisers shell out big money to get it front of millions on Super Bowl Sunday, but some brands banked on social media to create buzz about their brand.

More About: Facebook, oreo, Social Media, Super Bowl ads, super bowl commercials, Twitter

Robot Takeover Starts With Little Caesars
Feb 4th 2013, 16:17


Prepare to take aim at the kill switch, silly humans, because the robot takeover has started. Bot domination is beginning in an unlikely place -- Little Caesars Pizza.

YouTube user Stealing Axion spotted the early stages of the top secret plot in action. Hide yo kids, hide yo wife -- robots will be our new overlords in 3...2...

BONUS: 20 Entertaining YouTube Videos Under 20 Seconds

Homepage image courtesy of Flickr, JD Hancock

More About: robots, viral videos, Watercooler

Why 90% of Startups Fail [INFOGRAPHIC]
Feb 4th 2013, 16:17


It seems like there's a hot new startup in the limelight more often than not, but the cold truth is 90% of tech start ups fail.

More About: Business, Startups

This Is How a Router Really Works
Feb 4th 2013, 16:07


The anatomy of a router may surprise you -- especially since it hasn't changed much in the four decades of its existence.

More About: features, Hardware, mashable, router, What's Inside

Ahmadinejad: Send Me Into Space
Feb 4th 2013, 15:56


Iranian President Madmoud Ahmadinejad announced Monday his lofty post-presidential goal: to be Iran's Neil Armstrong.

"I'm ready to be the first Iranian to sacrifice myself for our country's scientists," said Ahmadinejad as quoted by an official Iranian news agency and reported by the Associated Press.

Iran's space program has a goal of putting an Iranian in space within the next five to seven years. Iran just last Monday claimed to have shot a monkey into space and back, although the success of that mission is being called into question.

SEE ALSO: Iran Claims to Have Launched This Monkey Into Space

A hypothetical astronaut Ahmadinejad wouldn't be the first Iranian in space: entr…
Continue reading...

More About: iran, space, World

Ads Made Up 30% of Super Bowl Tweets [INFOGRAPHIC]
Feb 4th 2013, 15:47


Of the 20.9 million Super Bowl-related tweets sent during the game Sunday evening, nearly 30% were about the ads, according to digital consulting agency Whispr Group.

A good ad didn't necessarily mean more tweets. GoDaddy's ad, in which model Bar Refaeli makes out, rather grotesquely, with an overweight "nerd," netted 290,000 reactions on Twitter -- 126,000 more than the runner-up, Budweiser. However, that chatter proved mostly negative. In fact, only 14% of the tweets about GoDaddy during the game were termed "positive," whereas every other brand noted in the study had a positive rating of 60% or higher.

In most cases, the ads did not significantly impact brands' followings on Twitter…
Continue reading...

More About: Advertising, Super Bowl 2013

Twitter Mentioned in Half of Super Bowl Commercials
Feb 4th 2013, 15:47


The big winner of the Super Bowl may have been Twitter.

Not only was this the most tweeted Super Bowl ever with more than 24 million tweets about the game, but Twitter as a company was also mentioned in far more ads than any of its social media competitors.

Twitter was mentioned in about half of the 52 national commercials that aired between kickoff and the final seconds of the game, according to a tally by Matt McGee at MarketingLand. Facebook, by comparison, was mentioned in just four national ads, or about 8%.

According to McGee, Twitter and Facebook were each mentioned in eight commercials during the 2012 Super Bowl, suggesting that Twitter has rocketed past Facebook in terms…
Continue reading...

More About: Super Bowl ads, Twitter

How to Land a Job at Fab
Feb 4th 2013, 15:37


Ready to take your career to the next level? If so, you're in the right place -- our Dream Job series explores what recruiters at awesome startups are looking for in candidates. Check out previous stories to learn how to score a gig at Birchbox or Klout.

Today, we're going to talk about Fab, the ecommerce site with a special focus on design. The company famously pivoted from Fabulis, a gay social network, to a flash sales site for design-driven products. Now, the site is less focused on the steep discounts that once drew visitors but remains a design haven for its customers -- 65% are return buyers -- with tasteful product selection.

Referring to Fab's growth, co-founder Jason Go…
Continue reading...

More About: Berlin, Dream Job Series, Fab, features, NYC

Minecraft Maker Reports Stellar Earnings and Two Other Stories You Need to Know
Feb 4th 2013, 15:31


Welcome to this morning's edition of "First To Know," a series in which we keep you in the know on what's happening in the digital world.

Today, we're looking at three particularly interesting stories. Apple sort of revealed a new developer feature during one of the many entertaining Super Bowl ads. The Super Bowl did not go exactly as planned, though, as a power outage brought the game to a halt. And, if you want to hear a feel-good success story, look no further than Mojang, developers of the wildly popular Minecraft game, who earned around $101.4 million in 2012.

Check out the video above for more on these stories.

Image courtesy of iStockphoto, mattjeacock

More About: apple, features, first to know series, mashable, minecraft, Twitter

What the Super Bowl Blackout Looked Like in the Control Room
Feb 4th 2013, 15:26


A partial blackout hit the Superdome in New Orleans on Sunday night less than two minutes into the third quarter of Super Bowl XLVII. Some of the stadium's lights, television equipment and the teams' electronic gear went dark for at least some of the 34-minute blackout. Other gear survived on backup generators.

What was the blackout like from inside the NFL's control room? CBS, which carried Sunday's big game, released the above report from its chief investigative reporter Armen Keteyian, who was in the room when the blackout struck.

SEE ALSO: 15 Things That May Have Caused Super Bowl Power Outage

The blackout was a popular subject on Twitter, generating 231,500 tweets per minut…
Continue reading...

More About: football, Sports, Super Bowl

Coke's Online Super Bowl Campaign Had Mixed Results
Feb 4th 2013, 15:21


For the second year in a row, Coca Cola tried an ambitious plan to run a Super Bowl marketing campaign on TV and online during the game simultaneously, but it looks like Coke's success this year was mixed compared to 2012.

In addition to running a traditional television spot during the Super Bowl, the soda company also ran a campaign online called "Coke Chase," in which three teams -- Cowboys, Vegas Show Girls and Mad Max types -- competed against each other in a race to get a giant bottle of Coke. Viewers could go online to vote for a team or to "sabotage" a team by throwing obstacles in their way.

Since the company unveiled the campaign on Jan. 22, 1.3 million people visited the Coke
Continue reading...

More About: Coke, Super Bowl ads

Women in Science Are Outnumbered and Outearned
Feb 4th 2013, 15:21


Fewer women are entering science and technology professions, and this new infographic created for City Town Info may tell us why.

Based on data from a new Women in Global Science and Technology report, the infographic reveals that women are outnumbered and outearned in science, with men taking home an average of $1,117 to a woman's $853 per week. Additionally, there are 3,000 more males in the biological sciences realm.

The mean suggested starting salary was lower for women as well. While some might argue that women take time off work when having children, not all females decide to become mothers, and both moms and non-moms alike are at a disadvantage in this line of work.

Luckily…
Continue reading...

More About: Science, women, women in technology

Good Advertising Makes a Comeback at the Super Bowl
Feb 4th 2013, 14:50


Mashable OP-ED

For a stretch there, it looked like the Super Bowl had jumped the shark. This was during that 35-minute power outage when the world uttered a collective WTF? As commentators tried to fill dead air, the social media chatter became the focus of attention.

Oreo won the night with an apropos tweet connecting the incident to its brand:

Power out? No problem. twitter.com/Oreo/status/29…— Oreo Cookie (@Oreo) February 4, 2013

At that point -- a few minutes into the third quarter, it looked like the torch really had been passed from traditional TV to social media. As Lee Garfinkel, chairman of Havas Worldwide NY, noted during Mashable's live blog, "This could…
Continue reading...

Creating Nestable Dynamic Grids
Feb 4th 2013, 13:58

Dynamic Grids

With the rapid addition of responsive design and development to our workflows, since Ethan Marcotte’s A List Apart article in 2010, a myriad of tools have emerged to attempt to make our lives easier in developing responsive sites.

All these tools, however, can be difficult to filter through in order to find a robust solution for our projects.

In this article I will outline methods I have developed for creating flexible and fluid grids which allow for nesting at arbitrary depths, while allowing full freedom for how the grid behaves in all viewports.

This is all possible with a big help from the excellent grid generator Gridpak, put together by the folks over at Erskine.

What We’ll Be Able To Do

Once we’re done here, we’ll have a grid which can do some of the following:

and can be used to manage our layouts in the real world like so:

Click here to see a this example in a new tab.

Prerequisites

Before we begin with how to achieve such a grid, we should outline everything we expect of the grid.

These are the points that are important to me when using a functional grid system:

  • columns are accurate and predictable at all widths
  • styles and markup are simple, and easy to use
  • device agnostic, and fully fluid
  • nestable to any depth
  • modular with full control of columns in all viewports
  • should work without a polyfill in legacy browsers

With regards to the last point, many people are happy to use respond.js to provide media query support to legacy browsers.

Legacy browsers, however, don’t require support for any viewport other than desktop, since they’re only found on desktops and laptops. Below I’ll outline how to target those dinosaurs while saving us an http request!

Now that we know what we want… let’s make it!

Setup

HTML Tag And IE Fallbacks

To begin with, we need to ensure we can easily target legacy browsers with our styles. The following method is inspired by html5 boilerplate, and is explained by Paul Irish in his post on Conditional stylesheets vs css hacks? Answer: Neither!

<!doctype html>  <!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->  <!--[if IE 9]>    <html class="no-js ie9 oldie" lang="en"> <![endif]-->  <!--[if gt IE 9]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

All this does is add a class to the html tag depending on which browser a visitor is coming to our site with. I’ll only be supporting from Internet Explorer 8 for the purpose of this article.

From there it’s easy enough to target legacy versions of Internet Explorer with the following:

/* target only IE8 with the following class */  .ie8 .my-class { ... }

Base Styles And Rems

rems, or root em‘s, are an awesome unit to start making use of in your styles, especially when it comes to font sizing. rems are great because they are relative units, but are relative to only one declaration. This means all the calculation nightmares introduced by nesting ems completely disappear!

rems make this possible by basing all calculations relative to the size of the font declared at the body level.

This can be illustrated as follows:

html {    ...    font-size: 100%;    ...  }    body {    ...    /* base font size: 16px (user agent dependant, but usually 16px) */    font-size: 1em;    ...  }    ...    .padding {    /* IE8 fallback */    padding: 32px;    padding: 2rem; /* 2 * 16px = 32px */  }

IE8 does not support rems, so a px fallback is a small price to pay for the benefit that they provide.

I’ll show you a little later how this magical unit will make our lives a little easier when it comes to creating our grid.

Now that that’s out of the way, let’s get to the bones of our grid!

Getting Gridpak

Go to gridpak.com, and play around with the options so that you are comfortable with the features.

For the purpose of this article, I’m going to download a grid with the following settings, but feel free to experiment:

  • viewports: 480px, 640px, 960px and up
  • 12 columns in each viewport (yup, 12 in mobile, tablet, and desktop!)
  • 0 padding
  • 24px gutter. Gridpak allows for viewport specific gutters, but I’m going to keep things simple with a global gutter.

Try keep your padding and gutter values as whole numbers resulting from simple multiplications of the body font size. This will help reduce decimal values, which browsers handle differently, as well as keep your styles a little neater.

i.e. if base font size is 16px, gutter can be

  • 8px (16 * .5)
  • 12px (16 * .75)
  • 24px (16 * 1.5)
  • 32px (16 * 2)

NB: This should ultimately be decided on what best suits your design.

Once you are happy with your settings, download your grid!

Breaking Gridpak Down

One of the best features of Gridpak is that you’ll have an incredibly robust and accurate grid with just a few lines of CSS.

Gridpak’s strength comes from leveraging the awesome power of setting all your elements to box-sizing: border-box. With border-box we can have two 50% columns always sit on the same line, accomodating whatever borders we apply to them.

With some clever CSS we can use transparent borders for gutters, giving us wonderfully accurate and managable columns:

.row {    /*     * Rows contain columns     *     * Pull only the left hand side of our rows 24px left (our gutter width)     * to allow for the border magic that happens in .col below     */    margin-left: -24px;  }    .col {    /*     * Create a gutter using a transparent border at the specified gutter width.     * This pushes our content back the distance the row pulled us left, while     * allowing border-box calculations to be used.     */    border: 0px solid rgba(0,0,0,0);    border-left-width: 24px;      float: left;      /*     * Include the border in the calculation of the column width     */    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    box-sizing: border-box;      /*     * Ensure that backgrounds set on columns begin just inside the border, not underneath     */    -webkit-background-clip: padding-box !important;    -moz-background-clip: padding-box !important;    background-clip: padding-box !important;  }

On top of this, Gridpak puts grids for each viewport in their own media queries, and then restricts grid styles to each media query with upper bounds:

/*   * Declare a grid between 0 and 479px only   */  @media screen and (min-width: 0px) and (max-width: 479px) {      ...      .span_1 { width:8.33333333333%;}    .span_2 { width:16.6666666667%;}    .span_3 { width:25.0%;}    .span_4 { width:33.3333333333%;}    .span_5 { width:41.6666666667%;}    .span_6 { width:50.0%;}    .span_7 { width:58.3333333333%;}    .span_8 { width:66.6666666667%;}    .span_9 { width:75.0%;}    .span_10 { width:83.3333333333%;}    .span_11 { width:91.6666666667%;}    .span_12 {      margin-left:0;      width:100%;    }    }    /*   * Declare a grid between 480px and 639px only   */  @media screen and (min-width: 480px) and (max-width: 639px) {    ...  }    /* etc. */  ...

If we had to specify different numbers of columns for viewports when deciding on our Gridpak settings – say 2 columns for mobile, 4 columns for tablet, and 12 for desktop – these media query specific declarations would grant us more flexibility over our columns than the general, “Let’s give mobile and tablet 1 column for everything” solutions most prevalent in grid systems.

i.e. one class can make a column occupy the full width of a row, half the width, and 1/6th of the width depending on the active viewport.

This is pretty powerful stuff – but we’re still being held back a little! I want those columns to do exactly what I want in every viewport!

Bending Gridpak To Our Will

Using rems For Easier Maintainability

First of all, let’s take the foundation of Gridpak and give it a nice modern boost (with a fallback for the old browsers):

.row {    margin-left: -24px;    margin-left: -1.5rem;  }    /* Reusable column setup */  .col {    border: 0px solid transparent;    border-left-width: 24px;    border-left-width: 1.5rem;    float: left;    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    box-sizing: border-box;    -webkit-background-clip: padding-box !important;    -moz-background-clip: padding-box !important;    background-clip: padding-box !important;  }

In future, when we don’t support IE8, we can simply drop the px fallbacks.

rems are free variables, and by making use of Sass, we can easily manage the IE8 px declarations with their own variable for easier maintainability.

Zooming And Cascading Grids With Media Query Blocks

Secondly, we want to make sure that when users zoom into our sites that the layouts don’t break. Lyza Gardner put together a case study for using proportional units on media query declarations.

Basically, pixel-based media query declarations don’t play well with zooming, so we use ems instead.

Additionally, media queries use the user agent’s base font size when declaring viewport widths. This means that, generally, we will be using 16px as a basis for our width calculations.

While we’re at it… let’s get rid of those max-width media query restrictions so we can harness some cascade power:

/*   * Declare a grid which will be effective from 0px   */  @media screen and (min-width: 0) {    ...  }    /*   * Declare a grid which will be effective from 480px   * 480 / 16 = 30em   */  @media screen and (min-width: 30em) {    ...  }    /*   * Declare a grid which will be effective from 640px   * 640 / 16 = 40em   */  @media screen and (min-width: 40em) {    ...  }    ...

In addition to fixing zooming, this setup allows column widths declared at larger viewports to override those of smaller viewports in true mobile-first fashion.

Namespacing Viewport Specific Columns

In order to effectively control our columns at all viewports, we need to give them unique names so that the style overrides only occur when we explicitly make it do so.

Using our conditionals, even IE8 gets its own grid declarations!

I’m going to append a name to the end of each span to assign it to the viewport from which it is effective:

/*   * IE8 grid   * This grid will only work in IE8, and at all widths   */  .ie8 .span_1_vpalpha { ... }  .ie8 .span_2_vpalpha { ... }  ...  .ie8 .span_1_vpalpha { ... }    /*   * VIEWPORT ALPHA   * Declare a grid which will be effective from 0px   */  @media screen and (min-width: 0) {      ...      .span_1_vpalpha { ... }    .span_2_vpalpha { ... }    ...    .span_1_vpalpha { ...  }    }    /*   * VIEWPORT BETA   * Declare a grid which will be effective from 480px   * 480 / 16 = 30em   */  @media screen and (min-width: 20em) {      ...      .span_1_vpbeta { ... }    .span_2_vpbeta { ... }    ...    .span_1_vpbeta { ... }    }    /*   * VIEWPORT GAMMA   * Declare a grid which will be effective from 640px   * 640 / 16 = 40em   */  ...

And that’s that, we’re ready to put our grid into action!

Usage

Using Gridpak is easy. Groups of columns must have a parent that is a clearfixed row… and that’s all you need to know!

<!--    create a row with 2 columns and the following features:      mobile  -> 3 spans + 9 spans    tablet  -> 6 spans + 6 spans    desktop -> 4 spans + 8 spans    IE8     -> 4 spans + 8 spans  -->  <div class="row cf">    <div class="col span-3-vpalpha span-6-vpbeta span-4-vpgamma span-4-ie8">      content...    </div>    <div class="col span-9-vpalpha span-6-vpbeta span-8-vpgamma span-8-ie8">      content...    </div>  </div>

Nesting columns follows the same pattern:

<!--    create a row with 2 columns spanning half the width for all viewports.      Have both columns then contain 2 columns each, both spanning half the width     of the parent column.  -->  <div class="row cf">    <div class="col span-6-vpalpha span-6-ie8">      <div class="row cf">        <div class="col span-6-vpalpha span-6-ie8">          content...        </div>        <div class="col span-6-vpalpha span-6-ie8">          content...        </div>      </div>    </div>      <div class="col span-6-vpalpha span-6-ie8">      <div class="row cf">        <div class="col span-6-vpalpha span-6-ie8">          content...        </div>        <div class="col span-6-vpalpha span-6-ie8">          content...        </div>      </div>    </div>  </div>

“Whoa! That’s a lotta classes!” you may be saying… but guess what… you’re not going to find (m?)any grids with this flexibility by using a couple classes and descendant selectors.

If your ‘classitis’ sense is still tingling… there are a number of excellent articles out there which debunk the generally poor arguments portraying the use of classes as ‘bad’:

Conclusion

Phew, it’s been quite a journey to get here, and there are quite a few methods and ideas to wrap our heads around!

All in all we’ve put together a concise grid that can be scaled to as many, or as few, viewports as we like. More than that, it’s easy to use, doesn’t require very much markup, and gives us the flexibility to nest grids within grids as far as we like!

With the new flexbox syntax finally reaching candidate recommendation, we can start looking to experiment with the future of grid layouts.

Unfortunately, until IE9 (and even IE10 with its partial support of the syntax) is out of our hair, we may not be able to fully rely on flexbox for our grids.

Until then, I’m happy to have come across a solution which I have found to give me all the flexibility in a grid layout I could ask for.

Give me a shout in the comments if you have any questions or if you’ve come across useful tools for creating powerful grid systems.

Free WordPress Health Theme. Make Health an Online Trend
Feb 4th 2013, 07:56

Need a medical blog? Try ready-made well-crafted Free WordPress Health Theme.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions