October 23rd, 2007 by Aaron N.
via ajaxian:
John Allsopp, who authored XRAY, has a new tool for us to play with. MRI is a bookmarklet that fires up a tool allowing you to query items on the page using CSS selectors. As you put in your queries you will see the items on the page that match. You can also click on areas of the page to show some selector queries that would find that area.

Posted in CSS, Tools | 1 Comment »
September 29th, 2006 by Aaron N.
via ajaxian:
People really are obsessed with rounded corners aren’t they? If we had a simple way to express them in CSS, maybe then we would be writting JS libraries and CSS hacks to give us spikey corners or something :)
Well, the latest kid on the block is Transcorners, which is a mootools based rounded corners system.
Posted in CSS, MooTools, Visual Effects | 2 Comments »
September 29th, 2006 by Aaron N.
via ajaxian:
CSS is pretty central to Ajax, and large Ajax projects often have a lot of CSS to deal with, so it’s worthwhile asking how to maintain all of it. Garrett Dimon’s Architecting CSS is a good set of advice for structuring your CSS files (from July, 2005; unearthed on Digg).
The article identifies three ways to organise your stylesheets:
- Archetype-Based A stylesheet for each class of page, e.g. homepage stylesheet, article stylesheet, etc.
- Page Element/Section-Based A stylesheet for each class of page section, e.g. header stylesheet, sidebar stylesheet.
- Tag-Based Similar to the previous approach, but based around tags, e.g. form stylesheet, table stylesheet.
Other topics include:
- Including stylesheets with @include
- Deciding how much to rely on selectors (Redundancy vs Dependency)
- Use of comments
- Use of !important
- Alphabetizing attributes to ensure you don’t forget any
Posted in CSS, Scriptactulous | Comments Off
August 24th, 2006 by Aaron N.
Brandon S. writes: The first release candidate of IE version 7 came out today…
And then on ajaxian:
The IE Team has posted more details on the IE7 CSS changes so we can all get prepared:
We are currently locking down IE7 for shipping and I wanted to give an update on the CSS work that went into IE7. Chris originally outlined our plans for IE7, and we listened to a lot of feedback (blog, connect database, conferences, our WASP partnership etc.) to help us address the most grievous bugs and prioritize which features to put in for IE7. I like to thank especially the contributors on this blog for their participation. Your feedback made a difference in deciding what issues to address.
We understand that we are far from being done and we know we have still a lot of work ahead of us. IE 7 is a stepping stone in our effort to improve our standards compliance (especially around CSS). As an example, in the platform we did not focus on any proprietary properties – though we may try out new features in the future using the official ms- prefix, following the CSS extension mechanism. We also work very closely with the W3C CSS working group (which I am a member of) to help clarify assumptions in our implementation and drive clarifications into the spec. I really like to thank everyone who helped us here.
In all, we made over 200 behavior changes (bug fixes or new features) under strict mode to improve CSS2.1 compliance. All this work (with the exception of transparent PNGs) has been done under the switch only, since all changes required behavioral updates to be more in line what the CSS spec specifies. To preserve application compatibility we will not make any behavioral changes to ‘quirks mode’ as it has been established since IE6.
Read about the many changes that have been made.
Posted in Browser Bugs, CSS | Comments Off
July 27th, 2006 by Aaron N.
I just happened upon event:Selectors. It’s very similar to Behaviour.js (the author’s spelling, not mine) in most respects, though its much smaller (72 lines / ~2k) and has some nice added functionality using Prototype shortcuts (Behaviour is stand-alone and duplicates a lot of Prototype stuff and is, therefore, larger).
Basic usage:
var Rules = {
'#icons a:mouseover': function(element) {
var app = element.id;
new Effect.BlindDown(app + '-content', {queue: 'end', duration: 0.2});
},
'#icons a:mouseout': function(element) {
var app = element.id;
new Effect.BlindUp(app + '-content', {queue: 'end', duration: 0.2});
}
}
Now, this alone is nice, but nothing exceptional. You could do the same thing with prototype thusly:
Event.observe(window,"load",function() {
$$('#icons a').each(function(tag) {
Event.observe(tag,'mouseover', function() {
var app = tag.id;
new Effect....
});
});
});
Ok, so it’s definitely longer to do without it, but not terribly so. But what really gets me excited is this:
'#footer:loaded': function(element) {
element.setStyle({backgroundColor: '#ccc'});
}
This will apply the code to the element once it’s loaded. That’s just awesome. That’s just awesome times five. Wait, it gets better: it will also apply all your rules to your Ajax responses, too (if you want it to). This means when you bring in a chunk of html into the DOM you don’t have to set up all your events on it again.
It has a few other nice touches (you can, for instance, apply these events to more than one selector, for instance). Check it out.
Posted in 3rd Party Libraries, CSS, Event Scripting, Organizing Code, Prototype | Comments Off
July 21st, 2006 by Aaron N.
via ajaxian:
Rafael Lima took inspiration from 37 Signals browser selector idea and created it. “It” being a JS library that allows you to create browser specific CSS to be merged into your normal classes.
Example
You can prefix browser specific elements (available codes: ie, gecko, opera, konqueror, safari) and the library will make sure that the correct items are added in for a particular browser.
This can be considered cleaner than some of the really ugly hacks that you normally face.
HTML:
-
-
-
.ie .example {
-
background-color: yellow
-
}
-
.gecko .example {
-
background-color: gray
-
}
-
.opera .example {
-
background-color: green
-
}
-
.konqueror .example {
-
background-color: blue
-
}
-
.safari .example {
-
background-color: black
-
}
-
.example {
-
width: 100px;
-
height: 100px;
-
}
-
-
CSS Browser Selector
Posted in 3rd Party Libraries, CSS | Comments Off