Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:CSS Coding Style

From MoodleDocs
Revision as of 20:12, 24 January 2013 by Amy Groshek (talk | contribs)

A few questions about these style guidelines, as they seem a bit outdated:

  1. Do we need to restrict color settings to only HEX? This probably made sense when there was only HEX & RGB, but we now have really cool stuff like HSLA which is supported in all the browsers we support except IE8. It's also very easy to provide fallback to HEX:

 .selector {
   background-color: #hex;
   background-color: hsla(170, 50%, 45%, 1);
 }

  1. For many properties, browser prefixes are no longer needed for our supported browsers. Shouldn't we be recommending that browser prefixes be added for supported browsers which need them, only? (Also, to make sure there is a background-color fallback for things like gradients?)
  2. What about !important being a bad thing? If you can't override existing rules without !important, that indicates that existing selectors are too aggressive (usually using IDs rather than classes and elements).
  3. How about we recommend OOCSS and where you can't use it request classes added to Moodle's markup so you can?