
The maiden with the seagull.
The maiden with the seagull.
Went to church to see @LowTheBand.
❤️🎶
London is safe under the watchful gaze of Cider.
Dim sum. 🥟
Salads and bread.
We were discussing the CSS3 grid layout module in the Clearleft office today, so naturally Rachel’s name came up. This is such a great resource for diving into this stuff.
Jake demonstrates his technique for preprocessor-generated stylesheets for older versions of Internet Explorer (while other browsers get the same styles within media queries).
A look at the new pseudo-classes in CSS3 that go hand-in-hand with the form enhancements introduced in HTML5.
A detailed overview by Filament Group on progressively enhancing navigation for responsive sites.
A really handy test site from Lea that reports your browser’s recognition of CSS properties.
This looks like a handy resource with a shitty, shitty name. Count the number of items that are in HTML (or JavaScript or APIs). Now count the number of items that are in CSS.
Richard starts diving into some the nifty ligatures that are becoming available to us in OpenType fonts with CSS3.
This is really handy: a bookmarklet that will disable any CSS3 on a page so you can check that your fallbacks look okay.
By far the most common use of media queries is to execute CSS based on viewport width (using min-width
or max-width
). Lately there’s been more talk about using media queries based on height as well.
Paul talked about using min-height
media queries to adjust content appearing above the fold
. Owen Gregory wrote his superb 24 Ways article on using viewport proportions and device-aspect-ratio
for media queries. Trent has documented his use of horizontal and vertical media queries to bump up the font size for wide and tall viewports.
One of the areas where I’ve found height-based media queries to be quite handy is in combination with another CSS3 module: multiple columns.
Splitting text over multiple columns is not something to be done lightly on a screen-based display. If the columns drop below the viewport then the user has to scroll down, scroll back up, scroll down again …you get the picture. It works fine in print but it’s not something that should be attempted on the web unless the entire text is visible at one time.
Well, with media queries we can get a pretty good idea of whether the text will fit on the viewport …assuming we know the length of the text.
Here’s an example (thanks to Space Ipsum for supplying the text). It splits the text into two columns if the viewport has enough width and height:
@media all and (min-width: 40em) and (min-height: 36em) {
[role="main"] {
column-count: 2;
column-gap: 2em;
}
}
If the viewport is wider still, the text can be split over three columns. In this case, the test for height can actually smaller because the text is spreading over a wider area, meaning the overall height of the text is shorter:
@media all and (min-width: 65em) and (min-height: 25em) {
[role="main"] {
column-count: 3;
column-gap: 2em;
}
}
The actual CSS is more verbose than that: vendor prefixes are still required. You can grab the example from Github if you want to have a play around with it.
Stephen gives an excellent run-down of flexbox and how you can use it today.
Joni points out a great advantage to the mobile-first approach if you choose not to polyfill for legacy versions of IE: you can go crazy with all sorts of CSS3 goodies in the stylesheet you pull in with media queries.
Most of these are pretty over the top but they’re good proofs of concept.
Here’s a geek advent calendar I missed. There are some great CSS techniques here.
An in-depth look at browser polyfills: what they are, how they work, and how you can make your own.
If you use Sass, this could be a really handy technique for handling IE<9 support with mobile-first responsive designs.