desideratum

Month

July 2012

1 post

Death to the Bottom Line

Some creative nth-child()-ing. In a table-esque inline-block list, it will remove the extra line that results from needing both container and list item borders.

Why might this be useful?

  • Rounded corners on container: setting a negative margin on list items in the top/bottom row leave the corners misaligned.
  • Pixel perfection: using a negative margin on either the top/bottom borders of the list items sometimes shaves off a pixel, resulting in slight vertical-misalignments.

For this example, I’ll be using a 3-column layout using only inline-block list items. The three selectors used in combination to select the bottom row in all permutations are:

For this example, I’ll be using a 3-column layout using only inline-block list items. The three selectors used in combination to select the bottom row in all permutations are:

There’s a pattern/strategy here. Let x be the total number of columns. All we have to do is figure out how to select each list item when it’s on the bottom row, and deselect it when it’s not. Let’s try this with four columns:

  1. Select the last item, regardless of its position.

    li:last-child

  2. Select the next to last child, except when it’s in the rightmost column (where it’s not touching the bottom).

    li:nth-last-child(2):not(:nth-child(xn))

  3. Select the third to last child, except when it’s in the two rightmost columns.

    li:nth-last-child(3):not(:nth-child(xn)):not(:nth-child(xn-1))

  4. Select the fourth to last child, except when it’s in any column but the leftmost one.

    li:nth-last-child(4):not(:nth-child(xn)):not(:nth-child(xn-1)):not(:nth-child(xn-2))

For additional columns, add another selector incrementing the nth-last-child() parameter, and add another :not(:nth-child(xn-?)), incrementing the ?.

Questions? Find me on Twitter and ask away! Or just view some working code on Dabblet.

Jul 26, 20122 notes
#front-end #selectors #css

June 2012

3 posts

Play
1:31
Jun 21, 2012115,512 notes
#chrome #ad #coffee
Jun 5, 201221,370 notes
Play
Jun 5, 20121 note
#dreams #space

March 2012

1 post

DirecTV WTF
  • Ren: [the tv's] fixed, but here were all the problems:
  • Ren: 1) the first dish got filled to capacity, so they put up a 2nd dish and moved some of the connections to it (including ours)
  • Ren: 2) the guy who put up the second dish used four way splitters for all the cables going to the units when they didn't need to be split
  • Ren: 3) whoever did our original install also gave us a four way splitter inside our apartment, AND connected the wrong kind of cable ending to it (we only needed a two way splitter, one per receiver)
  • Ren: 4) the software update directv did made the receivers way better at detecting issues, which is why all this stuff didn't get found before
  • Keith: ho
  • Keith: ly
  • Keith: crap
Mar 1, 20122 notes
#directv #cable

February 2012

1 post

Feb 7, 201232 notes
#social #donuts

January 2012

6 posts

Play
Jan 31, 20123 notes
#brands #logos
“If I had only one hour to save the world, I would spend fifty-five minutes defining the problem, and only five minutes finding the solution.” —Albert Einstein
Jan 26, 20122 notes
A Clean, Minimal Bing

Google’s Search+ and GKBO antics have really rubbed me the wrong way over the last couple of days. So in retaliation, I’ve switched my default search engine to Bing.

It hasn’t been a frictionless switch. The quality of image results for certain search terms is mediocre. The results pages are cluttered, squished and chock full of distractions. To help the transition along, I made some tweaks to the design and encapsulated them in a user style. Most of the changes should be fairly obvious, but if you’re interested in a full changelog, I’d be happy to put one up.

To be honest, the exercise was more challenging than I expected:

Can’t stand cluttered Bing search. And after hacking away at it with Stylish, I can’t really stand the circa-2001 source code either. #fb

— Keith Chu (@Catharsis)

January 14, 2012


The code and coding sensibilities were remarkably dated. For example, the wonky tab around the current center nav item was using sliding doors, combined with corner images. Pipes inserted with markup or borders. Deep, deep classitis with redundant IDs for good measure. Random markup choices. Yuck.

Anyway, this user style was created to scratch a personal itch, but hopefully you’ll find it just as useful. If you have any questions/suggestions, feel free to get in touch with me on Twitter and let me know.


Download: [User Style] Bing - Clean, Minimal (userstyles.org)

