Smashing Magazine2009-11-21T23:15:46ZWordPresshttp://www.smashingmagazine.com/feed/atom/Sergey Chikuyonokhttp://chikuyonok.ruZen Coding: A Speedy Way To Write HTML/CSS Codehttp://www.smashingmagazine.com/?p=160722009-11-21T22:59:35Z2009-11-21T18:58:00Z  In this post we present a new speedy way of writing HTML code using CSS-like selector syntax — a handy set of tools for high-speed HTML and CSS coding. It was developed by our author Sergey Chikuyonok and released for Smashing Magazine and its readers. How much time do you spend writing HTML code: all of those tags, attributes, quotes, braces, etc. You have it easier if your editor of choice has code-completion capabilities, but you still do a lot of typing. 
We had the same problem in JavaScript world when we wanted to access a specific element on a Web page. We had to write a lot of code, which became really hard to support and reuse. And then JavaScript frameworks came along, which introduced CSS selector engines. Now, you can use simple CSS expressions to access DOM elements, which is pretty cool. 
In this post we present a new speedy way of writing HTML code using CSS-like selector syntax — a handy set of tools for high-speed HTML and CSS coding. It was developed by our author Sergey Chikuyonok and released for Smashing Magazine and its readers. How much time do you spend writing HTML code: all of those tags, attributes, quotes, braces, etc. You have it easier if your editor of choice has code-completion capabilities, but you still do a lot of typing. We had the same problem in JavaScript world when we wanted to access a specific element on a Web page. We had to write a lot of code, which became really hard to support and reuse. And then JavaScript frameworks came along, which introduced CSS selector engines. Now, you can use simple CSS expressions to access DOM elements, which is pretty cool. But what if you could use CSS selectors not just to style and access elements, but to generate code? For example, what if you could write this… div#content>h1+p …and see this as the output?
<div id="content">
<h1></h1>
<p></p>
</div>
Today, we’ll introduce you to Zen Coding, a set of tools for high-speed HTML and CSS coding. Originally proposed by Vadim Makeev (article in Russian) back in April 2009, it has been developed by yours truly (i.e. me) for the last few months and has finally reached a mature state. Zen Coding consists of two core components: an abbreviation expander (abbreviations are CSS-like selectors) and context-independent HTML-pair tag matcher. Watch this demo video to see what they can do for you. If you’d like to skip the detailed instructions and usage guide, please take a look at the demo and download your plugin right away: Demo- Demo (use Ctrl + , to expand an abbreviation, requires JavaScript)
Downloads (Full Support)Downloads (Partial Support, “Expand Abbreviation” Only)Now, let’s see how these tools work. Expand AbbreviationThe Expand Abbreviation function transforms CSS-like selectors into XHTML code. The term “abbreviation” might be a little confusing. Why not just call it a “CSS selector”? Well, the first reason is semantic: “selector” means to select something, but here we’re actually generating something, writing a shorter representation of longer code. Secondly, it supports only a small subset of real CSS selector syntax, in addition to introducing some new operators. Here is a list of supported properties and operators: - E
Element name (div, p); - E#id
Element with identifier (div#content, p#intro, span#error); - E.class
Element with classes (div.header, p.error.critial). You can combine classes and IDs, too: div#content.column.width; - E>N
Child element (div>p, div#footer>p>span); - E+N
Sibling element (h1+p, div#header+div#content+div#footer); - E*N
Element multiplication (ul#nav>li*5>a); - E$*N
Item numbering (ul#nav>li.item-$*5);
As you can see, you already know how to use Zen Coding: just write a simple CSS-like selector (oh, “abbreviation”—sorry), like so… div#header>img.logo+ul#nav>li*4>a …and then call the Expand Abbreviation action. There are two custom operators: element multiplication and item numbering. If you want to generate, for example, five <li> elements, you would simply write li*5. It would repeat all descendant elements as well. If you wanted four <li> elements, with an <a> in each, you would simply write li*4>a, which would generate the following output:
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
The last one–item numbering is used when you want to mark a repeated element with its index. Suppose you want to generate three <div> elements with item1, item2 and item3 classes. You would write this abbreviation, div.item$*3:
<div class="item1"></div>
<div class="item2"></div>
<div class="item3"></div>
Just add a dollar sign wherever in the class or ID property that you want the index to appear, and as many an you want. So, this… div#i$-test.class$$$*5 would be transformed into:
<div id="i1-test" class="class111"></div>
<div id="i2-test" class="class222"></div>
<div id="i3-test" class="class333"></div>
<div id="i4-test" class="class444"></div>
<div id="i5-test" class="class555"></div>
You’ll see that when you write the a abbreviation, the output is <a href=""></a>. Or, if you write img, the output is <img src="" alt="" />. How does Zen Coding know when it should add default attributes to the generated tag or skip the closing tag? A special file, called zen_settings.js describes the outputted elements. It’s a simple JSON file that describes the abbreviations for each language (yes, you can define abbreviations for different syntaxes, such as HTML, XSL, CSS, etc.). The common language abbreviations definition looks like this:
'html': {
'snippets': {
'cc:ie6': '<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->',
...
},
'abbreviations': {
'a': '<a href=""></a>',
'img': '<img src="" alt="" />',
...
}
}
Element TypesZen Coding has two major element types: “snippets” and “abbreviations.” Snippets are arbitrary code fragments, while abbreviations are tag definitions. With snippets, you can write anything you want, and it will be outputted as is; but you have to manually format it (using \n and \t for new lines and indentation) and put the ${child} variable where you want to output the child elements, like so: cc:ie6>style. If you don’t include the ${child} variable, the child elements are outputted after the snippet. With abbreviations, you have to write tag definitions, and the syntax is very important. Normally, you have to write a simple tag with all default attributes in it, like so: <a href=""></a>. When Zen Coding is loaded, it parses a tag definition into a special object that describes the tag’s name, attributes (including their order) and whether the tag is empty. So, if you wrote <img src="" alt="" />, you would be telling Zen Coding that this tag must be empty, and the “Expand Abbreviation” action would apply special rules to it before outputting. For both snippets and abbreviations, you can ad a pipe character (|), which tells Zen Coding where it should place the cursor when the abbreviation is expanded. By default, Zen Coding puts the cursor between quotes in empty attributes and between the opening and closing tag. ExampleSo, here’s what happens when you write an abbreviation and call the “Expand Abbreviation” action. First, it splits a whole abbreviation into separate elements: so, div>a would be split into div and a elements, with their relationship preserved. Then, for each element, the parser looks for a definition inside the snippets and then inside the abbreviations. If it doesn’t find one, it uses the element’s name as the name for the new tag, applying ID and class attributes to it. For example, if you write mytag#example, and the parser cannot find the mytag definition among the snippets or abbreviation, it will output <mytag id="example"><mytag>. We have made a lot of default CSS and HTML abbreviations and snippets. You may find that learning them increases your productivity with Zen Coding. HTML Pair MatcherAnother very common task for the HTML coder is to find the tag pair of an element (also known as “balancing”). Let’s say you want to select the entire <div id="content"> tag and move it elsewhere or just delete it. Or perhaps you’re looking at a closing tag and want to known which opening tag it belongs to. Unfortunately, many modern development tools lack support for this feature. So, I decided to write my own tag matcher as part of Zen Coding. It is still in beta and has some issues, but it works quite well and is fast. Instead of scanning the full document (as regular HTML pair matchers do), it finds the relevant tag from the cursor’s current position. This makes it very fast and context-independent: it works even with this JavaScript code snippet:
var table = '<table>';
for (var i = 0; i < 3; i++) {
table += '<tr>';
for (var j = 0; j < 5; j++) {
table += '<td>' + j + '</td>';
}
table += '</tr>';
}
table += '</table>';
Wrapping With AbbreviationThis is a really cool feature that combines the power of the abbreviation expander with the pair tag matcher. How many times have you found that you have to add a wrapping element to fix a browser bug? Or perhaps you have had to add decoration, such as a background image or border, to a block’s content? You have to write the opening tag, temporarily break your code, find the appropriate spot and then close the tag. Here’s where “Wrap with Abbreviation” helps. This function is pretty simple: it asks you to enter the abbreviation, then it performs the regular “Expand Abbreviation” action and puts your desired text inside the last element of your abbreviation. If you haven’t selected any text, it fires up the pair matcher and use the result. It also makes sense of where your cursor is: inside the tag’s content or within the opening and closing tag. Depending on where it is, it wraps the tag’s content or the tag itself. Abbreviation wrapping introduces a special abbreviation syntax for wrapping individual lines. Simply skip the number after the multiplication operator, like so: ul#nav>li*>a. When Zen Coding finds an element with an undefined multiplication number, it uses it as a repeating element: it is outputted as many times as there are lines in your selection, putting the content of each line inside the deepest child of the repeating element. If you’ll wrap this abbreviation div#header>ul#navigation>li.item$*>a>span around this text… About Us
Products
News
Blog
Contact Up You’ll get the following result:
<div id="header">
<ul id="navigation">
<li class="item1"><a href=""><span>About Us</span></a></li>
<li class="item2"><a href=""><span>Products</span></a></li>
<li class="item3"><a href=""><span>News</span></a></li>
<li class="item4"><a href=""><span>Blog</span></a></li>
<li class="item5"><a href=""><span>Contact Up</span></a></li>
</ul>
</div>
You can see that Zen Coding is quite a powerful text-processing tool. Key BindingsCtrl+, Expand AbbreviationCtrl+M Match PairCtrl+H Wrap with AbbreviationShift+Ctrl+M Merge LinesCtrl+Shift+? Previous Edit PointCtrl+Shift+? Next Edit PointCtrl+Shift+? Go to Matching Pair
Online DemoYou’ve learned a lot about how Zen Coding works and how it can make your coding easier. Why not try it yourself now, right here? Because Zen Coding is written in pure JavaScript and ported to Python, it can even work inside the browser, which makes it a prime candidate for including in a CMS. - Demo (use Ctrl + , to expand an abbreviation, requires JavaScript)
Supported EditorsZen Coding doesn’t depend on any particular editor. It’s a stand-alone component that works with text only: it takes text, does something to it and then returns new text (or indexes, for tag matching). Zen Coding is written in JavaScript and Python, so it can run on virtually any platform out of the box. On Windows, you can run the JavaScript version of Windows Scripting Host. And modern Macs and Linux distributions are bundled with Python. To make your editor support Zen Coding, you need to write a special plug-in that can transfer data between your editor and Zen Coding. The problem is that an editor may not have full Zen Coding support because of its plug-in system. For example, TextMate easily supports the “Expand Abbreviation” action by replacing the current line with the script output, but it can’t handle pair-tag matching because there’s no standard way to ask TextMate to select something. Full SupportPartial Support (”Expand Abbreviation” Only)Aptana is my primary development environment, and it uses a JavaScript version of Zen Coding. It also contains many more tools that I use for routine work. Every new version of Zen Coding will be available for Aptana first, then ported to Python and made available to other editors. The Coda and Espresso plug-ins are powered by the excellent Text Editor Actions (TEA) platform, developed by Ian Beck. The original source code is available at GitHub, but I made my own fork to integrate Zen Coding’s features. ConclusionMany people who have tried Zen Coding have said that it has changed their way of creating Web pages. There’s still a lot of work to do, many editors to support and much documentation to write. Feel free to browse the existing documentation and source code to find answers to your questions. Hope you enjoy Zen Coding! (al)
© Sergey Chikuyonok for Smashing Magazine, 2009. | Permalink | 59 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine Post tags: CSS, Freebies, tools, Workflow 59Callum Chapmanhttp://www.circleboxblog.com/The Big Showcase Of Online T-Shirt Storeshttp://www.smashingmagazine.com/?p=148402009-11-20T15:14:41Z2009-11-20T13:22:24Z  T-shirts, as you'll surely agree, play a big part in the design world. Sometimes, we designers don't get the kinds of projects we want, and so we are left to apply our creativity in some other way, many of us opting to submit graphics in t-shirt competitions or printing them ourselves and selling them through shopping cart systems such as BigCartel. 
In this post, we bring you a showcase of online t-shirt store Web designs, all of which serves as a great source of inspiration for Web designers, graphic designers and even illustrators. You may be interested in the following related articles: 
T-shirts, as you’ll surely agree, play a big part in the design world. Sometimes, we designers don’t get the kinds of projects we want, and so we are left to apply our creativity in some other way, many of us opting to submit graphics in t-shirt competitions or printing them ourselves and selling them through shopping cart systems such as BigCartel. In this post, we bring you a showcase of online t-shirt store Web designs, all of which serves as a great source of inspiration for Web designers, graphic designers and even illustrators. You may be interested in the following related articles: T-Shirt Store Web DesignShirt Fight t-shirts This t-shirt store combines various retro and vintage elements in quite a creative way, resulting in a vibrant and memorable design. 
The Hipstery! Mystery T-Shirts Another t-shirt store that uses retro elements to appeal to customers. Notice how well the design of the website reflects the themes found in the “Mystery T-Shirt.” 
Design by Humans The simplistic design and generous white space allow the products to breath. A stylish and rather large slideshow on the home page advertises the latest products. 
Dripping in Fat Dripping in Fat is a store dedicated to creating t-shirts with a distinct message, all designed by some of the best designers around the globe! The modern, colorful design evokes a clothesline, with some awesome Flash animations. 
Glennz Store Glennz Tees began after the owner, Glenn Jones, became successful at Threadless.com, with over 21 shirts in print. He teamed up with some friends to produce a collection of tees for like-minded people. The sensible, clean design draws all of the user’s attention to the t-shirts themselves. 
Take a TeeTake a Tee is a small company dedicated to providing high-quality designs printed on great t-shirts. It is also always on the look-out for new designers to join its expanding team. The horizontal lines and drop-shadows on this simple yet stylish website make for awesome effects. 
Itself Itself offers limited-edition clothing. The store allows designers and illustrators to submit their own work and join its creative community. The elegant, stylish website has a great color scheme and makes good use of social networking websites such as Twitter and Facebook. 
Supermotif Supermotif is yet another place to buy great t-shirts and submit your own designs. The website uses the dark photo in the background to its advantage, presenting the professionally photographed products against a white background. 
The Affair The Affair sells a collection of beautiful designs printed on high-quality shirts. The Flash animation makes this website designs fun: you could spend hours making the models spin around and show off their t-shirts! 
Storenvy This site is a social store community which features T-Shirts and T-Shirts-sellers worldwide. A vibrant, yet very clean design. 
Labrador Labrador is a small independent label offering t-shirts with great animal-inspired designs. The website is incredibly simple, with loads of white space. It uses awesome Flash effects to produce a scrolling washing line, as well as a Labrador logo with wagging tail! 
Shirt City Shirt City is a custom t-shirt store. You can upload and print your own designs or purchase existing designs. 
Type Tees Type Tees is part of Threadless but dedicated only to typography-based t-shirts. It obviously makes great use of typography to promote and sell its products. 
Ugmonk As the market continues to become saturated with overly complex, cluttered designs, Ugmonk’s mission is to provide high-quality products with simple, fresh graphics. The incredibly stylish dark design, bright color and colorful macro photography make this website a memorable one. 
Limitees Limitees has a huge selection of tees, hoodies, jackets, sneakers and accessories, all with fresh designs. The wooden typography-based design works wonders for the incredible products. 
To Write Love on Her Arms To Write Love on Her Arms sell some great typography-based t-shirts and a lot of other great apparel. The modern, sleek dark design is up there with the best of them. It also uses social networking websites such as Twitter, Flickr and YouTube to its advantage. 
Cloth Moth Cloth Moth was founded by Joshua Merritt, his wife and a long-time friend. Together, they produce quality apparel products and sell them to the world. Their simple yet modern Web design uses dashed lines for stitches, a great complement to the other hand-drawn elements. 
StatAttak StatAttak is a small in-house company that produces some awesome hand-printed designs. It has a one-page portfolio, with some great JavaScript tricks. Excellent! 
Shicon Shicon is a great place to look when you’re restocking your wardrobe, because it always has a nice selection of tees. It is always on the look-out for new designers, so send in your designs! Its website has attractive typography-based headings, diagonal pinstripes, bold colors and great photography techniques. 
Agnés B Agnés B is a French clothing store that sells t-shirts by artists and by itself. The limited colors, with bursts of red and colorful backgrounds, make the main content on this website stand out. 
Johnny Cupcakes This store has a classic blog style, with an unusual navigation menu and vintage design elements. The website has all kinds of knobs and buttons and loads of seamless patterns, textures and illustrations. 
teextile Another vibrant t-short store that boldly presents selected shirts near the top. The store allows the community to vote and comment on t-shirt designs as well. Every day, one design is promoted to the home page. 
Burn Suburbia Burn Suburbia is a clever store: each t-shirt reflects the designer’s home city. Designers hail from London, Newcastle, Brooklyn, Tokyo, Phoenix, Toronto and other cities, and the product selection is increasing. The city photograph in the background works well with the general concept. 
Custom T-Shirts Custom T-Shirts is based in the EU. Its sell a selection of limited-edition t-shirts to suit different moods, and you can customize the products. The design itself is superb and appropriate: it looks like a t-shirt; the logo being the t-shirt label and the navigation menu items being the pins and badges. Great idea! 
Streetshirts A vibrant, trendy design that appeals to the store’s target audience: youth. Flash is used heavily and makes it possible for customers to customize their t-shirt design. 
A Better Tomorrow A Better Tomorrow (or ABT) sells t-shirts made with love. It also runs an ongoing design contest. The website design makes use of patterns, which add visual interest to the header and sidebars. 
Ampersand Shoppe Ampersand is a t-shirt store dedicated to t-shirts that feature, as you might have guessed, the ampersand (&). The one-page store has a very simple design, and the white space makes it incredibly simple to use. 
Busted Tees Busted Tees is run by the same guys behind CollegeHumor. They’re always on the lookout for new artists, so drop them a line! They make use of textures and patterns to make the various sections of the website stand out. 
CafePress CafePress is a great place if you’re on the lookout for a new t-shirt. You can also sign up and create your own t-shirt store! Its modern and clean Web design makes great use of drop-down menus, and a JavaScript slideshow on the home page advertises its newest products. 
Yack Fou Yack Fou focuses on selling t-shirts, although it does sell other products, such as hoodies, buttons, stickers and posters. The awesome design makes great use of the striped, seamless pattern and the illustrated dream cloud at the bottom of the page. 
Yellow Bird Project The Yellow Bird Project is a non-profit organization that sells fabulous t-shirts to raise money for charities. The design has hand-drawn elements, with plenty of color for a great personal touch. 
Zazzle Zazzle is yet another popular t-shirt website that allows you to purchase t-shirts and sell your own designs. It also deals in other products, such as cards, mugs, skateboards and shoes. The design is slightly cluttered but gets the point across quickly, with links to many products from the home page. 
Chop Shop Store Chop Shop is a one-stop shop for like-minded individuals. It offers great clothing to satisfy the nerdy cravings in us all, without our having to ask for it. It also sells original artwork. The textured wooden backgrounds (you can choose from four types of wood) designs make this design live up to its name, and they look great. 
Cosmic Soda Cosmic Soda is a great place to buy some pretty cool t-shirts and to submit your own tee graphics for a chance to earn a percentage of sales. The simple abstract design, with a lot of hand-drawn elements and a lined paper background, makes this website a beauty. 
DesignGive DesignGive is a website for designers, by designers. It gives artists the opportunity to create and sell apparel on the website, and a portion of the proceeds go to charity. 
Riot Creations Riot Creations is a hub for designers and t-shirt aficionados from all around the world to buy great t-shirts and submit their own designs! The great design, with its graffiti-style typography, makes the website super-easy to use. The colorful photographs and illustrations make this design designs pop. 
University of Whatever Clothing University of Whatever sell tons of great apparel at great prices. It uses grungy and noisy textures and vintage photo frames to draw attention to certain parts of the website. 
deviantWEAR The store for deviantART is a great place to find anything labelled “art.” It sells a great collection of t-shirts, hoodies, bags and collectibles. The design of this sleek and easy-to-use store is based on that of the main deviantART website. 
Dropdead Clothing Dropdead Clothing is aimed at fans of metal music and sells a range of incredible illustrated t-shirts. After clicking through the Flash-animated splash page, we find a simple yet easy-to-use store. A slideshow on the home page advertises the latest products, with some pretty awesome photography, too! 
Emptees Emptees is a place where the world’s best designers and tee enthusiasts can come together on common ground to show off, talk about and love tees. Another simplistic theme, with a large area on the front page dedicated to the “tee of the day,” followed by a selection of colorful thumbnails of other products. 
Go Ape Shirts Go Ape Shirts is a store that has simply a huge collection of awesome t-shirts. The simple design, custom clothesline navigation menu and seamless striped pattern for the background make the content pop! 
Happy Webbies Happy Webbies is a huge collection of t-shirts for “Web nerds.” All of the designs are available for downloading as desktop wallpaper. With an incredibly simple yet modern design, the whole store is made up of a grid of colorful illustrated thumbnails. 
i/denti/tee i/denti/tee has a huge collection of music-inspired t-shirts, all produced by Edun Live. The design is a sleek black and white, with bursts of color from various buttons and clothing shots. 
La Fraise La Fraise is a French company that sells a collection of limited edition t-shirts, all of which were submitted by designers. The colorful illustrated header pulls the otherwise simple website together, making it one of the sexiest in this showcase. 
Look Zippy Look Zippy is a worldwide store offering organic and environmentally friendly shirts at low prices. You can submit your designs for a chance at a cash prize. The striped patterns make areas like the navigation menu stand out. 
Mr Poulet Mr Poulet sell some of the nicest t-shirts in the world, all of which are fair trade. It also has an ongoing design contest. This fun and colorful website presents its products in an old golden frame, making them stand out from the less-important content. 
Nerdy Shirts NerdyShirts believes that printed tees are one of the best ways to express yourself. It has almost 100 designs to choose from. The website design makes the content stand out with an illustrated cloud background, and it reserves a small area at the top of the page to advertise its latest products. 
Oddica Oddica’s focal point is its artists and how they interpret ideas and how that looks on t-shirts. It has a huge collection of awesome tees, starting at just $10. The design is minimal, helping the user concentrate on what’s most important: the products! 
Rumplo Rumplo’s mission is to make it easy for anyone to find their new favorite t-shirts and to give designers great tools to promote and share their killer work. The simple HTML-based design gets straight to the point! 
Scrap Graphic Scrap Graphic is a Japanese-based t-shirt store that sells tons of awesome abstract designs and the odd poster print, too. The minimalist website design makes great use of the simple repeated image in the background, giving the website a unique look. 
Select Select is a distinct line of Threadless that sell t-shirts by emerging artists alongside well-known artists. It releases a new t-shirt every Monday. The minimalist design is almost all black and white, except for the t-shirt graphics themselves, making you give all your attention to the great t-shirts. 
Shirt Pizza Shirt Pizza was created by Paul Ocepek after a pepperoni-induced dream. It sells a huge selection of t-shirts with different toppings. Shirt Pizzas header is the hit of this design: a traditional over-head price board, the likes of which we’ve all seen at our local take-out joint. 
Skreened Skreened use a new CMYK printing process to produce cost-effective t-shirts, even single orders. Browse the gallery to purchase existing designs or upload your own! The patterns and shadows bring this simple website design to life. 
Spreadshirt Spreadshirt is a platform for personalized apparel. Buy existing designs or create a store to sell your own. Spreadshirts uses a slideshow on the home page to advertise new products and makes great use of dashed rules, which tie in with its logo and different areas of the website. 
TeeTonic TeeTonics aim is to offer the best designed and highest-quality tees, all of which have been created by fellow designers and rated by users. TeeTonic uses Flash animation, bright colors and thumbnail arrangements to make its website stand out from the rest. 
Threadless Threadless is one of the ultimate t-shirt stores. It releases new t-shirts every Monday and has an ongoing competition for us designers, so start submitting! The layout is almost entirely made up of thumbnail images of its latest products, with a small area at the top of the page set aside to advertise its latest offers. 
Tokotoukan Tokotoukan is an online store based in Greece, with a selection of t-shirts made from 100% original patterns. Its designs have a lot of textures and custom shapes, making for a truly unique and attractive look. 
Tshirt Axid Axid produces unique and cool t-shirts that are available exclusively online, although it is looking for other venues in which to sell its products. The repeated background image makes for a very interesting design and helps the user focus on the center of the page, where the t-shirts are! 
Tshirt Store Tshirt Store sells designs on 100% certified ecological cotton. It designs for itself and in cooperation with other talented designers and is always looking for new designers to join the team. The website has a simple design that puts the focus on the t-shirts. It also has a very cool feature that allows you to search for t-shirts by clicking on a color. 
Turn Nocturnal Turn Nocturnal is a clothing company run by two guys named Matt and Jack, who love to design and sell shirts. Their simple design makes great use of white space and drop-shadows, making the content stand out from the less-important stuff. 
6 Dollar Shirts 6 Dollar Shirts sells great t-shirts for $6 each… and 10 for $50! It has some designs inspired by art, TV, vintage design, military, sports, animals and more. The website makes great use of textures, strokes and dirty Photoshop brushes. 
Color Overload Color Overload is a great little store that sells a small selection of animal-inspired t-shirt designs. The store is powered by BigCartel, and its black-and-grey theme comes to life with the bursts of bright color. 
Von RoxyVon Roxy produces t-shirts aimed squarely at the creative design community: a lot of its designs feature the typefaces we all love. The website is a simple HTML layout, with a textured banner header that immediately focuses your attention on the products. 
Beautiful/Decay Beautiful/Decay has a great collection of t-shirts, hoodies, buttons, jewelry, wallets, stickers, prints and magazines: you have to check it out! The simple, easy-to-use website is hosted on indiemerchstore.com. 
Graniph Tshirts Store A nice little t-shirt store that is always on the look-out for open-minded people with great ideas, whether illustrators, designers, artists or photographers. The website is easy to use, has a Flash slideshow on the home page and lets you search by clicking on color squares. 
RIPT Apparel RIPT Apparel is a new online t-shirt retailer based in Chicago that specializes in one-of-a-kind designs. T-shirts are available for 24 hours, after which the design is not sold again. The website has a lovely modern design that makes great use of jQuery lightbox plug-ins and grungy textures. 
Tee Fury Tee Fury has been releasing limited-edition t-shirts since 2008. It releases a new tee everyday, but every tee is available only for 24 hours, so it is indeed limited. The simple black-and-white design has a real hand-drawn feel to it, due in large part to the cool little creatures at the bottom of the page! 
Full Bleed Full Bleed is a great little store with plenty of t-shirts to choose from. It restocks most of its tees regularly, so no limited editions here! It also has a simple website: grayscale, other than the t-shirts themselves. A great way to make those shirts pop! 
Lowdtown Lowdtown is a store based on a fictional town. It offers limited-edition streetwear tees that anyone with an eye for design would enjoy. Lowdtown’s website is all about the content: the great shirt designs are set off by a black-and-white layout and sandwiched between a simple but stylish header and footer. 
Supermaggie Supermaggie is a lovely, personal t-shirt store started by two partners who met in college. It also sells incredible scarves, so check it out! The website is plain HTML but works incredibly well for the business. 
Subliminal Clothing Subliminal Clothing is a small company that offers very few t-shirts at any one time. However, the t-shirts it does sell are incredible and very well designed. The website is powered by the popular BigCartel. Simple typography and a great color scheme make this website beautiful. 
200 Nipples 200 Nipples is a great little shop that sells one design at a time, and 100 in all (just enough to cover 200 nipples). Each t-shirt is individually numbered from 1 to 100, which also determines the price. That’s right, number 100 costs $100! The simple HTML-based website does the job well. 
Panic Goods Apparel Panic Goods sell some designs awesome screen-printed t-shirts, all of which are printed on the highest-quality fabric around. It has an incredibly stylish website that features a seamless textured pattern and plenty of white space. 
Glamour Kills Glamour Kills weaves together threads of culture. Its products—including tees, hoodies, bathing suits and denim—combine a rock ‘n’ roll edge with chic modernism. Its website has plenty of awesome typography, textures and patterns. 
Bang Bang T-Shirts Bang Bang T-Shirts is a UK-based t-shirt company. It sells high-quality products at low prices and is always accepting design submissions. The vertical typography on this otherwise simple website add visual interest. 
Worm Sign T-Shirts Worm Sign supplies a range of DJ-friendly and music-inspired t-shirts. It has a simple three-color website that looks a touch inspired by Twitter. 
Linty Fresh Linty Fresh has a nice selection of t-shirts, buttons, belts and necklaces, as well as great bundle and mystery packs. The seamless charcoal-gray-and-black background pattern is enlivened by bursts of lime green. 
T-Shirt Hell T-Shirt Hell is where all the bad shirts go. It’s full of funny, rude and weird t-shirt designs, with thumbnails presented against a dark, grungy layout. 
Camiseteria Camiseteria has a huge selection of designs, including clothes and bags for children and infants. You can submit your own designs and vote on others from the community. The minimal but beautiful textured website has bursts of fire-orange to jazz things up. 
Red Bubble Red Bubble is a great little shop that sell tons of t-shirts. It also features all kinds of art, photography and writing. The simple, modern, stylish design has bursts of red that designs complement the light grays. 
Related PostsAbout the AuthorCallum Chapman is a young freelance designer from Cambridge, UK. He writes for his own blog at Circlebox Blog and tweets all day long on interesting design subjects. Drop him a line! (al)
© Callum Chapman for Smashing Magazine, 2009. | Permalink | 49 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine Post tags: e-commerce, showcases, t-shirts 49Paddy Donnellyhttp://blog.iampaddy.com/The Death of The Boring Blog Post?http://www.smashingmagazine.com/?p=186232009-11-19T18:13:48Z2009-11-19T14:34:19Z  Let's face it: the classic blog post is boring. Barring the text and images, each one generally has the exact same layout. We see little originality from one post to the next. Of course, consistency and branding are extremely important to consider when designing a website or blog, but what about individuality? Does a blog post about kittens deserve the same layout as one about CSS hacks? 
Because installing a WordPress theme is so easy, anyone can have a blog up and running in minutes. While this is great, and we now have a wealth of blogs on countless topics, perhaps it’s too easy? Just thinking about the endless hours of effort that a print designer puts into creating the custom layout of a magazine article makes one respect the finished product so much more. A few individuals out there, though, are really breaking the mold of the blogosphere. 
Let’s face it: the classic blog post is boring. Barring the text and images, each one generally has the exact same layout. We see little originality from one post to the next. Of course, consistency and branding are extremely important to consider when designing a website or blog, but what about individuality? Does a blog post about kittens deserve the same layout as one about CSS hacks? 
Too Easy?
Because installing a WordPress theme is so easy, anyone can have a blog up and running in minutes. While this is great, and we now have a wealth of blogs on countless topics, perhaps it’s too easy? Just thinking about the endless hours of effort that a print designer puts into creating the custom layout of a magazine article makes one respect the finished product so much more. A few individuals out there, though, are really breaking the mold of the blogosphere. 
These guys aren’t using standard WordPress themes or cutting corners to make their lives easier. Rather, they are challenging themselves and producing some fantastic content. Pushing yourself to create original layouts and designs customized to the content of each post is a fascinating and entertaining way to build a blog. 
But why has this trend of melding blog post and magazine article, the “blogazine,” not caught on with the masses? The <cringe> Trend</cringe> with a difference   
Hearing the word “trend” makes us designers shudder because we picture overused glossy buttons, drop-shadows and reflections. But the blogazine trend could be unlike other trends for a few special reasons Designing a creative layout for each new blog post, based on the content itself, requires skill, patience, dedication to the content and, most of all, effort on the part of the designer! Let’s now look at three people who exhibit all four qualities: The Pioneersis one of the early innovators of this style of blogging and has been creating custom blog post designs since June 2008. With a background in print design, Jason had a vision to create a blog more in the style of a magazine, rather than obey the established rules of blog design. While, yes, this is a redesign of sorts, I’m considering much more a rethinking. ~ Jason Santa Maria

Jason’s blog posts are fascinating and cover a wide range of topics, including design, typography, books, photography and film. The differences in the designs are sometimes just subtle changes in background or typography, but each conveys an entirely distinct message that it couldn’t if it was uniform with the rest. Sometimes the changes are radical, but every one still has an element of “Jason-ness.” The header and footer are usually consistent, but even without them, you can still tell a Jason Santa Maria post from a quick glace. We’ve made so many advancements in how we publish content that we haven’t looked back to what it is we’re actually creating. Many of us see the clear separation between things like print design and web design, but I’ve really been questioning the reality of why things are this way. ~ Jason Santa Maria
We Web designers don’t want to be regarded as lazy. Do we? We have some of the most creative and inspiring designers in our profession, so why don’t we show our true potential in our blog articles? Dustin got a lot of publicity with his open letter to American Airlines, in which he suggests a dramatic redesign and rethinking of its online customer experience. The articles on Dustin’s blog are incredibly fascinating, and this user experience designer has clearly put serious thought into each one. 
I got the chance to speak with Dustin about his work: 
Q: What prompted you to create a “blogazine” instead of a traditional blog? I’m never satisfied with my work. Invariably, two weeks after finishing a design, I feel like I can do better. When I originally tried to design my blog, I kept finishing a design, hating it and starting over. This happened ten or twelve times until I finally gave up. Eventually, I realized that each post could stand on its own and be its own design that fit the content. Despite the holdbacks of HTML and CSS, it has worked much better than I had even anticipated. Q: Does having a blogazine really boost your creativity when it comes to creating a post? The blogazine style does seem to boost creativity, and by a huge amount. I feel an intense amount of freedom when I’m not constrained by the box of a pre-formed design. I can open Photoshop and use it as a word processor with design functionality. The design really does complement — and become — the content, because they are built simultaneously, without regard for any of the other stuff on the website. 
Q: Where do you get your inspiration for your blog articles? I get inspiration from everywhere. I’m fascinated by medicine and the human brain. So many of my articles center on interesting things that I’ve learned while studying neuroscience. Sometimes I’ll start with a single word, like “sleep,” and develop it into a whole article as I research the fringes of the field. There’s really no set source of inspiration. Q: Advantages? The main advantage is one I didn’t anticipate. Doing a blogazine article requires a lot more work than a traditional blog post, and that has kept me on my toes; because such a large investment is required, I publish only what I feel are my best articles. This seems to keep the quality fairly high. I start four or five articles for every one I publish. If I had a normal blog, that wouldn’t be the case — the other four articles would be published too, even though they wouldn’t be as good as the ones I do end up publishing. Q: Disadvantages? The biggest disadvantage is that CSS and HTML are terrible technologies that weren’t designed for page layout. They were designed for structured content presentation, like for a newspaper, where all the elements throughout the website are the same and are re-used. But I’m trying to make a magazine, where the content and presentation are inextricably mixed and unique. The way presentation CSS is supposed to be decoupled from the content HTML is totally counter to the mission I am trying to accomplish, and it makes coding the articles frustrating, messy and time-consuming. My solution to this problem has basically been to ignore convention and use inline styling for most of the presentation code and extract the website-wide presentation layer into a separate CSS document. This takes forever and is not ideal. To put it lightly, I’ve developed a love-hate relationship with CSS. is a web designer at Erskine Design and has created his website as an experiment in art direction. Not allowing himself to use the same old templates, Greg has created a fascinating website, with custom designs for each blog post. 
Here’s what Greg had to say when I spoke with him: 
Q: What prompted you to create a blogazine instead of a traditional blog? Well, I’ve had a blog for ages and have always been bad at keeping it regularly updated, until I custom-designed a few of the posts sometime last year. I generally hate writing about Web-related stuff (I find it all a little boring), and I love designing, so I wrote about what I wanted (music and zombies) and designed each post around the content, although still housed in my old blog layout. The reception to the posts was really nice, and I enjoyed creating them, so for my latest website I set out to cater to that same audience and keep myself happily occupied at the same time. Q: Does having a blogazine really boost your creativity when it comes to creating a post? I wouldn’t say it boosts my creativity – the website is more of an outlet for it. Despite spending all week being creative at Erskine Design, it’s still quite liberating to design whatever you want, however you want, with no external influence. Q: Where do you get your inspiration for your blog articles? Usually I think of my best ideas when cycling or sitting on a tram or bus. It’s been a big thing on the Web over the years, where you get your inspiration from, and I’ve never really understood it. I think that looking at other people’s work all the time for inspiration is massively constricting. I find staring out a window for a while usually helps. Q: Advantages? The obvious advantage is that it looks better. But the content is infinitely more captivating as well. I’m not a great writer, and I probably write a lot of bullshit, but because it’s all nicely designed, readers are drawn in and end up reading more than one post. It’s also very fun to create and helps me grow as a designer. Q: Disadvantages? I guess some would say the time factor is a disadvantage, but if you love doing something, spending a lot of time doing it is justified. I can’t think of any disadvantages. The Microblogging RevolutionTwitter, Posterous, Flickr, Facebook, the iPhone and countless other services make it incredibly easy for us to instantly post short musings, photos, video, thoughts and creations, which in turn has created a big gap between the micro post and the macro post. Time for the ‘Macro’ post to shineLonger blog posts with valuable content might not get the recognition they deserve, because the 140-character mindset turns people off of reading several pages of text. One way to combat this and make your content more appealing is by creatively altering the layout, using the blogazine technique. Bridging the gapWe don’t know exactly where the world of blogging is headed in the next few years, but the increase in micro-blogging will definitely be a strong influence. Shorter attention spans call for drastic changes to the length of blog posts. Blogazines could cater to a generation accustomed to the longer articles of newspapers and magazines, becoming a bridge between the traditional article and the TwitPic. AdvantagesForces you to think more creatively Slipping into the habit of typing up your thoughts and clicking “Post,” without thinking about the layout of each article, is easy. By taking a little extra time for the art of blogging, your creativity will increase with your efforts. Something different and exciting for your readers If your copy of .Net or Computer Arts printed every article with the same layout, every month, would you still subscribe? Your readers would more likely return for new articles if they anticipate something new and rewarding. Reduces the number of short simple posts Your blog posts will have much more weight if you take the time to create a full article, rather than knock of a rushed post. Makes ‘wordy’ posts more readable If all you have is text, text, text, then people will be less likely to read it. Put a little effort into styling the content, and your post will become much more readable. DisadvantagesIt takes serious effort Hand-crafting each blog post won’t be easy, but the rewards will be well worth it. You need CSS and HTML experience Anyone can download a WordPress theme and merrily post an article. But building a custom layout requires some experience with CSS and HTML. Inconsistency The layout of your blog will change dramatically from post to post and, if not done right, may strike your readers as being awkwardly inconsistent. Just look at Jason Santa Maria’s work. Every post is radically different for a reason, but a consistent vein runs through the posts. No print layout experience Because this style borrows many elements from print design, anyone who has worked only in Web design may find it difficult to change their way of thinking. Rules of typography and white space, for example, may throw you off. But practice makes perfect, and an endless supply of inspiration can be found in creative magazines. So, is the blogazine route for you?Obviously this style isn’t suitable for every website. It wouldn’t be practical for blogs that pump out three or four articles a day, but certain types of websites could benefit from it especially.PortfoliosWe have a habit of following trends very easily, especially in our portfolios. Instead of following the tired old practice of positioning screenshots of your work in a nice grid one after the other, why not use the blogazine technique and design a fresh page for each project according to the subject, client and color scheme? 
Online ShopsMany online shops suffer from a certain blandness, following the pattern of: thumbnail grid, name, short description and then pagination. This layout may be good for usability, but there is a middle ground between scannability and visual appeal. The design changes do not have to be dramatic. In fact, drastically changing the layout would not be advisable for online stores. CSS GalleriesA new CSS gallery seems to pop up every day, making it increasingly difficult to distinguish between all of them. While some of the higher-profile examples like SiteInspire are fantastic for gaining inspiration, the constant influx of CSS galleries makes the inclusion of your own design in one of them somewhat less of an achievement. It would be interesting to see a really high-class CSS gallery adopt the blogazine technique, with a custom page made for each worthy website, using large high-quality images instead of the typical screenshots. The websites in a CSS gallery are not all about the same topic and do not have the same style or same content, so why should they receive the same treatment and same type of screenshot? Merely for consistency? Think about a painting that is worthy of being displayed in an art gallery. Should it be given the same treatment, cut to the same size, positioned the same way? Why do we treat gallery-worthy websites this way, then? Quiet BlogsBloggers often lack the motivation to keep their blog running. Many of them feel they have to keep it fresh by updating it every day, and failing to meet their own expectations results in both frustration and a neglected blog. Updating a blog daily isn’t ideal, and more often than not… Seven half-hearted articles a week does not equal one very polished, interesting article. RSS readers are jam-packed with articles every day, and chances are, the articles that don’t get your full attention will get lost in the crowd. Keep your short musings and thoughts for Posterous and Twitter, and spend some real time hand-crafting well-thought-out articles. You’ll satisfy both yourself and your readers. If you look at examples from Jason, Dustin or Greg, They do not blog that often: sometimes once a week, sometimes once a month. But the quality is always stellar. ConclusionYou have endless possibilities to be more creative with your blog. Why stay tied down to one theme and one layout when you can experiment with your skills and push your creativity to its limit with a blogazine? With the Internet suffocating with blogs, people have developed incredibly short attention spans, and they probably won’t stop for your content if you have “just another blog.” Why not throw away the blogging rule book and make your articles stand out from the crowd? Further reading(al)
© Paddy Donnelly for Smashing Magazine, 2009. | Permalink | Be the first to comment | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine Post tags: blogs, trends 0Janko Jovanovichttp://www.jankoatwarpspeed.comDesigning CSS Buttons: Techniques and Resourceshttp://www.smashingmagazine.com/?p=160872009-11-19T17:17:39Z2009-11-18T15:23:29Z Buttons, whatever their purpose, are important design elements. They could be the end point of a Web form or a call to action. Designers have many reasons to style buttons, including to make them more attractive and to enhance usability. One of the most important reasons, though, is that standard buttons can easily be missed by users because they often look similar to elements in their operating system. Here, we present you several techniques and tutorials to help you learn how to style buttons using CSS. We'll also address usability. 
Before we explain how to style buttons, let's clear up a common misconception: buttons are not links. The main purpose of a link is to navigate between pages and views, whereas buttons allow you to perform an action (such as submit a form).  Buttons, whatever their purpose, are important design elements. They could be the end point of a Web form or a call to action. Designers have many reasons to style buttons, including to make them more attractive and to enhance usability. One of the most important reasons, though, is that standard buttons can easily be missed by users because they often look similar to elements in their operating system. Here, we present you several techniques and tutorials to help you learn how to style buttons using CSS. We’ll also address usability.
Links vs. buttonsBefore we explain how to style buttons, let’s clear up a common misconception: buttons are not links. The main purpose of a link is to navigate between pages and views, whereas buttons allow you to perform an action (such as submit a form). In one of his articles, Jakob Nielsen writes about command links, which are a blend of links and buttons. But he recommended that command links be limited to actions with minor consequences and to secondary commands. To learn more about primary and secondary commands (and actions), check out Primary and Secondary Actions in Web Forms by Luke Wroblewski. To learn more about the differences between links and buttons, read Creating Usable Links and Buttons at UXBooth. Basic StylingThe simplest way to style links and buttons is to add background color, padding and borders. Below are examples of the code for the link, button and input (”Submit”) elements. <a class="button" href="#">Sample button</a>
<button class="button" id="save">Sample button</button>
<input class="button" value="Sample Button" type="submit" /> .button {
padding:5px;
background-color: #dcdcdc;
border: 1px solid #666;
color:#000;
text-decoration:none;
}This simple code minimizes the visual differences between links and buttons. And here are the rendered examples of the code above: 
The important thing to note is that these three elements render differently with the same CSS. So, you should style these elements carefully to ensure consistency across your website or application. ImagesAdding images to buttons can make the buttons more obvious. Sometimes the image itself clearly communicates the purpose of a button; e.g. a loupe icon for searching or a floppy disk icon for saving. The easiest way to add an image to a button is to use a background image and then position it accordingly. Below are our examples with a checkmark icon. .button {
padding: 5px 5px 5px 25px;
border: 1px solid #666;
color:#000;
text-decoration:none;
background: #dcdcdc url(icon.png) no-repeat scroll 5px center;
}
Button StatesIn addition to their default state, buttons and links can have two other states: hover and active (i.e. pressed). It is important that buttons appear different in different states so that users are clear about what is happening. Any element in a hover state can be styled by invoking the :hover CSS pseudo-class. a:hover {
color:#f00;
}Though very important, the active state is rarely implemented on websites. By showing this state, you ensure that your buttons are responsive and send a visual cue to users that a button has been pressed. This is called isomorphic correspondence, and it is “the relationship between the appearance of a visual form and a comparable human behavior” (Luke Wroblewski, Site-Seeing). The article Pressed Button State With CSS elaborates on the importance of the active state. a:active {
color:#f00;
}There is yet one more state, one that is seen when navigating with the keyboard: the focus state. When the user navigates to a button using the Tab key, it should change appearance, preferably to have the same appearance as the hover state. a:focus {
color:#f00;
}The examples below shows the common way to style button states. The hover state is a bit lighter than the normal state, while the active state has an inverted gradient that simulates a pressed action. Although you need not limit yourself to this styling, it is a good place to start. 
We should talk about how to handle the outline property for the :active and :focus states. Handling this property well is important for the experience of users who employ the keyboard as well as the mouse. In the article Better CSS Outline Suppression,” Patrick Lauke shows how buttons and links behave in different combinations of states and explains why the outline property should be invoked only with the :active state. 
The blue “Buy now” button on Apple.com has a slightly lighter background for the hover state and an inset style for active state. Even the main navigation button on Apple’s website implements all three states. 
Although it doesn’t implement the active state, this fancy button on Tea Round has a nice fading effect on hover. 
The “Read more” button on UX Booth turns green on hover and moves down one pixel in the active state, which simulates the effect of pressing a button. Useful ReadingThe article Rediscovering the Button Element shows the differences between links and buttons and explains how to style buttons easily. 
Styling Form Buttons covers the basics of styling buttons, with many examples. 
Beautiful CSS Buttons With Icon Set shows how to style buttons using background images. Although not scalable, these are really nice buttons. 
Recreating the Button is a very good article that explains how Google ended up with the buttons that it uses on majority of its websites. 
Scalable CSS Buttons Using PNG and Background Colors explains how to create really stunning buttons for all states. Although it uses jQuery, it degrades gracefully if JavaScript is turned off. 
Sliding Doors: Flexible ButtonsOne important consideration needs to be made when styling buttons: scalability. Scalability in this context means being able to stretch a button to fit text and to reuse images. Unless you want to create a different image for each button, consider the “sliding doors” technique. This technique enables you to create scalable, rich buttons. 
The principle involves making two images slide over each other, allowing the button to stretch to the content. Usually, this is done by nesting a span element within a link. As shown in the image above, each element has its own background image, allowing for the sliding effect. The two code snippets below show the structure and basic styling for this effect. <a href="#"><span>Typical sliding doors button</span></a> a {
background: transparent url('button_right.png') no-repeat scroll top right;
display: block;
float: left;
/* padding, margins and other styles here */
}
a span {
background: transparent url('button_left.png') no-repeat;
display: block;
/* padding, margins and other styles here */
}The advantages of this technique are that it: - Is an easy way to create visually rich buttons;
- Ensures accessibility, flexibility and scalability;
- Requires no JavaScript;
- Works in all major browsers.
Useful ReadingThe “Sliding Doors of CSS” article on A List Apart (part 1 and part 2) covers the basics of this technique. Although a bit old, these articles are a must-read for every Web developer. 
Also a bit old, Creating Bulletproof Graphic Link Buttons With CSS is an excellent article that shows how to create bulletproof, resizable, shrunk-wrap buttons. Also a must-read. 
Filament Group has a variety of excellent articles and tutorials. Its second article on CSS buttons, Styling the Button Element With CSS Sliding Doors,” explains how to create buttons by combining techniques. Although it doesn’t support the active state, it can be easily extended. 
How to Make Sexy Buttons With CSS is one of the best and simplest explanations of the sliding doors technique. It also contains a little fix for the active state in Internet Explorer. 
If you want Wii-like buttons, the article Simple Round CSS Links (Wii Buttons) provides all the necessary resources and explanation on how to style them. 
The common way to achieve the CSS sliding doors technique is to use two images. However, the article CSS Sliding Door Using Only One Image shows that it is possible to achieve the same effect with only one image. 
CSS Oval Buttons and CSS Square Buttons from Dynamic Drive are two other articles that show the effectiveness of CSS sliding doors. 
CSS Sprites: One Image, Not ManyWith CSS Sprites, one image file contains multiple graphic elements, usually laid out in a grid. By tiling the image, we show only one Sprite at a time. For buttons, we can include graphics for all three states in a single file. This technique is efficient because it requires fewer resources and the page loads faster. We all know that many requests to the server for multiple small resources can take a long time. This is why CSS Sprites are so handy. They significantly reduces round-trips to the server. They are so powerful that some developers use CSS Sprites for all their graphics. The Holy Sprites round-up on CSS Tricks offers some very creative solutions. The example below shows the simplest use of CSS Sprites. A single image contains graphics for all three button states. By adjusting the background-position property, we define the exact position of the background image we want. The image we’re choosing to show here corresponds to a background position of top: -30px and left: 0. 
a {
background: white url(buttons.png) 0px 0px no-repeat;
}
a:hover {
background-position: -30px 0px;
}
a:active {
background-position: -60px 0px;
}For general information and resources on CSS Sprites, check out The Mystery of CSS Sprites: Techniques, Tools and Tutorials.” Useful ReadingIn this easy-to-follow tutorial How to Build a Simple Button with CSS Image Sprites,” Chris Spooner explains how to create a CSS Sprites image in Photoshop and use it with CSS. 
Transforming the Button Element With Sliding Doors and Image Sprites shows how to enrich a button element with a combination of sliding doors and image Sprites. It implements the active state in a very interesting way, not by using different images or colors but rather by positioning. CSS 3: Buttons Of The FutureCSS 3 allows us to create visually rich buttons with just a few lines of code. So far, this is the easiest way to create buttons. The downside of CSS 3 is that it is currently supported only by Firefox and Safari. The upside is that buttons styled with CSS 3 degrade gracefully in unsupported browsers. By using the browser-specific properties -moz-border-radius (for Firefox) or -webkit-border-radius (for Safari), you can define the radius of corners. Here are a few examples of what can be done with the border radius property. 
For better results, you can combine CSS 3 rounded corners with the background image property. The example below shows a typical button with a gradient image, the first without rounded corners, and the second with. 
Compared to sliding doors, this technique is far simpler. However, if you want to maintain visual consistency across all browsers, then use sliding doors, because it works in all major browsers, including IE6. To learn more about the capabilities of CSS 3, read CSS 3 Exciting Functions and Features: 30+ Useful Tutorials.” And here are a few good tutorials on styling buttons with CSS 3 features. Useful ReadingSuper Awesome Buttons With CSS 3 and RGBA shows the power of CSS 3 with rounded corners, Mozilla box shadows and RGBA, which is a color mode that adds alpha-blending to your favorite CSS properties. This is one of the best examples of CSS 3 buttons. 
Create a CSS 3 Button That Degrades Nicely is a good example of CSS 3 buttons that degrade gracefully in browsers that don’t support CSS 3. 
Creating buttons without Images Using CSS 3 explains the drawbacks of using images for buttons and shows several options for creating image-less CSS 3 buttons. 
Emulating Google-Syle Buttons Using CSS 3 & dd_roundies JS is a fantastic article that shows how to create Google-like buttons. It goes even further and shows how to create the button pillbox commonly seen on Google pages. Instant Tools: Are They Useful?Tools exist for creating buttons, such as Easy Button and Menu Maker and My Cool Button, and for creating CSS Sprites, such as CSS Sprite Generator, but the question is, do they really help you create buttons that fit your needs. Although they are configurable and easy to use, your creativity and control over the results are limited, which makes for average-looking buttons. Using one-size-fits-all buttons is not a good idea. The solution is to use Photoshop (or a free alternative) and the proven techniques described in this article. If you are a beginner with Photoshop, here are several excellent tutorials on creating amazing buttons. If you don’t know where to start, iPhone-Like Button in Photoshop is the perfect choice. In only 10 to 15 minutes, you will be able to create the kind of buttons seen on the iPhone. 
How to Create a Slick and Clean Button in Photoshop is a very detailed tutorial that guides you through 30 simple steps and helps you learn the Photoshop basics. In addition, the article explains how to use these graphics in combination with HTML and CSS to create fully functional CSS buttons. 
Photoshop Button Maker is a fantastic tutorial from PSD Tuts that shows how to create fancy oval buttons (or badges). 
Buttons And Usability: Instead Of ConclusionThe techniques described above can help you create stunning buttons. However, because they play a critical role in website usability, the buttons should meet some key principles: - First consider the labeling. Always label buttons with the name of the action that the user is performing. And always make it a verb. A common mistake is to label buttons “Go” for various actions such as searching, sending email and saving. Labels should also be short and to the point; no need to clutter the user interface.
- As mentioned, include all button states (default, hover, active) to provide clear visual cues to the user as to what is happening. Button outlines should remain in the active state only.
- Clearly distinguish between primary and secondary actions. The most important action should be the most prominent. This is usually done by giving primary and secondary actions different colors.
- Pay close attention to consistency. Buttons should be consistent throughout a Web application, both visually and behavior-wise. Use CSS sliding doors for reused buttons or CSS 3 rounded corners to maintain consistency.
- Though obvious, we should note that the entire button area should be clickable.
The articles below provide even more usability guidelines and best practices for designing buttons. Make Complete Button Surface Active and Enhance Usability is an in-depth article that shows mistakes in button design and that explains why the entire button surface should be clickable. 
Creating Usable Links and Buttons explains why users expect buttons sometimes and links other times. It also shows how to choose between the two elements. 
How to Design Buttons to Help Improve Usability explains some usability principles that should be considered when designing buttons. It covers the basics of icon usage, appearance, behavior, hierarchy and consistency. (al)
© Janko Jovanovic for Smashing Magazine, 2009. | Permalink | 49 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine Post tags: buttons, CSS 49Dmitry Fadeyevhttp://www.usabilitypost.comDesigning Social Interfaces: Overview and Practical Techniqueshttp://www.smashingmagazine.com/?p=165532009-11-18T20:31:42Z2009-11-17T16:20:18Z The standard approach to interface design is to craft a channel that allows you to easily and efficiently control hardware or software; it's all about the interaction between people and computers. But today, the two entities on each side of the user interface are changing: it's no longer about people interacting with computers, but rather about people interacting with people through computers. This is the nature of the social Web. Social news websites, message boards, social networks, online stores and blogs all have some sort of user interaction going on, whether it's comments on a blog post or social games on Facebook. The critical issue here is that people are not interacting directly with other people; rather the interaction occurs through a user interface. The computer acts as a mediator. 
In essence, we control the flow of user interaction on our websites. By crafting an interface to facilitate certain behaviors, we can influence the direction in which our community goes. In this article, we'll demonstrate the power of social interface design and what it can do for you, using several practical examples. 
The standard approach to interface design is to craft a channel that allows you to easily and efficiently control hardware or software; it’s all about the interaction between people and computers. But today, the two entities on each side of the user interface are changing: it’s no longer about people interacting with computers, but rather about people interacting with people through computers. This is the nature of the social Web. Social news websites, message boards, social networks, online stores and blogs all have some sort of user interaction going on, whether it’s comments on a blog post or social games on Facebook. The critical issue here is that people are not interacting directly with other people; rather the interaction occurs through a user interface. The computer acts as a mediator. In essence, we control the flow of user interaction on our websites. By crafting an interface to facilitate certain behaviors, we can influence the direction in which our community goes. “Small software implementation details result in big differences in the way the community develops, behaves and feels.” — Joel Spolsky, More Joel on Software
In this article, we’ll demonstrate the power of social interface design and what it can do for you, using several practical examples. Social Interface Design TechniquesUser points and BadgesAchievement, and more importantly, the feeling of achievement, can play a big part in social websites and games. You may be familiar with the massive multi-player games that have a system whereby players progress through levels as they play the game. Each level brings more prestige to the player and so keeps them playing more — with the next level always just a little bit out of reach. The same idea can be used on social websites by recognizing your users’ contributions. For example, for a social news website, you could award points to users for submitting stories. You could also give users special badges when they perform a certain number of tasks. In a social environment, these badges would lift the recipient’s ego, and so people would be motivated to compete for badges. These kinds of things enable us to influence the direction in which our community moves. For example, to increase user participation, such as the number of comments people leave, you could give users a badge after they’ve made a certain number of comments. The same could be applied to any other user driven-content: submitting stories, answering questions, asking questions, writing reviews and so on.  The Envato marketplace awards badges to its sellers and buyers.
Of course, the flaw to this method is that while getting quantity may be easy, controlling quality may not be. You want users to leave a lot of comments or reviews on your website, but you want these contributions to add value. There is no exact science or formula for how to do this, so the best advice is simply to keep this factor in mind when designing a social mechanism of this type. Will the technique you’re considering add more volume or value? Social news websites tend to give their users points from the submissions that people have liked. This drives people to find better and more interesting stories to submit. Websites such as Envato marketplaces and Stack Overflow give people badges when they perform certain actions or do something a set number of times.  Stack Overflow’s achievement badges.
Unlockable Features as RewardsPoints and badges are superficial prizes: they’re all about ego. You can go a step further and offer tangible benefits to your biggest contributors, such as by unlocking new features for your website or application. Unlocking new features differs from things like badges and points because the user isn’t interested here in building their ego; they’re interested in getting more value out of your website or application. You may be familiar with the “Skinner Box,” the famous psychological experiment developed by B. F. Skinner that saw a rat placed in a box with a button and a food dispenser. If the rat stepped on the button, it would receive some food. The food here was the reward for pushing the button, and it worked. The rat kept pushing the button to get more food. The same principles apply to social interface design. By giving your users little rewards for accomplishing certain things, you can steer the direction of your community. The trick is to make the rewards beneficial enough for people to want to achieve them. 
Hacker News unlocks comment down-voting when you accumulate a certain number of points (highlighted). Hacker News, a social news website for developers and entrepreneurs, unlocks things like comment down-voting as you earn points from your submissions and comments. While you cannot lose points for your submissions (there is no down-voting for submitted stories), you can lose points for your comments. Coupled with the fact that you could potentially gain or lose certain functionality on the website depending on the quality of your comments, this makes users more careful about what comments they leave, and they have more incentive to add real value to what another user says. Reply NotificationsA popular feature on blogs and message boards is email-based notification of new replies to your messages. The feature works like this: you submit a new post to a social website, and when somebody replies, you are notified by email. This allows you to keep track of new replies without having to visit the website.  The reply notification checkbox on the Webdesigner Depot comments form.
While this feature makes sense from the user’s perspective, it might not make sense for the website owner. Email notifications move your audience from direct on-site browsing to off-site email. If users can be notified of new replies, why would they check the website manually? But they do have a reason to come back. When users come back to your website they not only check for replies to their messages, they also read other messages and browse other new content. This keeps the website alive and visitor loyalty high. So while providing such notification systems may not seem logical at first, think about the long-term effects of such features. Dealing With TroublemakersHowever much we want our community members to all get along, there will inevitably be one or two people who seem to want to cause nothing but trouble. Unfortunately, one rotten apple can spoil the barrel, so you’ll want to deal with these troublemakers quickly and efficiently. The traditional method of dealing with such people is to remove their access to the website, to ban them. This is the inclination of most people because that’s how things work in the real world. If someone causes trouble in your home, shop or bar, you ask them to leave. In more extreme cases, you might ask security personnel to escort them out. But you just want to get them out by any means. That’s exactly how most people deal with troublemakers online: they simply ban them using one of several methods. These methods include deleting their messages, de-activating their account and blocking their IP address. In many cases, this works just fine. The user is booted from your website and order is restored. However, things don’t always go smoothly. Some people enjoy the attention they get and may create new accounts to continue making a disturbance. A social interface technique can come in handy here. Instead of banning these individuals, we could let them stay and use the website as they like, but we would hide all of their messages and content from everyone… everyone, that is, but them. So the troublemaker would still see all of their messages and wouldn’t suspect that anything is up, but no one else would see them, so they would cause no disturbance. Yes, the troublemaker may eventually find out that something is going on, but then again, they may assume that everyone is just ignoring them, which is not an unlikely scenario. Whether they leave or stay wouldn’t matter anyway if they’re invisible. Reply ThreadingThreading, or branching, is a way to organize comments and posts on message boards and blogs. A thread, or branch, is a collection of comments that stem from one particular post, and so they focus the discussion on whatever that parent post is about. Threads organize different topics on the same page, usually by indenting the child comments under the parent. This technique may not work in all circumstances. Threading comments under blog posts or message board posts may result in parallel discussions taking place. If you don’t want this — if you don’t want people to talk about different topics but instead focus on the original post — then it may be best to keep the comments and replies in a flat, linear structure. On the other hand, threading can be effective in different contexts. For example, on social news websites such as Slashdot, which feature heavy threading of comments on posts, it effectively turns the comment area into a platform for related discussions, each wrapped in a separate thread. This means that if someone had an interesting angle to explore related to the entry, they could pursue it, and subsequent comments would follow that tangent.  Slashdot features deep comment threading on stories, with each comment following its own tangent.
Threading can be useful on blogs because it allows you to effectively reply to individual commenters. One of the best ways to generate healthy discussion is to take the time to reply to as many comments as possible. This sends a clear message: you care. When someone leaves a comment and gets a reply from the blog’s author, they know that their comment is being read and that the author is interested in what they have to say. This makes them much more likely to add more comments in future because they know their input will be read and considered and that they won’t be wasting their time. Threading better organizes comments when there are a lot of such targeted replies. Wrapping Up…So, how do you go about designing an interface with social elements in mind? Focus on your goals. Before you can come up with an effective interface, you need to know exactly what your goals are. What do you want to happen? Do you want people to leave many comments on your blog? Do you want to encourage people to post answers to questions, or to submit them? Do you want people to submit files or leave ratings? Form a clear picture in your mind of what you want the interface to promote. Before you set off, you need to know your destination. Only when you have defined your objectives can you begin to develop a strategy to meet them. Social interface design is a new field. Much has been written about usability and interactive design, but still not a lot on social interface design. It is an intersection of various fields: interface design, sociology and psychology, and as such it requires more than just an understanding of usability and design; it requires an understanding of human behavior and interaction. Using concepts from these other fields help you make interfaces that aren’t just easy to use, but that steer your community in the intended direction. (al)
© Dmitry Fadeyev for Smashing Magazine, 2009. | Permalink | 35 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine Post tags: interfaces, social, ui, usability 35
|