Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37679

CSS coding style for add-ons?

$
0
0
by Joseph Rézeau.  

Not sure whether this goes into the General developer or the Themes forum, so putting it here for the moment.

I am currently revising the Questionnaire stylesheet and cannot find a reference to recommendations for CSS in the Moodle Coding style docs. If it exists, please someone point me to it. In the meantime, here are a few questions...

  1. When should the "full" location/scope of a CSS rule be used? And what should that "full" scope look like?
    1. #page-mod-questionnaire-questions div.qcontainer div.qnums
    2. or .qcontainer .qnums is enough?
  2. When to specify table, div, etc.?
    1. div.qcontainer div.qnums
    2. or .qcontainer .qnums is enough?
  3. When and why to use "path" as in .path-mod-quiz .qnbutton ? It seems that, in the case of quiz, for intance, that "path" is only used by themes which want to override the default rule.
  4. Should an extra "rtl" rule be added each time we have a text-align or float rule (any other?), as e.g.
    1. .path-mod-quiz .qnbutton {float: left;}
    2. .path-mod-quiz.dir-rtl  .qnbutton {float: right;}

Anything else I should consider?

Thanks!

Joseph


Viewing all articles
Browse latest Browse all 37679

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>