Why is CSS so Weird?

How can we design for an unknown & infinite canvas?

CSS is the design language of the web – one of three core web languages – but it also seems to be the most contentious and often perplexing. It’s too easy and too hard, too fragile and too resilient. Love it or hate it, CSS is weird: not quite markup, not quite programming in the imperative sense, and nothing like the design programs we use for print. How did we get here?

View on Mozilla Developer »
CSS is for documents, and also for apps, on a universally accessible web.

This is a young platform, and all the core languages are growing fast, with CSS advancing leaps and bounds over the last few years, but there’s a real problem we can’t ignore – the web is display-agnostic:

This implies no device-specific markup, or anything which requires control over fonts or colors.

—The first website from CERN

Here we are, putting fonts and colors on the web. But it’s worth taking a step back and asking: what does it even mean to design on an unknown and infinite canvas? This problem isn’t new, it’s not going away, and there are no simple answers. Design on the web will always be weird – but CSS is a living document, and we have the power to keep making it better.

mozilla developer’ orgs

6 ‘mozilla developer’ episodes

2019

Inner & Outer Values of the Display Property @ Mozilla Developer [video]

The display property has been in CSS from the beginning, handling everything from block and inline boxes to list-items and full layout systems like flexbox or grid. Now the display syntax is getting an upgrade to match it’s multiple uses.

Why isn’t this CSS doing anything? @ Mozilla Developer [video]

There are a number of property & value combinations that can lead to CSS being inactive, and now Firefox will tell you why. Open the developer tools, and look for the greyed-out property with an info-box on hover.

Faster Layouts with CSS Grid @ Mozilla Developer [video]

CSS Grid has been available in most major browsers since early 2017, and it makes web layout more powerful than ever before. But complex-looking new syntax (line-names! grid-areas! minmax! fit-content! fr units!) and missing IE11 support can make it scary to many developers.

CSS Revert Video @ Mozilla Developer [video]

I’ve often used initial and unset in my CSS – global keywords that can be applied to any property. The difference is small, but important: unset allows inheritance, while initial does not. But then Firefox implemented revert and I was confused – how is this one different from the others?!

Videos, Articles, & Tools @ Mozilla Developer [video]

Over the summer, I’ve been working with Mozilla to help create a new resource for web professionals – with a mix of videos, articles, demos, and open source tools. Today, we’re excited to launch the video channel!