More Proper CSS



  • Hi, guys. Been out of touch for a while, so I figured I owe you a sidebar.

    I was on a #css support channel when someone popped in asking for a tool for "css refactoring". He asked a couple times in a couple ways, and like more bizzare IRC support questions, was ignored. But his tone had this certain air of desperation rather than incompetence, so I inquired what he actually needed to do. He said he needed to extract the computed style for every element on a page, and create a new stylesheet from it.

    Why? Well, his boss had declared that css class selectors were confusing. He couldn't tell how the HTML would look because it had no styles. So he had to redo his css: give EVERY element an ID, and put in a seperate style block for every ID.

    So rather than:

    .foo { background: yellow; }

    They wanted

    #foo1 {background: yellow;}
    #foo2 {background: yellow;}
    #foo3 {background: yellow;}

    And so forth.

     I wrote him up a quick piece of jquery that would do it... something like $(*).each(function() { foreach(styletags) { console.log($(this).css(styletag) } }... but suggested that the tool he was looking for was called a "Resume Builder"



  • @Lorne Kates said:

    I added a new foo to my page and it doesn't look right send me the stylez thx
    That's easy; just find an existing foo that has the right styles, and copy its ID. Job done. Yeah.



  •  HTML is confusing; I can't tell what the page will look like because of all the angle brackets.  So why don't you generate each page for me,store the resulting text, print it out, put it on a wooden table, and photograph it for me.  Oh, and programs are confusing too -- lots of loops and variables and things.  Just run the program, print the results, and email those to me too.

    Really, doesn't the guy understand the role of CSS?  To help separate the presentation from the data?  Seems to me like some education is in order.  "I don't tell you how to run the department, you don't tell me how to write the web pages" seems appropriate.  Maybe a trip to the CSS Zen Garden is in order.



  • @Lorne Kates said:

    Well, his boss had declared that css class selectors were confusing. He couldn't tell how the HTML would look because it had no styles.
     

    This has boggled my mind.  Who (apart from this guy's boss) tries to work out what the HTML and CSS will look like from the text file?



  • @Lorne Kates said:

    Why? Well, his boss had declared that css class selectors were confusing. He couldn't tell how the HTML would look because it had no styles.

     

    Sounds like someone needs to be introduced to the wonder that is firebug.

    Zad



  • @Zadkiel said:

    @Lorne Kates said:

    Why? Well, his boss had declared that css class selectors were confusing. He couldn't tell how the HTML would look because it had no styles.

     

    Sounds like someone needs to be introduced to the wonder that is firebug.

    Zad

     

    I'm not sure if the boss even knew what the Internet was, let alone a browser.



  • @Lorne Kates said:

    @Zadkiel said:

    @Lorne Kates said:

    Why? Well, his boss had declared that css class selectors were confusing. He couldn't tell how the HTML would look because it had no styles.

     

    Sounds like someone needs to be introduced to the wonder that is firebug.

     

    I'm not sure if the boss even knew what the Internet was, let alone a browser.

     

    I wonder if he complains that when you open .DOC files in Notepad, you can't tell what they'll look like in Word.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.