Find me at...

16 September, 2010
An Event Apart, Washington, DC

21 September, 2010
Web Directions USA, Atlanta, GA

25 September, 2010
JSConf.eu, Berlin, Germany

14 October, 2010
Paris Web, Paris, France

CSS

Multitasking is killing me (and probably you too)

Sunday, July 11th, 2010

Multitasking has been stressing me, robbing me of my focus, my productivity, and my appreciation of the beauty of the exact moment I’m experiencing right now, and dammit, I want my brain back!

Once upon a time, I was assigned 21 projects in my first month on a job. Distinct projects, working with different groups of people on completely different tasks. I went from writing code 95% of the time to running from meeting to meeting.

At the same time, I installed IM at work and didn’t create a separate work account (I can see this clearly now, but at the time, I was just filling out my HR profile, I didn’t see the significance). The lines became blurry and I started to get pings around the clock from both work and friends. This is in part due to “crazy-round-world-syndrome”. My life is international, that’s okay, but it does make boundaries harder.

Perhaps it really began as early as 2000, when I got my first cell phone and lived with it glued to my ear? Getting an iphone in January of 2007 certainly made it worse because as a device my precious is meant to be petted, not simply used to accomplish other tasks more efficiently.

So what does a good geek do? Gather data.

I gathered data from scientific american, psychology today, read research papers, took a mindfullness course, and read links that friends posted to twitter.

Guest on The Big Web Show

Saturday, July 10th, 2010
me on the big web show with zeldman and benjamin
This week I had the good fortune to spend an hour talking with Jeffrey Zeldman and Dan Benjamin about all things CSS on The Big Web Show. It was lively and fun despite my cell phone making weird noises during the podcast. (Ooops, sorry!)

We talked about progressive enhancement, carpentry, testing, rounded corners, oocss, performance, working on big sites, and being a girl on the internets. If you missed the live show, you can check out the video podcast. I was super-duper-over-the-top nervous about the show, but I’ve heard that I didn’t come off like a total dweeb. ;)

Top 5 Mistakes of Massive CSS

Thursday, July 1st, 2010

Last week, Stoyan Stefanov and I spoke at Velocity Conference about optimizing massive CSS. We talked about our experiences optimizing large-scale sites like Facebook and Yahoo!, and we discussed our findings regarding the CSS efficiency of the Alexa Top 1000 websites.

Velocity was kind enough to share videos of the session.

What is the state of the internet regarding CSS performance? Kind of sad. We aren’t getting a lot of the basics right, and when we look at the more advanced techniques, there are some spectacular examples of what-not-to-do. Why do we care about CSS performance? As Stoyan talks about in the beginning of the video, it blocks progressive rendering and it is very difficult to auto-minify.

The media object saves hundreds of lines of code

Friday, June 25th, 2010

What is the internet made of? At least the UI layer is mainly composed of media blocks. I talked about the Facebook stream story before, and all the tiny objects of which it is composed. For the most part, the stream story is made up of the media object repeated over and over.

The media object is an image to the left, with descriptive content to the right, like this Facebook story:

image to the left, descriptive content to the right

It is a very simple object, but it is very powerful. We can eliminate many lines of code abstracting this repeating pattern. The code for the media block and many other “web Lego” are available on the Object Oriented CSS open source project.

CSS Variables Specification

Tuesday, June 22nd, 2010
Read the Spec

I don’t want CSS to become a programming language, but I do want it to be a better declarative language. I would like to see variables added to the CSS Specification. People have been begging for Variables or Constants in various incarnations forever. Variables will help us do more with less code. It is time to make it a reality. I like parts of both the Glazman/Hyatt and Fantasai proposals, and I felt a blend of the two would be best for developers, so I wrote this specification.

I plan to submit the specification to the CSS working group and I’d love your feedback and comments.

How to create CSS objects? Get the granularity right!

Monday, June 21st, 2010

In my previous post, I said:

Shoehorning CSS and HTML into PHP abstractions prevents the code from being DRY and ultimately leads to code bloat, because, the CSS and HTML require a far more granular object structure than the PHP.

And then I didn’t expand on it, or give proper context. Ooops, sorry!

In the PHP layer, the following stream story (from facebook) might be a single object. All of the logic of determining which bits of HTML to show or hide are contained within one object structure.

