an ordinary blog — andr3.net

rss feed

my lifestream rss feed

pages

HTML5 - A nova era da Web

(another post that should be in Portuguese. Sorry about that)

Here are the slides I made for the presentation I was asked to give at ISEL Tech 2010 last tuesday.

If you're wondering why there's very little reference to browser support, it's because the support now will make little difference on the big scheme of things. Things are evolving so rapidly, with more and more features being supported in the modern browsers at each release (you know, Firefox, Safari and Opera).

Any questions or remarks, leave 'em in the comments, please. They're very welcomed.

Slides for: HTML5 - A nova era da web

(in portuguese)

Preview of the slides
Check out the slides on slideshare.
or if you prefer Download the pdf (28MB).

Speaking about HTML5 at ISEL

It's no secret I'm keeping an eye out for all developments on the HTML5 front, for a good while now. Thus, it was with humility and appreciation that I accepted the invitation to talk at ISEL Tech '10 on that very same topic, HTML5.

The session—entitled HTML5 so far—will cover why we need a new language in the first place, what the spec entails and when can we start using parts of the spec. It's scheduled for next tuesday, May 25th at 5pm. It's going to be in Portuguese, which makes me feel odd writing this in English! note to self: you need a new blog in Portuguese!.

So, if you have any doubts, questions or simply pure skepticism about HTML5... drop by! We'll have a nice chat and feel free to put me on the spot with tough questions. ;)

Download to your Calendar, visit the Facebook page of the event or check the schedule.

Now I think I should get back to Keynote.app! ;)

See you there!

Sideproject: iGIVE

And here we are.

2009 is slowly crawling to its ultimate demise.

SAPO Codebits has, once again, rocked the geek calendar.

Christmas and the new year are just around the corner...

So what better time than now to launch a new project? ;)

Yes, that's right. During 2009, I was invited to join susy to help her with the challenge of making the dream of iGIVE come to life.

She presented her idea back in SAPO Codebits 2008 even though an idea was all she had at the time. Billy jumped aboard initially but then had a child, so priorities changed a bit for him. She asked me if I was available and the idea quickly won me over.

Thus, over the course of 2009 iGIVE become more than just an idea. With the support of SAPO, it became a tangible project!

So, what is iGIVE?

Well, if you have something cluttering your home, it's probably because you don't need it. But someone might.

That's the goal of iGIVE. It enables people to say what they have to give and what they are looking for. This way, you can find someone who will find a better use for your ___________ (fill in blank) other than collecting dust!

The website is entirely in Portuguese and geographically focused in Portugal. Here, have a looksie!


my profile at iGIVE
check out my profile or see a bigger screenshot


We have great plans for the website and the community. We really want to make a difference and help people help other people. :)

If you have any feedback, do send it our way. You can use the GetSatisfaction page we setup or e-mail me directly.

The boring technical bits

On the backend, it uses the typical Linux, Apache, PHP, MySQL combination. Memcached for cache and a homegrown CMS.

On the frontend, the HTML5 doctype (nothing fancy though), CSS (including CSS3 smartass-eries) and not an ounce of javascript. For now. ;)

The design was entirely Susana's work. Kudos to her! I merely helped with the rest.
Am particularly proud of the progressively-enhanced <button>s.

A lot more to come

Even though we're not completely dedicated to the website (we still have day jobs), we are wholeheartedly committed to the project and will are already enhancing the website and contacting people that can help us prove that the web and computers can actually bring us closer to each other.

Hope to have your help along the way.

Clever lists with CSS3 selectors

Last week, a guy from work who can afford to only support webkit browsers—hey Luis, I'm looking at you!—, had hit kind of a brick wall and was asking for help on the company design mailing list... my spidey sense kicked in. I hope this doesn't sound too cocky, but I love the smell of a challenge in the morning.

The problem

He wanted to have the <li>s from an <ul> to occupy the entire width regardless of how many they were. If there was only one list item, it would have a width of 100%. Two would have 50% each and three of them, 33.33%.

Also, he wanted to accomplish this using CSS only, without having to figure out the number either using javascript or a server-side language and apply a class accordingly (a natural and understandable cop-out if you have to support all browsers). But this is 2009 and he was looking at webkit. There has to be a way, I thought.

So after scratching my head for a bit, I put together a test page and started throwing selectors together and attempting to figure it out.

The Solution

With the pseudo-class :nth-child you can easily select elements based on their position in the list of children. This allows you to select one element at a time.

But you need an extra something to take into account how many siblings it has. That was the whole point.

In comes :nth-last-child. The difference between the two is that nth-child applies to the nth child counting from the top (ie, the child that has n-1 elements before it) while the nth-last-child applies to the nth child counting from the bottom (ie, the child that has n-1 elements after it!).

That said, we could use both of this pseudo-classes together to create sets of rules that would only apply when there are one, two or three items in the list!


A screenshot of the solution


Code

Here's the code.

/* one item */
li:nth-child(1):nth-last-child(1) {
width: 100%;
}

/* two items */
li:nth-child(1):nth-last-child(2),
li:nth-child(2):nth-last-child(1) {
width: 50%;
}

/* three items */
li:nth-child(1):nth-last-child(3),
li:nth-child(2):nth-last-child(2),
li:nth-child(3):nth-last-child(1) {
width: 33.3333%;
}


I wish I could find one rule that would automatically figure out the width regardless of the number, instead of enumerating them all. Or even find an expression of the type an+b that would collapse all those selectors into one... But for now, this'll do.

You can test it if you have either Safari or Firefox 3.5 (beta) on this demo page.

Why am I telling you this?

What made CSS2 so successful or powerful wasn't just what was written in the spec. It was also the myriad of articles that popped up all over the web that showed how to combine little aspects of the spec to amount to pretty amazing things.

In conclusion, the sliding doors, the faux columns or the running with sprites articles of CSS3 are still waiting to be written.

So, what are you waiting for? Push the envelope and try to discover new ways of using the properties, selectors and media queries to achieve something otherwise impossible.

Just let us know when you do.

SAPO Sessions #2: Javascript Done Right (video)

As some of you might have heard already, SAPO is doing a series of talks on interesting subjects and have dubbed such events as SAPO Sessions. As part of my newly acquired job functions, I gave a talk a few weeks ago entitled Javascript Done Right. Although the title is a bit cocky, I did try to share a few concepts that, if taken seriously, can make the web a little better for all of us, the users.

I talked about progressive enhancement [alistapart.com] and how writing unobtrusive javascript can help you enhance your websites without creating barriers for your users, in terms of both usability and acessibility.

If the previous paragraph spiked your interest, then go ahead and watch the video. I do apologize for sounding so arrogant at times, but I hope you bear with me 'til the end.

I know I should have written this post in Portuguese, but I'm not mixing up languages until I have setup a proper language filter on the blog. Either that or a separate blog written in Portuguese... Anyway, moving on.


Video

Slides


If you have any questions, suggestions or criticism, don't hesitate to send them my way either on the comments, via email or twitter.

↑ top