CSS for designers

Here’s a question for web designers. It’s a bit of a clich question and I’m not advocating it at all, I’m purely curious.

As a designer, do you think you would find CSS more intuitive if it had been XML based, rather than the syntax they did choose?

I ask because it’s on my mind and I’m curious (especially in light of Andy Clarke’s comment at @media about CSS not being as easy for designers as the programmers who invented it).

For example, rather than writing:

p {<br />  font-family: "Lucida Grande", sans-serif;<br />}
strong, em {<br /> color: green;<br />}

What if you could write:
<style><br /><applyto>p</applyto><br />  <font family="'Lucida Grande', sans-serif"><br /></style>
<style><br /> <applyto>strong<applyto><br /> <applyto>em</applyto><br /> <font color="green"><br /></style>

Of course, ‘applyto’ could be named ‘selector’, properties could all be standalone elements rather than the element/attribute I picked vaguely at random above. My question concerns whether you think you’d have found CSS easier to pick up and work with if you had a syntax which was ultimately beared more simility to HTML.

To re-emphasise, I’m not saying that CSS should change, or that the real CSS syntax is in any specific way inferior or anything controvertial like that. But if you could choose, which would you use? This is the kind of question that probably gets a certain type of person very upset, sorry about that.

Tagged

Posted in

5 Responses to “CSS for designers”

  1. Comment by http://www.ellythompson.co.uk/blog Elly

    June 22nd, 2005 at 7:29 am 2005-06-22UTC07:29:12+0000

    I think an xml based solution would be less intuitive, for the simple reason that you end up with a)more lines of code for any given rule and b)more characters in each rule which are pulely syntactic.

    I’m gonna go out on a limb here and say that it’s not CSS which is difficult to adapt to but code in general, and a way of thinking that facilitates coding.

  2. Comment by http://blog.fatbusinessman.com/ Fatty

    June 22nd, 2005 at 8:02 am 2005-06-22UTC08:02:02+0000

    I’m going to go with Elly in saying it would be less intuitive in XML, plus I’m going to add the reason that I can see much confusion arising when your content and your presentation description look very much the same (i.e. lots of angle-brackets everywhere).

  3. Comment by http://joshuaink.com John Oxton

    June 23rd, 2005 at 1:46 pm 2005-06-23UTC13:46:02+0000

    I dunno, I think it could all get quite confusing too, especially inline styles!

    This looks familiar too! ;-)

  4. Comment by http://holst.biz/ Jonathan Holst

    June 23rd, 2005 at 6:34 pm 2005-06-23UTC18:34:48+0000

    I think one of the easy things about learning (X)HTML and CSS, was that they differed. This might sound contradictory, but it helps in this whole “separation of mark-up and style”-thing.

    But at the moment, I’m not sure. I love the XML-format due to its simplicity, but I’m not sure if it would be easier/more intuitive to write my styles in it.

  5. Comment by http://ben-ward.co.uk Ben

    June 23rd, 2005 at 8:12 pm 2005-06-23UTC20:12:00+0000

    I’m going to chip in with broad agreement. I asked the question at a time that I didn’t really have an answer of my own, so it’s been interesting to have my response influenced by all of your before me.

    One thing first: ‘Addressing’ the question to designers might have seemed a tad exclusive or odd. The reason is because it is targeted at people who are, often, less techy (or at least the less techy sides of techy people). People who may be less likely to comfortably recognise ‘{’ from programming languages, for example. It wasn’t the best way to word it, really, but I hope you see why existing programmers are more likely to be comfortable with CSS’s braces and semi-colon filled.

    Anyway. Being a programmer and being perfectly comfortable with XML and CSS, I’m quite happy with the CSS syntax as it is. I very much agree with Jonathan, though. Whilst having different syntax is a very blunt way of emphasising a difference, XML-CSS would suffer from some fundamental confusion issues (if elements were named sensibly). Another <font> tag? Another

    I guess the answer was pretty obvious, but I was curious to see if anyone would say ‘yes’.

  • Links