A class of its own

February 13th, 2009

Roger Johansson, author of the excellent 456 Berea Street blog, wrote a post about how classes in HTML and CSS are frequently called “CSS Classes“. I thought I’d reply, but Roger has the blog commenting turned off nowadays, so I do it here instead.

I think it’s really good that Roger points out that the class=”" attribute is not all about CSS. Using CSS classes is really convenient in Javascript, both to indicate elements that should be processed and to show states. It can even be used to carry data used by scripts. At least until we start using the data-* attribute in HTML 5.

But HTML/CSS classes is stillsomething wholly different from the classes used in many programming languages, inlcuding Javascript where it is a reserved keyword (Yet another reason why we see property/variable names like cssClass).

in the world of XML/HTML/CSS/JS/JSON, I think I prefer class attribute.

getComputedStyle() properties in Webkit

February 6th, 2009

The getComputedStyle() method is used when you want to get the style information of an HTML element. If you use the style property, you only get the inline style, but getComputedStyle() gives you what is set in the stylesheets. IE has an almost-similar property called currentStyle, and although they don’t work the same way they mostly give you cross-browser functionality.

In Safari and Chrome, getComputedStyle() has properties for each of the CSS props that getComputedStyle() in Webkit can extract. This makes it easy to loop these and see  these properties, which is useful since some of the CSS 2.1 stuff that Webkit supports in CSS is missing, like “content”. (This is reported as a bug in Webkit. Thanks to Mark Rowe for pointing this out).

The list contains some 50 “-webkit-” vendor specific properties and some SVG stuff.

The whole list is available at this page.

More bling at Tokyoflash

January 27th, 2009

I really like Tokyoflash. They sell unique wristwatches with lots of LEDs and bling (and sometimes dubious quality) that are real headturners. I got myself a golden Pimpin Aint Easy a few years ago and I’m thinking of buying the Denshoku.

What’s nice is that Tokyoflash has started selling other accessories and designware also, like wallets, clocks, USB drives etcetera. Be sure to check it.

If you’re a LED watch buff, Coolwatch might also interest you.

Ready, set, go

January 21st, 2009

After trying out Geeklog, which looked promising but had some annoying problems – the RSS feed path had some escaping issues so it didn’t work, and the config panel stopped working after I changed themes – so I gave the olde WordPress a go. Looks very promising.

I have started this blog to blow out steam regarding all sorts of things, but it will probably be mostly about web development like HTML, CSS and Javascript. And occasionly about design, music… silly stuff… ranting… I guess we’ll see.

Right now I am working on a JS app called Stylee that I’ll put up here soon. I will initially release it as a jQuery plugin but it might also be available as standalone JS in the future.