CSS features we'd love to see

Did you see http://hacks.mozilla.org/2009/10/font-control-for-designers/ ?

Ha, perfect idea :stuck_out_tongue:

Another (serious) one for the list though: Being able to use the counter value in calculations. Maybe you already can do this, I don’t know.

I know, I know, only the noobiest of noobs would be so ignorant as to even contemplate such an awful thing. But think about it-- background printing could still be off by default, and no honest dev would choose to turn it back on unless they had a legitimate reason (readability, for example). So what are we worried about, then? That dishonest web developers will purposely enable background printing just to waste the user’s expensive ink?

No way. My printer, my ink, my choice.

Besides, we know it’s not “only the noobiest of noobs”… look at how current web pages serve up 300k of Javascript for dropdown menus with some fading and a slideshow, how often you still see marquee tags, and everything else. No, I think a lot more than just evils and noobs would turn this on. The user is the one printing; it should be their option solely.

I don’t care about the whole ‘CSS isn’t supposed to be a programming language’ arguments, they hold no water with me, but in a lot of cases the CSS doesn’t lend too well to nesting.

Then, the biggest wish in the wishlist seems to be
CSS to become a programming language

It would automatically get most of these other things people are wishing for then.

I propose it be written in a form of LOLCODE.

Psuedo class “Current” for navigation :slight_smile:

transitions are really stretching the meaning of CSS. CSS was never a scripting language. It’s a declarative language.

CSS is crippled by the lack of these features

English is crippled by the lack of 50 different words for ‘snow’. I realise people will be forced to make jargon (which require jargon interpreters to be lugged around by dog-sled) to talk about 50 different kinds of snow when you are researching snow, but then it’s time to consider that maybe English isn’t the best language for this then.

(yes I’m aware the thing about “eskimo words” is actually a monkey sandwich/urban legend)

lesscss looks an awful lot like sass. Just as using jQuery to limit what you type doesn’t stop something from building and executing all those for loops and turning nodelists into arrays, programmatic CSS benefits the programmer but does not mean less work is being done by browsers (tho see below): the new outer layer needs to get translated into CSS and then fed to the browser.


@brand_color: #4D926F;

#header {
  color: @brand_color;
}

How many times does that get referenced, how much memory does that take up, is it slowing the browser down more than using * for example?

Just valid questions, not saying wrapping a programming language around your CSS is a bad thing but does it save the programmer and not the site? Though I can’t tell from the Less CSS site if it creates a longer, pure-CSS page and then sends that to the browser, or if it does something else.

Off Topic:

what is it with ruby sites and trebuchet ms??

*edit looking closer at it, I think I like less more than sass. They do say less is more. : )

I’d love centered floats and better typographic tools to adjust leading, kerning, etc.

No takebacks :stuck_out_tongue:

I change my answer

Parent selectors. I understand what Gary is saying but JS can do it, jQuery can automate it, XSLT / XPath can do it. The idea that CSS is incapable seems pretty sad to me.

conditionals and loops

better abstraction. you do too many damn things in CSS using properties whose name has nothing to do with why you’re using them. Side effects not uncommon in any language, but CSS seems to live for them.

I’v always though that some basic Javascript functions should be available as CSS.

Table row sorting - eg click TH cell to order child rows, possibly activated by :active
Basic show/hide - display hide a child element on click, :active again

count() (supported anyway)
parent selectors

float:center; (text wraps around both sides and top and bottom if necessary)

float:bottom;(floats to the bottom of the element exactly and text wraps above and to the side)

The ability to clear absolute elements and regain the flow.

Parent selector as already mentioned above would be good.

That’s behavior and I wouldn’t want behavior mixed in with CSS anyway.

My personal thing would have to be…oh gosh…I’ll have to come back to this. Too many choices :stuck_out_tongue:

I suppose as a temporary choice, I’d pick 3D effects :stuck_out_tongue:

I’ve thought of some new CSS features I’d love to see…

  1. A :tooltip pseudo to control the font, background, border (et al) of hover events (as the usual ones are so pesky small).
  2. A delay property in CSS so that events (such as :hover) or selectors (like :target) could have a timeframe before gaining or losing control.
  3. Nested selectors so we could combine stuff together like… a { :hover {} :visited {} }, would be a real gift in grouping code together.

Hey dude – there are a lot of TRANNIES here in Bangkok, but I’m not totally sure you’d wanna go back to them. Some of them pack more meat than a Burger King triple whopper.

But yeah, you’re basically right – that HTML5 form demo is awful!

Or you just have those of us who can’t grasp how other people can screw it up so badly given that said approaches are EASIER than the ‘sleaze it together any old way’ methodology that permeates many of the sites out there.

Though from your post I assume you missed the point of all those – being smaller code, less prone to breakage code, easier to maintain code, easier to build in the first place code, better use of caching models with better accessibility and no-brainer cross-browser support.

But then I think the W3C has lost sight of that too with HMTL5/CSS3. More you overwork the plumbing easier it is to stop up the drain.

Always.

That said, I think there will always be the masochists and hobbyists who get pleasure from setting floats and clearing floats and using negative margins and obsessing over haslayout issues and reviling those who use tables and being ultra concerned about semantic markup and believing with genuine sincerity that achieving valid code with a strict doctype is the ultimate nirvana.

How boring! I think I’ll go and get another beer.

Lawlz, I’m one of them, but I’ll share a beer with you! : )

“believing with genuine sincerity that achieving valid code with a strict doctype is the ultimate nirvana” I want this on a T-shirt. HAWK, you listening? : )

Aha - you never know what’s there until you complain that it isn’t!
Of course, a feature that isn’t supported by IE is not much use as a critical design tool, but it’s nice to know it does exist.

What I’d like to see is an ‘except’ option, so you could style all elements of a type except those with a particular class/ID, eg
td-.variable {color:red;} could give red text in all tables cells except <td class=“variable”>. Sometimes it isn’t as easy as you would like to just ‘undo’ a rule!