Jan 14, 20124 notes
#user styles #css #bing
Play
Jan 11, 20125 notes
#humor #satire
Play
Jan 7, 20124 notes
#wow #video
Play
Jan 4, 201217 notes
#cornell #memories

December 2011

6 posts

Dec 14, 20111 note
Dec 13, 20118 notes
#aea
Play
Dec 11, 20114 notes
#music #christmas #animation
Dec 9, 20115 notes
#bart #cartography #sf
Play
Dec 9, 2011
#stop motion #video
Dec 2, 20111 note
#food

November 2011

6 posts

Nov 18, 2011
#logos
Adobe kills off (mobile) Flash → blogs.adobe.com

(Source: shirt.woot)

The writing was on the wall long before Adobe shifted its interactive focus to HTML5/CSS3, offering up resources like Wallaby, Edge, the expressive web and so on. Steve Jobs was prescient—and perhaps instrumental in helping Adobe realign themselves—in offering his insight into the problem:

Flash was created during the PC era – for PCs and mice. Flash is a successful business for Adobe, and we can understand why they want to push it beyond PCs. But the mobile era is about low power devices, touch interfaces and open web standards – all areas where Flash falls short. […]

New open standards created in the mobile era, such as HTML5, will win on mobile devices (and PCs too). Perhaps Adobe should focus more on creating great HTML5 tools for the future, and less on criticizing Apple for leaving the past behind.

Browser plugins like Flash became widespread because there were no native alternatives. Prior to HTML5 video and recent advancements in CSS and JS, if you wanted to put a movie or interactive elements on your webpage, you had to use Flash. And in doing so, you generally had to compromise by tolerating a shorter battery life, a louder GPU fan, a slower computer, a hotter-to-the-touch laptop, and stuttering video. Having gone Flash-free for almost a year now, I can say you only notice how much better things are after you’ve gone cold-turkey.

On mobile, this suboptimal performance is unacceptable; but shouldn’t it be the same for desktop? To this end, Marco Arment posits:

If web developers must make non-Flash implementations of everything, why bother making the Flash versions at all? This isn’t just the death of mobile Flash: it’s a confirmation from Adobe that all Flash is on its way out.

I’d like to hone in on this observation by making one of my own: in hindsight, embedding Flash into a webpage has always been kind of awkward. Here’s some sample code from a Flash embed, with added bolding around the most relevant bits:

<object class codebase="http://download.macromedia.com /pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="400" height="300" align=""> <param name="movie" value="movie.swf"> <embed src="movie.swf" quality="high" width="400" height="300" name="movie" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </object>

Including spaces, that’s 441 characters used when only 34 (the bolded characters) are necessary. It’s verbose, hard to remember, and inelegant. Looking at some HTML5 equivalents, this shortcoming becomes clearer:

1<embed src="movie.swf" /> 2<video src="movie.mp4" /> 3<video> <source src="movie.mp4" /> <source src="movie.webm" /> </video>

My point is that implementing Flash feels complicated and unnatural. It’s unfortunate that developers have had to live with it for years. Thankfully, embracing HTML5 presents the perfect opportunity to leave it all behind.

Nov 10, 20115 notes
#adobe #flash #mobile
Next page →
2011 2012
  • January 6
  • February 1
  • March 1
  • April
  • May
  • June 3
  • July 1
  • August
  • September
  • October
  • November
  • December
2010 2011 2012
  • January
  • February 3
  • March 5
  • April 6
  • May 4
  • June 2
  • July 1
  • August 9
  • September 1
  • October 4
  • November 6
  • December 6
2009 2010 2011
  • January 198
  • February 87
  • March 162
  • April 113
  • May 77
  • June 64
  • July 55
  • August 23
  • September 61
  • October 42
  • November 15
  • December 14
2008 2009 2010
  • January
  • February
  • March
  • April
  • May 66
  • June 148
  • July 164
  • August 143
  • September 114
  • October 15
  • November 103
  • December 193
2007 2008 2009
  • January 51
  • February 51
  • March 28
  • April 6
  • May 3
  • June 3
  • July 12
  • August 3
  • September
  • October 4
  • November
  • December
2007 2008
  • January
  • February
  • March 9
  • April 12
  • May 6
  • June 3
  • July 8
  • August 8
  • September 13
  • October 49
  • November 86
  • December 43