iTunes + CSS3

You know, web design innovation only really occurs when your entire user base uses the same browser. And you know, who just so happens to have a very stripped down, hidden web browser inside their app? Apple.

The iTunes store, is in essence, a hidden website that can only be accessed by iTunes itself, which uses WebKit to render all the pages. It’s a web designer’s heaven, and it also means you can use all of those meticulous features inside CSS3.

Today, Apple unleashed the new iTunes 9, and needless to say, they definitely take advantage of their position. It didn’t take long for a packet sniffer to catch the URL to an HTML page, which is now hosted on Will Norris’ blog (thanks, by the way). Noone had pointed out the CSS link, which is immediately where i dived to find.

Now it should be made clear, this is not any web app. If you don’t find the site’s visuals appealing, all you need to do is look under the hood to find the beauty: this is a seriously, amazing work of art. There’s not a drop of flash on this website, from the rotating banners to the music preview player. Everything is straight HTML5, CSS3.

I assume you want to see the CSS file now. I must warn you: it’s mondo. Uncompressed, there are 7858 lines of CSS, and that’s when it’s compressed, no thanks to the immensely confusing links to images. It crashed TextMate (yes, TextMate! I’m utterly shocked, as CSS Edit handles it with so much ease) three times. You can download the css file here.

I’ve been tackling it by taking large bits of it one at a time. TextMate users can click “Plain Text” on the bottom row and switch it to CSS for color coding, and then click “Format CSS” in the CSS Bundle to uncompress and format the file to make it more readable. 

CSSEdit users can hold the css all at once. Go to Format > Re-Indent to make it readable. 

Some CSS notes (things that I’m curious about and like).

They use some serious parameters in this file. 

Apple added a special property for iPhones: -webkit-tap-highlight-color, for the color that shows behind a link when you tap it on the iPhone. 

<span class="highlight-html">-webkit-mask-box-image</span> is used to mask images, just like you would in photoshop, but I can’t find a specific example used in the one page that we have in html. 

Apple used -webkit-gradient for every single gradient in iTunes. To create text gradients, they simply added the word ‘text’ to the end of the property value

background: <span class="highlight-html">-webkit-gradient(linear,left top,left bottom,from(#5c7b99),to(#102337)) text</span>;

I also had no idea you could specify the direction for the gradient. 

Comments

Chris Messina

When Will posted the HTML file, I did the same thing. The CSS is pretty amazing and very inspiring. I’m hoping to have time to rip it apart… and see what else is hidden in there! wink

NSP

On topic, this is certainly interesting. I wonder if there is a way to use this and the HTML in a browser (outside of iTunes).

A quick note, off topic:
Your comment area is messed up. I had to disable all images to see the comment form. Additionally, the email textbox has YOUR email prefilled. That shouldn’t be the case.
Screenshot of comment area in Safari: http://img.skitch.com/20090910-xeyf4x3whpbhunjfy9epe5ydy4.jpg

Judson Collier

My apologies on that folks, it should be fixed now (essentially it was taking the variable {email} from my post, not your comment). The huge gravatar was a dumb CSS issue that I forgot to test with comments in a post.

Mike Rundle

I grabbed the CSS file and ran prettyprinter on it for formatting changes to make it readable, grab it: http://idek.net/Ti2

Paul Stamatiou

Nice post Judson.. damn this stuff is cool.  I was somewhat suprised they used image data (the base64 parts) in some places. Any ideas on the benefits?

Ivan Stojic

I know it’s very childish of me, but I just have to say it: the CSS file doesn’t crash Emacs grin

David Kaneda

Agreed! I’ve been using a bunch of tricks with jQTouch, especially gradients, but I can’t wait to try out the masking and such. That is one giant CSS file…

ps. Love the embedded font on this blog-

Robert

WOW! Thanks for the great posting. Time to start digging…

Matthew

I love Titillium as much as the next guy (if not more), but it makes for pretty nasty lookin’ body text, at least in Firefox. I firebug’d it back to Arial, and it was twice as legible.

Add your Opinion? You Know you want to...