An example of a stream story on the facebook website

Frequently, developers try to make the CSS match this middle-end logic. We expect all the CSS code for the stream story to be sand-boxed within a wrapper id, for example #story. This ends up with bloated code that isn’t DRY. Why? because the proper architecture for the CSS layer is much more granular. Trying to base the CSS architecture on the PHP layer is something akin to trying to use the DB schema to configure apache. It just doesn’t work.

stream story broken down

Visual Semantics in HTML and CSS

Saturday, June 12th, 2010

Simplified web stack

Each layer in the web stack has its own architecture. You wouldn’t expect the DB schema to be used to architect the PHP middleware, and yet people expect that of the HTML and CSS. HTML needs to be written with a sense of the meaning of the data or content, something I call code semantics. Code semantics are incredibly important in the HTML for both portability and accessibility. On the other hand, CSS really is a separate layer in the stack, and it needs its own architecture that reflects the visual semantics of the page.

Visual semantics describe all the repeating patterns in the design of the page. They represent the fundamental building blocks of your website. In fact, they are often portable across sites with only minor modifications. Visual semantics shouldn’t necessarily be tied to HTML semantics, because you want an architecture that fits the unique requirements of each layer of the stack…

CSS Wish List

Monday, November 9th, 2009

Don’t get me wrong, I think CSS is awesome. It is a great way of defining the UI, but it could be even better. I’m excited about the special effects, transitions, and graphic elements currently being added to the CSS specification. They will help us write faster pages by eliminating the need for UI graphics for things like rounded corners. On the other hand, we also need to add structure to the language to make it easier for designers and developers to author new pages and applications. I hope the CSS Working Group will consider my suggestions.

Suggestions for the CSS Working Group

The community has been talking about some form of constants or variables in different incarnations for almost a decade, it is time to make this a reality. While it is possible to duplicate this functionality with a preprocessor (an excellent stop gap until browser support catches up), ultimately this is a tool which should live within the CSS itself. It is a powerful way of expressing more about the objects we are building.

The mixins and prototypes (and associated includes and extends properties) are designed to allow document authors to abstract reusable bits of code and better manage and maintain their style sheets. The goal is to mimic the effect of using multiple class names in the HTML without the drawbacks associated with current implementations. Authors need extends and include in order to write faster, smaller, more efficient style sheets.

CSS is a powerful expressive language. It needs certain modifications so that it will be robust, maintainable, and easy to implement.

From JSConf.eu

Overflow – a secret benefit

Thursday, July 23rd, 2009

Overflow does some cool things you should know about.

  • Creates Block Formatting Context
  • Clears Floats

Generating block formatting context

Arnaud Gueras called this “contexte de formattage” years ago, and I was kind of surprised when I moved back to the US how few developers here had heard of this “secret weapon”. When the overflow property is set, a new block formatting context is created. What does that mean? It changes the way the block interacts with floats. It no longer wraps around floats, but rather becomes narrower.

Sweet, so how can you use it?

A block with a new formatting context takes all the remaining space on a line, while leaving room for floats which have already been positioned. In my object-oriented CSS open source project I use the formatting context in two ways.

Main content column

Adding a formatting context means that my main column takes all the space that remains after my left and right columns have been rendered. This means having only one template because if you want to remove a column from the three column layout, you simply delete the column from the html. No changes to make anywhere else, CMS developers will love you for that.

Play with the template in Firebug.
  1. Try adding the class “liquid” to the “page” element.
  2. Add or remove one of the columns from the HTML.
  3. Extend one of the column objects with the additional classes listed in the documentation.
  4. Try changing the width of the column directly in Firebug.
Grids

Anyone who has developed a grids system knows the pain of sub-pixel rounding errors. Browsers don’t know what to do with 33.3 pixels, so they all do something different. The YUI grids system hid these differences in the gutters between the blocks, but we can also hide that difference inside the units themselves.

A new block formatting context can be used to make the last unit in any grids line absorb the tiny differences in size. Play with the grids, you’ll notice that as you modify the sizes of the units, the last unit grows and shrinks to accommodate the difference. It has no width, and yet, with a new block formatting context is also doesn’t wrap around floats.

CSS Summit – test cases for browser bugs

Saturday, July 18th, 2009

Speaking the CSS Summit today, I listened as people voiced concerns about browser support and bugs. It might surprise my fellow CSS developers, but many of the seasoned, bearded (ok, I’m making this part up) engineers working on the innards of browsers and rendering engines may not actually write much CSS themselves. They need our help.

We need to tell them what is broken, via good bug reports with steps to reproduce, version information, and relevant comments, screenshots and ideally test cases. Can you boil the bug down to the simplest possible version of itself? How little code do you need to trigger the rendering problem? That’s the test case you want to submit.

The Year of Business Metrics – Don’t make your users run away!

Friday, June 26th, 2009

A marked change has occurred since the first Velocity Conference a year ago, and while the effects are not yet obvious, they will be. The web is still slow, but we have something now, that we didn’t a year ago: business metrics. This was the year we quantified the impact of performance choices on our businesses, and the results were astounding.

For those of you who couldn’t attend, this article summarizes results from AOL, Shopzilla, Google, Bing, Hotmail, and Chrome and gives pointers to highlights of Velocity Conference 2009.

Reflows & Repaints: CSS Performance making your JavaScript slow?

Friday, March 27th, 2009

I’ve been tweeting and posting to delicious about reflows and repaints, and it seemed time for a blog post. Opera lists repaint and reflow as one of the three main contributors to sluggish JavaScript, so it definitely seems worth a look.

Reflows are very expensive in terms of performance, and is one of the main causes of slow DOM scripts, especially on devices with low processing power, such as phones. In many cases, they are equivalent to laying out the entire page again.

How to avoid reflows or at least minimize their impact on performance?

  1. Change classes on the element you wish to style (as low in the dom tree as possible)
  2. Avoid setting multiple inline styles
  3. Apply animations to elements that are position fixed or absolute
  4. Trade smoothness for speed
  5. Avoid tables for layout
  6. Avoid JavaScript expressions in the CSS (IE only)

Tools

A few tools have made waves lately. Stoyan Stefanov and I have been looking for decent ways to measure reflows and repaints and there are a few tools which show promise (despite being very early alpha).

Has anyone else seen any cool tools for evaluating reflows?

Object Oriented CSS video on YDN

Monday, March 23rd, 2009

Yahoo! Developer Network has released a video of my Object Oriented CSS talk at Web Directions North just in time for Ada Lovelace day. I’ve also been included in a feature on Women in Technology. I’m absolutely flattered to be included among these fantastic technical women. Wow.

Object Oriented CSS: for high performance websites and web applications.

Find out more about object oriented css

  1. Open source project on github (GIT is having some DNS issues, be patient)
  2. Follow along with the slides on slideshare
  3. Join the OOCSS google group

Object Oriented CSS, Grids on Github

Saturday, February 28th, 2009

My Object Oriented CSS grids and templates are open sourced on github. They have all the functionality of YUI grids plus some important features.

  • Only 4kb, half the size of YUI grids. (I was totally happy when I checked the final size!)
  • They allow infinite nesting and stacking.
  • The only change required to use any of the objects is to place it in the HTML, there are no changes to other places in the DOM and no location dependent styling. Eases back-end development and makes it a lot easier to manage for newbies.
  • Solution for sub-pixel rounding errors.

http://wiki.github.com/stubbornella/oocss

template.css and grids.css

…My prediction is that you’ll be writing complex layouts in less than 24 hours without adding a line to the CSS file.

CSS doesn’t suck, you’re just doing it wrong.

Thursday, February 12th, 2009

I will not say CSS sucks. I will admit my own discomfort with the problem space.

A bit of a rant

The cascade is something like a new data structure, and the ways for dealing with it are algorithms you never learned in school. You couldn’t have, because traditional engineering school poo-poos the front-end and web engineering in favor of stale (but still valuable) traditional software engineering.

Perhaps you realized this web thing wasn’t going away, so you learned a bit of javascript. That went OK, how hard is it to add another language to your repertoire? Now you just wish it would compile like a proper language. You hate the browsers, and (foolishly) wish there was only one. You find Ajaxian, and start thinking of yourself as super-engineer; the guy who can just as easily write a web UI as a cronjob to perform background data processing.

With the confidence of JavaScript success, you decide to tackle CSS, and then the problems begin. You start from scratch rather than using a library, because after all this is just a display syntax. (Do you also rewrite the math class every time you need a random number generated?) You don’t bother to learn proper semantic HTML, they must be joking! Nattering on about web standards and accessibility. It should be cake.

Nothing works as you expect it to. Your columns won’t line up. You never validated your HTML, and you have a sneaking suspicion that there is an unclosed tag somewhere. You can’t make even the simplest design look right, and you are pretty sure CSS is to blame, rather than your understanding of the technology. This should be just another acronym on your resume, right?

No. Resoundingly, no.

CSS can be predictable, scalable, modular and even object oriented. If it is written correctly, beginners can be productively participating in creating clean, reusable code in 2-3 weeks. But we need to change our approach, understand that the fundamental algorithms for a display language are different than a programing language, and yet borrow everything we can from software engineering, so that we don’t waste time reinventing the wheel.

Design Fast Websites – Don’t blame the rounded corners! on YUI Theater

Sunday, December 28th, 2008

Nicole at the Design Fast Websites Presentation by Eric Miraglia

I visited Yahoo! last week to record a talk I had given at the Front End Summit in October. If you are a designer or an F2E it is essential that you understand the ways in which design choices impact overall site performance. This talk establishes guidelines for High Performance Design including 9 Best Practices.

9 Best Practices

  1. Create a component library of smart objects.
  2. Use consistent semantic styles.
  3. Design modules to be transparent on the inside.
  4. Optimize images and sprites.
  5. Avoid non-standard browser fonts.
  6. Use columns rather than rows.
  7. Choose your bling carefully.
  8. Be flexible.
  9. Learn to love grids.

Web Directions North, Denver, February 2-7

I’ll be speaking more about Design and also CSS best practices at Web Directions North in February where I’ve been invited to give both a Performance Bootcamp Workshop and a CSS Performance for Websites and Web Apps Presentation. I look forward to seeing you there!

ParisWeb Performance Web Videos et slides disponible

Wednesday, December 3rd, 2008

80% des problèmes de performance Web se situe au niveau des échanges avec le navigateur et sur le navigateur lui-même : échanges réseau, rendu dans le navigateur, organisation des composants dans une page etc.

Nous aborderons les principales problématiques et les solutions à mettre en œuvre. Forts de l’expérience de l’équipe performance de Yahoo!, à la fin de cette session vous saurez aborder la question des performances Web du point de vue du visiteur et mettre en œuvre les actions correctrices sur vos sites Web.

Optimisation des Images : Les 7 erreurs à éviter at ParisWeb

Sunday, September 28th, 2008

Je vais parler (en francais! eek!) avec Eric Daspet de la performance des images pour le web a ParisWeb. Les inscriptions pour Paris Web 2008 sont officiellement ouvertes. Jusqu’au 15 octobre au soir, vous bénéficierez de tarifs réduits. Le conference sera lieu a Paris le 13-15 Novembre. J’attend vous voir bientot alors. ;)

Voila le proposition

Voulez-vous améliorer la vitesse de vos pages web et réduire l’impact écologique et monétaire de votre hébergement ? Voulez-vous faire ceci avec peu de changement de code et en gardant une belle interface graphique ? Cette session va vous apprendre les 7 étapes pour mettre votre site web au régime. Comment perdre des poids que votre site a pris en rajoutant les dernières nouveautés. Et, encore plus important, comment ne pas reprendre ce poids !

So you wanna be a web dev?

Friday, September 26th, 2008

The Web Standards Curriculum published by Opera is a great place to start. It will give you the basics of Front-end Engineering from the ground up. The second wave of articles was recently published including a background image and sprites how-to by yours truly.

Time to board a plane, so I can’t tell you more just now, but check it out. It is a great place to get started or brush up on your understanding of web standards.

iPhone, the morning after

Sunday, August 24th, 2008

My Treo stopped syncing in January and I immediately started missing all my meetings. I need the device to ring every few seconds to remind me to blink and breathe, so life without a properly synced agenda was awful — just ask my colleagues. Guppy brain.

A Palm user for the past eight years, I made the switch to an iPhone 3G a few weeks ago. I’ve had one palm or another since I was gifted an S300 and became (shockingly) a productive member of society. I vaguely want to give the iPhone a fair shot, aware that my bias toward familiarity is inevitable, however there are a few things about the iPhone that totally and completely suck.

Previous:

Next: