Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a way of testing CSS?
    primarykey
    data
    text
    <p>I know that this idea has come up before - notably <a href="https://stackoverflow.com/questions/342579/css-unit-testing">here</a> and <a href="https://stackoverflow.com/questions/5696739/tdd-testing-css-and-html">here</a> - but no solution seems to have been given. It was largely seen as either a 'nice-to-have-but-impossible' or 'stupid idea'.</p> <p>My thoughts were using jQuery to calculate computed values and compare them to expected values. For example, I could have <code>&lt;h1&gt;This is a header&lt;/h1&gt;</code> and in theory, I should know it's font-size, colour, font-weight, etc. I can use jQuery to check that it is actually that font-size, and if not, return an error.</p> <p>The advantage of this is that I don't have to sit with a checklist going through each browser - 'Is this header bold? Are these links underlined? Is this column 110px wide?' - every time I make a CSS change.</p> <p>My question - is that a feasible idea? What are the major problems in implementing something like that? Has anyone done something like that before?</p> <p>EDIT: Any thoughts on how to actual render the errors are welcome too. I thought of using a JavaScript file in the header of the relevant page and then adding content to the page, kind of like Firebug's on-page version. However, I'm worried that could then affect the rendering of the page. Alternatively, I could log it to the console, but I don't think IE6 has a proper console, and opening every console of every browser for every page-under-test seems a bit annoying as well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload