- The Kooks: Have A Kook At This PLAYLOUDER — "I mean no one gives a fuck if spotty [Weekly UK Music Publication] readers think they don’t write their own songs but it’s important we keep a bit of serious artist credibility round them."
Tagged as: kooks music business funny true sad for:vincennes
- Creating prototypes with OmniGraffle | urlgreyhot — Clickable Omnigraffle prototypes which export to clickable PDFs. Very nice; makes me want a new version of Omnigraffle to replace my copy of 2.0…
Tagged as: omnigraffle interaction design ia prototyping screencast tutorial
Handling IE specific stylesheets with a Rails plugin
10 December 2006
Time to announce my first published Rails plugin: ie-specific. And, more importantly, time to explain it.
I work as a front-end developer for a large scientific publishing firm. We’re very much committed to standards compliance and accessibility, as such, make every effort to ensure our sites work in as many browsers as possible. And that includes Internet Explorer 5.
Now, prior to IE7, we did this (by and large) by producing standards-compliant stylesheets, and then adding browser hacks where they were the only solution, in order to achieve consistent look/feel in many browsers. Fast forward to IE7, and we’ve now got a problem: many browser hacks (notably * html
) no longer work in IE7 and yet it still has its own raft of styling quirks.
So we’ve decided to change the way we implement browser-hacking. On the project I’m currently working on, we now have a main.css
which contains all the standards-compliant, “correct” CSS. We then place the IE-specific styles inside IE conditional comments. Each browser version gets a css file of its own where necessary, named for the name of the relevant IE conditional filter – eg, lte-ie-6.css
, ie-6.css
, lte-ie-5.500
, etcetera.
When I started work on the front-end integration for this Rails project, it was clear that this was obviously something that could be automated in Ruby – and, given that we were probably going to use it again, it made sense to package it as a plugin so that the next time I came to need it for a project, a quick script/install
would be enough.
Enter ie-specific, currently hosted at Google Code given that a) it’s open-source and b) it’s an easy way to get anonymous public svn.
It’s really simple. First, install the plugin:
script/plugin install http://ie-specific-rails-plugin.googlecode.com/svn/ie-specific
Now, place any IE-specific stylesheets into #{RAILS_ROOT}/public/stylesheets/ie_specific
, named with the appropriate conditional filter (eg: lte-ie-6.css
). Similarly, you can place IE-specific javascript into #{RAILS_ROOT}/public/javascripts/ie_specific
. We use IE-specific Javascript to simulate min/max-width capabilities in Internet Explorer.
Finally, in the <head> of your layout, include the following ERb:
<%= ie_specific_styles_and_scripts %>
Each file in the ie_specific
directories will be automatically included inside appropriate conditional comments – CSS files will be imported via an @import
directive, and JS files will be appropriately escaped as CDATA
(important for us, because we write XHTML 1.0 strict). There’s no unnecessary duplication, either – lte-ie-6.css
and lte-ie-6.js
will automatically be placed inside the same conditional comment.
That’s it, really – it’s very simple, but it’s also a convenient way to keep markup and styles clean and let other developers know exactly what’s a hack and what’s not. For more info, check out the README. And let me know what you think!
- Rough Type: Nicholas Carr’s Blog: Avatars consume as much electricity as Brazilians — Crazy. And, of course, raises the point that online worlds could be impacting on the real world via environmental damage and power consumption…
Tagged as: community online secondlife environment technology climatechange - "Readings for Practicing Photographers" — Mike Johnston, from the Online Photographer, draws up a list of books with notes for practicing photographers. Looks fantastic.
Tagged as: photography books list art
- [d20: The 60’s] The KKK, free thinkers, and the unwashed masses – RPGnet Forums — Awesome – players decided to take d20 (D&D) entirely metaphorically, and use it to play out 60s social archetypes. To quote further down the thread: "you’ve made D&D… narrativist". Great stuff.
Tagged as: rpg roleplaying social play games activism metaphor storytelling narrative for:vincennes for:blackbeltjones - I’m in ur X, Y-ing ur Z — Roughly where it all began, for reference…
Tagged as: humour silly kittens
- EE versus CS — Entertaining parable of the ways computer scientists and electrical engineers differ.
Tagged as: engineering programming computerscience humour for:vincennes
- Displaying a content_for inplace — A nice trick for wrangling content_for, something I’m doing a lot of at work at the moment.
Tagged as: rails tips rubyonrails templating views blocks - Metacrap — "Putting the torch to seven straw-men of the meta-utopia", by Cory Doctorow
Tagged as: metadata ia tagging folksonomy design
- YouTube – i’m blogging — I WANT YOU ON THE PHONE BUT I ALSO WANT YOU BLOGGING
Tagged as: blogs blogging humour video funny - Life With Alacrity: The Dunbar Number as a Limit to Group Sizes — A perceptive and detailed analysis of the Dunbar Number – and why some of the hype around it is misguided.
Tagged as: society social software anthropology dunbar structure groups research sociology network
- BLDGBLOG: War/Photography: An Interview with Simon Norfolk — "Cologne was built by Charlemagne – but Cologne has the shape that it does today because of the abilities and non-abilities of a Lancaster Bomber." Phenomenal interview. Worth savouring every word.
Tagged as: for:vincennes for:blackbeltjones architecture photography society art war cities planning - Caterina Fake – .net magazine — Surprisingly good (for .net) interview with Caterina Fake. “The most difficult part is not the technology but actually getting the people to behave well.