Saturday, January 12, 2008

Visual Studio 2008 CSS Support - Not Quite

One of the often-touted new features of VS 2008 is the improved CSS support.

I like having intellisense for CSS, sure, but I dont’ want to have a warning for classes that don’t exist…. like this:

Vs2008-css-warning

That green squiggly indicates a compiler warning.  It can’t find the CSS class, (which is referenced in the Master Page). 

But there are other reasons why you might want to define a class without defining an associated style.  You might be using it to distinctly select elements from the DOM using javascript. 

The ever-so-awesome prototype framework introduced this syntax:

$$(‘.info’)

which would select all of the elements with a class name of “info” for you to work with.

Just about every other javascript library out there now supports this syntax (or a similar one).

If this bugs you, you can turn it off by checking this box (in Tools -> Options) :

Vs2008-turn-off-html-errors

You may not want to do this, though…  it could potentially save you time if you’re looking for a rendering bug.

Another part of VS 2008 that I don’t really care about is this CSS designer.  I can’t imagine anyone who would actually use this.

I mean, come on… look at it!

Vs2008-css-builder

I guess if you don’t know CSS very well, you might want some options.  But that form is more confusing to me than border-top: solid 1px #999;.

(and one could argue, if you don’t know CSS, should you be defining styles at all?)

I really applaud Microsoft’s attempt to bring a better CSS development experience to the masses, but I think they missed the mark on this one.

Saturday, January 12, 2008 6:34:36 PM (Central Standard Time, UTC-06:00)
Another waste are any WYSIWYG editors. I don't remember the last time I looked at the designer. Firefox and IE are my designers, and if I have to pop open the design view to make sense of my web page, my HTML probably sucks.
Saturday, January 12, 2008 8:03:57 PM (Central Standard Time, UTC-06:00)
Both the post and comment by Bogard are well stated. If I could add to this, I would like for to see actual shades of colors when coding css, not the name ("Red") of a color that has been hard-coded to a pre-defined shade. As a hybrid ASP.NET/ColdFusion developer, I like using Dreamweaver and being able to pick a shade from the intellisense pop-up or simply keying the value directly. Of course I can key the value in VS, but their is no need for the color names.
Sunday, January 13, 2008 6:33:31 PM (Central Standard Time, UTC-06:00)
Nitpick: I like the CSS dialog box, and have used it in the past (shameful to admit: recently) to help learn CSS specifics. This is one of those "learnability vs. usability" trade-offs we hear about so often, and it's clear this dialog leans heavily towards learnability.
Comments are closed.
Personal Loans - Loans - Debt Consolidation - Debt