<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aegroshek</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aegroshek"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Aegroshek"/>
	<updated>2026-10-06T07:25:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Git_for_developers&amp;diff=53381</id>
		<title>Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Git_for_developers&amp;diff=53381"/>
		<updated>2017-11-20T18:52:40Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Keeping your public repository up-to-date */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== General workflow ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A reasonable knowledge of the Git basics is a good idea before you start to use it for development. If you are new to Git, you are encouraged to go to &#039;See also&#039; for some more general reading.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:git-pushpull-model.png|right|thumb|400px|Moodle development workflow with Git]]&lt;br /&gt;
Detailed explanation of the workflow can be found in the [[Process]] page. In short, the Moodle development with Git looks like this:&lt;br /&gt;
&lt;br /&gt;
* You as the contributor commit changes into your personal repository at your computer&lt;br /&gt;
* You push the changes into your public repository and publish links to your changes in the Moodle Tracker&lt;br /&gt;
* You request a peer review of your code from another developer&lt;br /&gt;
* When peer reviewer is happy they submit issue for integration&lt;br /&gt;
* Moodle integrators pull the changes from your public repository and if they like them, they put them into Moodle integration repository&lt;br /&gt;
* The integrated change is tested and finally pushed into Moodle production repository&lt;br /&gt;
* You update your local repository with all changes from the production repository and the next cycle may start again&lt;br /&gt;
&lt;br /&gt;
This workflow runs in roughly weekly cycles. The integration happens on Monday and Tuesday and the testing on Wednesday. On Thursday (or Friday if testing takes too long), the production repository moodle.git is usually updated with changes from the last development week.&lt;br /&gt;
&lt;br /&gt;
Most Moodle developers have their public repositories hosted at [http://github.com/ Github]. Alternatively you may want to try [http://gitorious.org Gitorious] or the legendary [http://repo.or.cz repo.or.cz]. In the examples in this guide we assume you&#039;ll set up your public repository at Github.&lt;br /&gt;
&lt;br /&gt;
When you first register on tracker you can not assign issues to yourself or send them for peer review. You will be added to the developers group after your first bug fix is integrated. Before that just comment on the issue with a link to your branch and component lead or another developer will send issue for peer review for you.&lt;br /&gt;
&lt;br /&gt;
== Installing Git on your computer ==&lt;br /&gt;
&lt;br /&gt;
Install Git on your computer. Most Linux distributions have Git available as a package to install. On Debian/Ubuntu, type &#039;&#039;&#039;&#039;sudo apt-get install git&#039;&#039;&#039;&#039; on the terminal. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in a few clicks. &lt;br /&gt;
&lt;br /&gt;
Immediately after the installation, set your name and contact e-mail. The name and e-mail will become part of your commits and they can&#039;t be changed later once your commits are accepted into the Moodle code. Therefore we ask contributors to use their real names written in capital letters, eg &amp;quot;John Smith&amp;quot; and not &amp;quot;john smith&amp;quot; or even &amp;quot;john5677&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
    git config --global user.email yourmail@domain.tld&lt;br /&gt;
&lt;br /&gt;
Unless you are the repository maintainer, it is wise to set your Git to not push changes in file permissions:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.filemode false&lt;br /&gt;
&lt;br /&gt;
Also, it&#039;s recommended to verify that the your git installation is not performing any transformation between LFs and CRLFs. All Moodle &#039;&#039;&#039;uses only LFs&#039;&#039;&#039; and you should &#039;&#039;&#039;fetch/edit and push&#039;&#039;&#039; it that way (may need to configure your editor/IDE too). Note that having any &amp;quot;magic&amp;quot; enabled is known to cause [[Common unit test problems#The_test_file_.22evolution.test.22_should_not_contain_section_named_.22.5Blots_of_content.5D.22|problems with unit tests]] execution. So we recommend you to set:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.autocrlf false&lt;br /&gt;
&lt;br /&gt;
== Setting-up the public repository ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [http://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [http://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own Github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Now you need to set up your SSH public key, so you can push to your Github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Setting-up the local repository at your computer  ==&lt;br /&gt;
&lt;br /&gt;
Create a local clone repository of your Github repository. In a terminal:&lt;br /&gt;
&lt;br /&gt;
    git clone git://github.com/YOUR_GITHUB_USERNAME/moodle.git LOCALDIR&lt;br /&gt;
&lt;br /&gt;
    (or:  git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git LOCALDIR)&lt;br /&gt;
&lt;br /&gt;
This command does several jobs for you. It creates a new folder, initializes an empty Git repository in it, sets your Github repository as the remote repository called &#039;origin&#039; and makes a local checkout of the branch &#039;master&#039; from it. The important point to remember now is that your Github repository is aliased as &#039;origin&#039; for your local clone.&lt;br /&gt;
&lt;br /&gt;
Note that the format of the URL here is important. In the first example, the URL starts &amp;quot;git://github.com&amp;quot; and this will give read-only access to the repository at github.com. If you use this URL, the &amp;quot;git push origin&amp;quot; command that appears later in this document will not work. Therefore, if you want to be able to update the &amp;quot;origin&amp;quot; repository, you should use the URL that starts &amp;quot;git@github.com&amp;quot;, i.e. the second of the two &amp;quot;git clone&amp;quot; commands given above. This will give you read and write access to the repository on github.com.&lt;br /&gt;
&lt;br /&gt;
== Keeping your public repository up-to-date ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-sync-github.png|right|thumb|400px|Fetching changes from upstream and pushing them to github]]&lt;br /&gt;
Your fork at Github is not updated automatically. To keep it synced with the upstream Moodle repository, you have to fetch the recent changes from the official moodle.git and push them to your public repository. To avoid problems with this it is strongly recommended that you never modify the standard Moodle branches. &#039;&#039;Remember: never commit directly into master and MOODLE_xx_STABLE branches.&#039;&#039; In other words, always create topic branches to work on. In Gitspeak, the master branch and MOODLE_xx_STABLE branches should be always fast-forwardable.&lt;br /&gt;
&lt;br /&gt;
To keep your public repository up-to-date, we will register remote repository git://git.moodle.org/moodle.git under &#039;upstream&#039; alias. Then we create a script to be run regularly that fetches changes from the upstream repository and pushes them to your public repository. Note that this procedure will not affect your local working directory.&lt;br /&gt;
&lt;br /&gt;
To register the upstream remote:&lt;br /&gt;
&lt;br /&gt;
    cd moodle&lt;br /&gt;
    git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
&lt;br /&gt;
The following commands can be used to keep the standard Moodle branches at your Github repository synced with the upstream repository. You may wish to store them in a script so that you can run it every week after the upstream repository is updated.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    for BRANCH in MOODLE_{19..34}_STABLE master; do&lt;br /&gt;
        git push origin refs/remotes/upstream/$BRANCH:refs/heads/$BRANCH&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
&lt;br /&gt;
The git-fetch command does not modify your current working dir (your checkout). It just downloads all recent changes from a remote repository and stores them into so called remote-tracking branches. The git-push command takes these remote-tracking branches from upstream and pushes them to Github under the same name. Understanding this fully requires a bit knowledge of Git internals - see gitrevisions(7) man page.&lt;br /&gt;
&lt;br /&gt;
Note there is no need to switch the local branch during this. You can even execute this via cron at your machine. Just note that the upstream repository updates typically just once a week.&lt;br /&gt;
&lt;br /&gt;
=== New branches ===&lt;br /&gt;
&lt;br /&gt;
Occasionally, moodle.org will create a new branch that does not exist in your public (e.g. Github.com) repository. If you try to push this new branch, you will see an error such as the following:&lt;br /&gt;
&lt;br /&gt;
    error: unable to push to unqualified destination: MOODLE_99_STABLE&lt;br /&gt;
    The destination refspec neither matches an existing ref on the remote&lt;br /&gt;
    nor begins with refs/, and we are unable to guess a prefix based on the source ref.&lt;br /&gt;
    error: failed to push some refs to &#039;git@github.com:YOUR_GITHUB_USERNAME/moodle.git&#039;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;quot;MOODLE_99_STABLE&amp;quot;, is the name of the new branch that does not exist in your public repository. To fix the error, you need to create the new branch on your public repository, using the following commands, replacing &amp;quot;MOODLE_99_STABLE&amp;quot; with the name of the new branch you wish to create:&lt;br /&gt;
&lt;br /&gt;
    git checkout MOODLE_99_STABLE&lt;br /&gt;
    git push origin MOODLE_99_STABLE:MOODLE_99_STABLE&lt;br /&gt;
&lt;br /&gt;
The above code will create a new copy of the &amp;quot;MOODLE_99_STABLE&amp;quot; branch in your local repository. If you do not need to keep a local copy of the new branch - and probably you do not need it, you then can remove it from your local repository as follows:&lt;br /&gt;
&lt;br /&gt;
    git checkout master&lt;br /&gt;
    git branch -D MOODLE_99_STABLE&lt;br /&gt;
&lt;br /&gt;
== Preparing a patch ==&lt;br /&gt;
&lt;br /&gt;
As said earlier at this page, you never work on standard Moodle branches directly. Every time you are going to edit something, switch to a local branch. Fork the local branch off the standard branch you think it should be merged to. So if you are working on a patch for 1.9 or 2.0, fork the branch off MOODLE_19_STABLE or MOODLE_20_STABLE, respectively. Patches for the next [[Moodle versions|major version]] should be based on the master branch.&lt;br /&gt;
&lt;br /&gt;
    git checkout -b MDL-xxxxx-short-description-of-the-bug origin/master&lt;br /&gt;
&lt;br /&gt;
Note that if you forget to specify the starting point, the branch is based on the currently checked-out branch. It may not be what you want. It is recommended to always specify the starting point.&lt;br /&gt;
&lt;br /&gt;
To check the current branch, run&lt;br /&gt;
&lt;br /&gt;
    git branch&lt;br /&gt;
&lt;br /&gt;
The current branch is highlighted.&lt;br /&gt;
&lt;br /&gt;
Now go and fix the issue with your favorite IDE. Check the status of the files, view the change to be committed and finally commit the change:&lt;br /&gt;
&lt;br /&gt;
    vim filename.php&lt;br /&gt;
    git status&lt;br /&gt;
    git diff&lt;br /&gt;
    git commit -a&lt;br /&gt;
&lt;br /&gt;
For the commit message, please do respect the guidelines given on in the article [[Coding style#Git_commits|Coding_style]].&lt;br /&gt;
&lt;br /&gt;
Note that this is safe as the commit is recorded just locally, nothing is sent to any server yet (as it would in CVS). To see history of the commits, use&lt;br /&gt;
&lt;br /&gt;
    git log&lt;br /&gt;
&lt;br /&gt;
Once your local branch contains the change (note that it may consists of several patches) and you are happy with it, publish the branch at your public repository:&lt;br /&gt;
&lt;br /&gt;
    git push origin MDL-xxxxx-short-description-of-the-bug&lt;br /&gt;
&lt;br /&gt;
Now as your branch is published, you can ask Moodle core developers to review it and eventually integrate it into the standard Moodle repository.&lt;br /&gt;
&lt;br /&gt;
=== Changing commit message, reordering and squashing commits ===&lt;br /&gt;
&lt;br /&gt;
It often happens that you made a mistake in your patch or in the commit message and helpful CiBot pointed it out for you. You can &amp;quot;rewrite the history&amp;quot; and change the existing commits.&lt;br /&gt;
&lt;br /&gt;
Option 1. Reset all the changes in the branch and commit again. &lt;br /&gt;
&lt;br /&gt;
    git reset --mixed origin/master&lt;br /&gt;
&lt;br /&gt;
Now all your changes are still present but all commits on top of &amp;quot;master&amp;quot; branch are gone. You can create a new commit&lt;br /&gt;
&lt;br /&gt;
Option 2. Discover &#039;&#039;&#039;git rebase --interactive&#039;&#039;&#039; - this is a powerful tool to change the sequence of commit, change the commit messages, squash commits, etc. We will not cover it here, there are many articles in the Internet about it, for example: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History.&lt;br /&gt;
&lt;br /&gt;
Whatever option you chose, you have &amp;quot;rewritten the history&amp;quot; and you can not simply push the changes to github again because they would need to overwrite the commits that were already pushed. If you try &amp;quot;git push MDL-xxxxx-short-description-of-the-bug&amp;quot; you will get an error message suggesting you to force push. &lt;br /&gt;
To force push the changed commits use:&lt;br /&gt;
&lt;br /&gt;
    git push -f origin MDL-xxxxx-short-description-of-the-bug&lt;br /&gt;
&lt;br /&gt;
If an error occurs because you are still using the git protocol (read only), use this command : &lt;br /&gt;
&lt;br /&gt;
    git remote set-url origin https://github.com/&amp;lt;user.name&amp;gt;/moodle.git&lt;br /&gt;
&lt;br /&gt;
A prompt will ask for your credentials, if you previously setup your SSH public key you can also use this one : &lt;br /&gt;
&lt;br /&gt;
    git remote set-url origin git@github.com:&amp;lt;user.name&amp;gt;/moodle.git&lt;br /&gt;
&lt;br /&gt;
=== Checking if a branch has already been merged ===&lt;br /&gt;
&lt;br /&gt;
After some time contributing to Moodle you would have a lot of branches both in your local repository and in your public repository. To prune their list and delete those that were accepted by upstream, use the following&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream                                      (1)&lt;br /&gt;
    git branch --merged upstream/master                     (2)&lt;br /&gt;
    git branch --merged upstream/MOODLE_20_STABLE           (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) fetches the changes from your upstream repository at git.moodle.org (remember that git-fetch does not modify your working dir so it is safe to run it whenever). Command (2) and (3) print all branches that are merged into the upstream master branch and MOODLE_20_STABLE branch, respectively. To delete these local branches, use&lt;br /&gt;
&lt;br /&gt;
    git branch -d MDL-xxxxx-accepted-branch&lt;br /&gt;
&lt;br /&gt;
The similar approach can be used to check the branches published at your origin repository at github.com&lt;br /&gt;
&lt;br /&gt;
    git fetch origin                                        (1)&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    git branch -r --merged upstream/master                  (2)&lt;br /&gt;
    git branch -r --merged upstream/MOODLE_20_STABLE        (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) makes sure that you have all your branches from github.com recorded as the remote tracking branch locally. Commands (2) and (3) work the same as in the previous example but they list remote tracking branches only ([http://www.kernel.org/pub/software/scm/git/docs/git-branch.html see -r param]). To delete a branch at github.com, use&lt;br /&gt;
&lt;br /&gt;
    git push origin :MDL-xxxx-branch-to-delete&lt;br /&gt;
&lt;br /&gt;
This syntax may look weird to you. However it is pretty logical. The general syntax of the git-push command is&lt;br /&gt;
&lt;br /&gt;
    git push &amp;lt;repository&amp;gt; &amp;lt;source ref&amp;gt;:&amp;lt;target ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so deleting a remote branch can be understood as pushing an &amp;quot;empty (null) reference&amp;quot; to it.&lt;br /&gt;
&lt;br /&gt;
== Peer-reviewing someone else&#039;s code ==&lt;br /&gt;
&lt;br /&gt;
To review a branch that someone else pushed into their public repository, you do not need to register a new remote (unless you work with such repository frequently, of course). Let us imagine your friend Alice pushed a work-in-progress branch called &#039;wip-feature&#039; into her Github repository and asked you to review it. You need to know the read-only address of the repository and the name of the branch.&lt;br /&gt;
&lt;br /&gt;
    git fetch git://github.com/alice/moodle.git wip-feature&lt;br /&gt;
&lt;br /&gt;
This will download all required data and will keep the pointer to the tip of the wip-feature branch in a local symbolic reference FETCH_HEAD. To see what&#039;s there on that branch, use&lt;br /&gt;
&lt;br /&gt;
    git log -p FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see how a particular file looks at Alice&#039;s branch&lt;br /&gt;
&lt;br /&gt;
    git show FETCH_HEAD:admin/blocks.php&lt;br /&gt;
&lt;br /&gt;
To create a new local branch called &#039;alice-wip-feature&#039; containing the work by Alice, use&lt;br /&gt;
&lt;br /&gt;
    git checkout -b alice-wip-feature FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To merge Alice&#039;s work into your current branch:&lt;br /&gt;
&lt;br /&gt;
    git merge FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see what would be merged into the current branch without actually modifying anything:&lt;br /&gt;
&lt;br /&gt;
    git diff ...FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
Once you are all set and reviewing code, this [[Peer_reviewing_checklist|checklist]] should prove to be useful.&lt;br /&gt;
&lt;br /&gt;
== Rebasing a branch ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is a process when you cut off the branch from its current start point and transplant it to another point. Let us assume the following history exists:&lt;br /&gt;
&lt;br /&gt;
          A---B---C topic&lt;br /&gt;
         /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
From this point, the result of the command:&lt;br /&gt;
&lt;br /&gt;
    git rebase master topic&lt;br /&gt;
&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
                  A&#039;--B&#039;--C&#039; topic&lt;br /&gt;
                 /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
and would end with &#039;topic&#039; being your current branch.&lt;br /&gt;
&lt;br /&gt;
You may be asked to rebase your branch submitted for the integration if the submitted branch was based on an outdated commit. The typical case is if you create a new branch as a fork off the upstream master branch on Tuesday. Then on Wednesday, the upstream master branch grows as all changes from the last integration cycle are merged to it. To make diff easy on Github for next weekly pull request review, you want to rebase your branch against the updated master.&lt;br /&gt;
&lt;br /&gt;
    git rebase master MDL-xxxxx-topic-branch&lt;br /&gt;
&lt;br /&gt;
Note that rebasing effectively rewrites the history of the branch. &#039;&#039;&#039;Do not rebase the branch if there is a chance that somebody has already forked it and based their own branch on it.&#039;&#039;&#039; For this reason, many Git tutorials discourage from rebasing any branch that has been published. However in Moodle, all branches submitted for integration are potential subject of rebase (even though we try to not to do it often) and you should not base your own branches on them.&lt;br /&gt;
&lt;br /&gt;
=== Conflicts during rebase ===&lt;br /&gt;
&lt;br /&gt;
During the rebase procedure, conflicts may appear. git-status commands reports the conflicted files. Explore them carefully and fix them in your editor (like you would do with CVS). Then add the files with &#039;git add&#039; command and continue.&lt;br /&gt;
&lt;br /&gt;
    vim conflicted.php&lt;br /&gt;
    git add conflicted.php&lt;br /&gt;
    git rebase --continue&lt;br /&gt;
&lt;br /&gt;
== Applying changes from one branch to another ==&lt;br /&gt;
&lt;br /&gt;
Most bugs are fixed at a stable branch (like MOODLE_20_STABLE) and the fix must be prepared for other branches, too (like MOODLE_21_STABLE and the main development branch - master). In Moodle, we do not merge stable branches into the master one. So usually the contributor prepares at least two branches - with the fix for the stable branch(es) and with the fix for the master branch.&lt;br /&gt;
&lt;br /&gt;
If you have a patch prepared on a local branch (let us say MDL-xxxx-topic_20_STABLE), it is possible to re-apply it to another branch.&lt;br /&gt;
&lt;br /&gt;
=== Cherry-picking a single commit ===&lt;br /&gt;
&lt;br /&gt;
Let us have two local Git repositories ~/public_html/moodle21 containing local installation of Moodle 2.1 and ~/public_html/moodledev with the local installation of most recent development version of Moodle. They both use your public repository at github.com as the origin. You have a branch in moodle21 called MDL-xxxx-topic_21_STABLE that was forked off MOODLE_21_STABLE. It contains one commit. Now you want to re-apply this commit to a branch MDL-xxxx-topic in moodledev.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodledev&lt;br /&gt;
    git checkout -b MDL-xxxx-topic origin/master            (1)&lt;br /&gt;
    git fetch ../moodle21 MDL-xxxx-topic_21_STABLE          (2)&lt;br /&gt;
    git cherry-pick FETCH_HEAD                              (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) creates new local branch forked off the master. The command (2) fetches all data needed to re-apply the topic branch and stores the pointer to the tip of that branch to FETCH_HEAD symbolic reference. The command (3) picks the tip of the branch (the top-most commit on it) and tries to apply it on the current branch.&lt;br /&gt;
There is also a variant of the cherry-pick command that supports multiple commits, shortly (see its man page for details): &amp;lt;code bash&amp;gt;$ git cherry-pick A^..B&amp;lt;/code&amp;gt; if you want to include from A - see &#039;&#039;&#039;^&#039;&#039;&#039; - to B, A should be older than B. We will use another approach for cherry-picking multiple commits.&lt;br /&gt;
&lt;br /&gt;
=== Applying a set of patches ===&lt;br /&gt;
&lt;br /&gt;
If the branch MDL-xxxx-topic_21_STABLE from the previous example consists of several commits, it may be easier to use git-format-patch and git-am combo to re-apply the whole set of patches (aka patchset). Firstly you will export all commits from the topic branch to files.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodle21&lt;br /&gt;
    mkdir .patches&lt;br /&gt;
    git format-patch -o .patches MOODLE_21_STABLE..MDL-xxxx-topic_21_STABLE         (1)&lt;br /&gt;
&lt;br /&gt;
The command (1) takes all commits from the topic branch that are not in MOODLE_21_STABLE and exports them one by one to the output directory .patches. Look at the generated files. They contain the patch itself (in diff format) and additional information about the commit. You could eg send these files by email to a friend of yours for peer-review. We will use them in another repository.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodledev&lt;br /&gt;
    git checkout -b MDL-xxxx-topic origin/master&lt;br /&gt;
    git am -3 ../moodle21/.patches/*                        (1)&lt;br /&gt;
&lt;br /&gt;
The command (1) applies all the files from the .patches directory. When a patch does not apply cleanly, the command tries fall back on 3-way merge (see the -3 parameter). If conflicts occur during the procedure, you can either deal with them and then use `git am --continue` or abort the whole procedure with `git am --abort`.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
; Moodle forum discussions&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=168094 GIT help needed]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=165236 Best way to manage CONTRIB code with GIT]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=167063 Handy Git tip for tracking 3rd-party modules and plugins]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=167730 Moodle Git repositories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=183409 Git help!! I don&#039;t understand rebase enough...]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=217617 add MOODLE_24_STABLE to github.com repository]&lt;br /&gt;
&lt;br /&gt;
; External resources &lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
* [http://vimeo.com/14629850 Getting git by Scott Chacon] - an recording of an excellent 1-hour presentation that introducing git, including a simple introduction to what is going on under the hood.&lt;br /&gt;
* [http://tjhunt.blogspot.co.uk/2012/03/fixing-bug-in-moodle-core-mechanics.html Tim Hunt&#039;s blog: Fixing a bug in Moodle core: the mechanics]&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;br /&gt;
&lt;br /&gt;
[[ja:開発者用Git]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Javascript_Modules&amp;diff=50626</id>
		<title>Javascript Modules</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Javascript_Modules&amp;diff=50626"/>
		<updated>2016-07-15T14:31:56Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.9}}&lt;br /&gt;
&lt;br /&gt;
= Javascript Modules =&lt;br /&gt;
&lt;br /&gt;
== What is a Javascript module and why do I care? ==&lt;br /&gt;
&lt;br /&gt;
A Javascript module is nothing more than a collection of Javascript code that can be used (reliably) from other pieces of Javascript. &lt;br /&gt;
&lt;br /&gt;
== Why should I package my code as a module? ==&lt;br /&gt;
&lt;br /&gt;
By packaging your code as a module you break your code up into smaller reusable pieces. This is good because:&lt;br /&gt;
&lt;br /&gt;
a) Each smaller piece is simpler to understand / debug&lt;br /&gt;
&lt;br /&gt;
b) Each smaller piece is simpler to test&lt;br /&gt;
&lt;br /&gt;
c) You can re-use common code instead of duplicating it&lt;br /&gt;
&lt;br /&gt;
= How do I write a Javascript module in Moodle? =&lt;br /&gt;
&lt;br /&gt;
Since version 2.9, Moodle supports Javascript modules written using the Asynchronous Module Definition ([https://github.com/amdjs/amdjs-api/wiki/AMD AMD]) API. This is a standard API for creating Javascript modules and you will find many useful third party libraries that are already using this format. &lt;br /&gt;
&lt;br /&gt;
To edit or create an AMD module in Moodle you need to do a couple of things. &lt;br /&gt;
&lt;br /&gt;
== Install grunt ==&lt;br /&gt;
&lt;br /&gt;
The AMD modules in Moodle must be processed by some build tools before they will be visible to your web browser. We use &amp;quot;[http://gruntjs.com/ grunt]&amp;quot; as a build tool to wrap our different processes. Grunt is a build tool written in Javascript that runs in the &amp;quot;[http://nodejs.org/ nodejs]&amp;quot; environment.&lt;br /&gt;
&lt;br /&gt;
This means you first have to &#039;&#039;&#039;install nodejs&#039;&#039;&#039; - and its package manager [https://www.npmjs.com/ npm]. The details of how to install those packages will vary by operating system, but on Linux it&#039;s probably similar to &amp;quot;sudo apt-get install nodejs npm&amp;quot;. There are downloadable packages for other operating systems here: http://nodejs.org/download/. Moodle currently requires node &amp;quot;v4&amp;quot; and does not work with the latest node &amp;quot;v6&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Once this is done, you can &#039;&#039;&#039;run the command&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 npm install&lt;br /&gt;
 npm install -g grunt-cli&lt;br /&gt;
&lt;br /&gt;
from the top of the Moodle directory to install all of the required tools. (You may need extra permissions to use the -g option.)&lt;br /&gt;
&lt;br /&gt;
== Running grunt ==&lt;br /&gt;
&lt;br /&gt;
See [[Grunt#Running_grunt]] for more details of specific grunt commands which can be used.&lt;br /&gt;
&lt;br /&gt;
If you get the error message&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/env: node: No such file or directory&lt;br /&gt;
&lt;br /&gt;
Then see the thread https://github.com/nodejs/node-v0.x-archive/issues/3911&lt;br /&gt;
&lt;br /&gt;
On Ubuntu 14.04 this fixed it for me:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -fs /usr/bin/nodejs /usr/local/bin/node&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Hello World&amp;quot; I am a Javascript Module ==&lt;br /&gt;
Lets now create a simple Javascript module so we can see how to lay things out. &lt;br /&gt;
&lt;br /&gt;
Each Javascript module is contained in a single source file in the &amp;lt;componentdir&amp;gt;/amd/src folder. The final name of the module is taken from the file name and the component name. E.g. block_overview/amd/src/helloworld.js would be a module named &amp;quot;block_overview/helloworld&amp;quot;. the name of the module is important when you want to call it from somewhere else in the code. &lt;br /&gt;
&lt;br /&gt;
After running grunt - the minified Javascript files are stored in the &amp;lt;componentdir&amp;gt;/amd/build folder. The javascript files are renamed to show that they are minified (helloworld.js becomes helloworld.min.js). &lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to add the built files (the ones in amd/build) to your git commits, or in production no-one will see your changes. &lt;br /&gt;
&lt;br /&gt;
Lets create a simple module now:&lt;br /&gt;
&lt;br /&gt;
blocks/overview/amd/src/helloworld.js&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
// Standard license block omitted.&lt;br /&gt;
/*&lt;br /&gt;
 * @package    block_overview&lt;br /&gt;
 * @copyright  2015 Someone cool&lt;br /&gt;
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 /**&lt;br /&gt;
  * @module block_overview/helloworld&lt;br /&gt;
  */&lt;br /&gt;
define([&#039;jquery&#039;], function($) {&lt;br /&gt;
&lt;br /&gt;
     /** &lt;br /&gt;
      * Give me blue.&lt;br /&gt;
      * @access private&lt;br /&gt;
      * @return {string}&lt;br /&gt;
      */&lt;br /&gt;
     var makeItBlue = function() {&lt;br /&gt;
          // We can use our jquery dependency here.&lt;br /&gt;
          return $(&#039;.blue&#039;).show();&lt;br /&gt;
     };&lt;br /&gt;
      &lt;br /&gt;
    /**&lt;br /&gt;
     * @constructor&lt;br /&gt;
     * @alias module:block_overview/helloworld&lt;br /&gt;
     */&lt;br /&gt;
    var greeting = function() {&lt;br /&gt;
        /** @access private */&lt;br /&gt;
        var privateThoughts = &#039;I like the colour blue&#039;;&lt;br /&gt;
        &lt;br /&gt;
        /** @access public */&lt;br /&gt;
        this.publicThoughts = &#039;I like the colour orange&#039;;&lt;br /&gt;
&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * A formal greeting.&lt;br /&gt;
     * @access public&lt;br /&gt;
     * @return {string}&lt;br /&gt;
     */&lt;br /&gt;
    greeting.prototype.formal = function() {&lt;br /&gt;
        return &#039;How do you do?&#039;;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * An informal greeting.&lt;br /&gt;
     * @access public&lt;br /&gt;
     * @return {string}&lt;br /&gt;
     */&lt;br /&gt;
    greeting.prototype.informal = function() {&lt;br /&gt;
        return &#039;Wassup!&#039;;&lt;br /&gt;
    };&lt;br /&gt;
    return greeting;&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most interesting line above is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
define([&#039;jquery&#039;], function($) {&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All AMD modules must call &amp;quot;define()&amp;quot; as the first and only global scoped piece of code. This ensures the javascript code contains no global variables and will not conflict with any other loaded module. The name of the module does not need to be specified because it is determined from the filename and component (but it can be listed in a comment for JSDoc as shown here). &lt;br /&gt;
&lt;br /&gt;
The first argument to &amp;quot;define&amp;quot; is the list of dependencies for the module. This argument must be passed as an array, even if there is only one. In this example &amp;quot;jquery&amp;quot; is a dependency. &amp;quot;jquery&amp;quot; is shipped as a core module is available to all AMD modules. &lt;br /&gt;
&lt;br /&gt;
The second argument to &amp;quot;define&amp;quot; is the function that defines the module. This function will receive as arguments, each of the requested dependencies in the same order they were requested. In this example we receive JQuery as an argument and we name the variable &amp;quot;$&amp;quot; (it&#039;s a JQuery thing). We can then access JQuery normally through the $ variable which is in scope for any code in our module. &lt;br /&gt;
&lt;br /&gt;
The rest of the code in this example is a standard way to define a Javascript module with public/private variables and methods. There are many ways to do this, this is only one.&lt;br /&gt;
&lt;br /&gt;
It is important that we are returning &#039;greeting&#039;. If there is no return then your module will be declared as undefined.&lt;br /&gt;
&lt;br /&gt;
== Loading modules dynamically ==&lt;br /&gt;
What do you do if you don&#039;t know in advance which modules will be required? Stuffing all possible required modules in the define call is one solution, but it&#039;s ugly and it only works for code that is in an AMD module (what about inline code in the page?). AMD lets you load a dependency any time you like. &lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Load a new dependency.&lt;br /&gt;
require([&#039;mod_wiki/timer&#039;], function(timer) {&lt;br /&gt;
   // timer is available to do my bidding.&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Including an external javascript/jquery library ==&lt;br /&gt;
If you want to include a javascript / jquery library downloaded from the internet you can do so as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning: if the library you download, supports AMD but is already &amp;quot;named&amp;quot; you will not be able to include it directly&#039;&#039;&#039;&lt;br /&gt;
e.g. &lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
        define(&amp;quot;typeahead.js&amp;quot;, *[ &amp;quot;jquery&amp;quot; ], function(a0) {&lt;br /&gt;
            return factory(a0);&lt;br /&gt;
        });&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
will not work, as moodle injects it&#039;s own define name when loading the library.&lt;br /&gt;
&lt;br /&gt;
If the library is in AMD format and has a define:&lt;br /&gt;
e.g. i want to include the jquery final countdown timer on my page ( hilios.github.io/jQuery.countdown/ )&lt;br /&gt;
* download the module in both normal and minified versions&lt;br /&gt;
* place the modules in your moodle install e.g. your custom theme dir, or plugin dir&lt;br /&gt;
* /theme/mytheme/amd/src/jquery.countdown.js&lt;br /&gt;
&lt;br /&gt;
you can now include the module and initialise it (there are multiple ways to do this)&lt;br /&gt;
php:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// 1. Create your own amd module and initialise it:&lt;br /&gt;
$this-&amp;gt;page-&amp;gt;requires-&amp;gt;js_call_amd(&#039;theme_mytheme/countdowntimer&#039;, &#039;initialise&#039;, $params);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
javascript:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
//1. put this code in theme/mytheme/amd/src/countdowntimer.js&lt;br /&gt;
define([&#039;jquery&#039;, &#039;theme_mytheme/jquery.countdown&#039;], function($, c) {&lt;br /&gt;
    return {&lt;br /&gt;
        initialise: function ($params) {&lt;br /&gt;
           $(&#039;#clock&#039;).countdown(&#039;2020/10/10&#039;, function(event) {&lt;br /&gt;
             $(this).html(event.strftime(&#039;%D days %H:%M:%S&#039;));&lt;br /&gt;
           });&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. put the javascript into a mustache template&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
// /theme/mytheme/templates/countdowntimer.mustache&lt;br /&gt;
&amp;lt;span id=&amp;quot;clock&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{#js}}&lt;br /&gt;
require([&#039;jquery&#039;, &#039;theme_mytheme/jquery.countdown&#039;], function($) {&lt;br /&gt;
           $(&#039;#clock&#039;).countdown(&#039;2020/10/10&#039;, function(event) {&lt;br /&gt;
             $(this).html(event.strftime(&#039;%D days %H:%M:%S&#039;));&lt;br /&gt;
           });&lt;br /&gt;
});&lt;br /&gt;
{{/js}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. call the javascript directly from php -- although who would want to put javascript into php? ergh..&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js_amd_inline(&#039;&lt;br /&gt;
require([&#039;theme_mytheme/jquery.countdown&#039;], function(min) {&lt;br /&gt;
           $(&#039;#clock&#039;).countdown(&#039;2020/10/10&#039;, function(event) {&lt;br /&gt;
             $(this).html(event.strftime(&#039;%D days %H:%M:%S&#039;));&lt;br /&gt;
           });&lt;br /&gt;
});&lt;br /&gt;
&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Embedding AMD code in a page ==&lt;br /&gt;
So you have created lots of cool Javascript modules. Great. How do we actually call them? Any javascript code that calls an AMD module must execute AFTER the requirejs module loader has finished loading. We have provided a function &amp;quot;js_call_amd&amp;quot; that will call a single function from an AMD module with parameters.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js_call_amd($modulename, $functionname, $params);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
that will &amp;quot;do the right thing&amp;quot; with your block of AMD code and execute it at the end of the page, after our AMD module loader has loaded. &lt;br /&gt;
Notes:&lt;br /&gt;
* the $modulename is the &#039;componentname/modulename&#039; discussed above&lt;br /&gt;
* the $functionname is the name of a public function exposed by the amd module. &lt;br /&gt;
* the $params is an array of params passed as arguments to the function. These should be simple types that can be handled by json_encode (no recursive arrays, or complex classes please). &lt;br /&gt;
* if the size of the params array is too large (&amp;gt; 1Kb), this will produce a developer warning. Do not attempt to pass large amounts of data through this function, it will pollute the page size. A preferred approach is to pass css selectors for DOM elements that contain data-attributes for any required data, or fetch data via ajax in the background.&lt;br /&gt;
&lt;br /&gt;
AMD / JS code can also be embedded on a page via mustache templates&lt;br /&gt;
see here: https://docs.moodle.org/dev/Templates#What_if_a_template_contains_javascript.3F&lt;br /&gt;
&lt;br /&gt;
== But I have a mega JS file I don&#039;t want loaded on every page? ==&lt;br /&gt;
Loading all JS files at once and stuffing them in the browser cache is the right choice for MOST js files, there are probably some exceptions. For these files, you can rename the javascript file to end with the suffix &amp;quot;-lazy.js&amp;quot; which indicates that the module will not be loaded by default, it will be requested the first time it is used. There is no difference in usage for lazy loaded modules, the require() call looks exactly the same, it&#039;s just that the module name will also have the &amp;quot;-lazy&amp;quot; suffix.&lt;br /&gt;
&lt;br /&gt;
[[Category:AJAX]]&lt;br /&gt;
[[Category:Javascript]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=41347</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=41347"/>
		<updated>2013-07-11T14:49:38Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores or hyphens.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector-name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#Sel-Name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space, unless it is the last rule in the list of CSS mark-up.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, lowercase is preferred &lt;br /&gt;
* For color codes, use of the shorthand version where possible is preferred, (e.g: #fff instead of #ffffff or #c06 instead of #cc0066). &lt;br /&gt;
* For color codes, if you use HSLA or RGBA, provide a HEX fallback (always).&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important unless the is a good reason! If you need to use !important, something is wrong with the CSS you are trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
A block-style comment at the top of the CSS file should explain the purpose of the rules in the file.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* base.css&lt;br /&gt;
* Contains base styles for theme basic.&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Block-style comments can also be used to denote a section in a CSS file where all rules pertain to a specific component, view, or functionality:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* SCORM Navigation Sidebar&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use single-line comments to provide more information to other developers about a single rule or small subset of rules:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Required because YUI resets add a black border to all tables */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
* The standard property should preferably come after the vendor-prefixed property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
=== LESS and Other CSS Preprocessors ===&lt;br /&gt;
[http://lesscss.org/ LESS] is not CSS. LESS will be evaluated according to the [http://lesscss.org/#docs LESS documentation]. If the LESS is valid according to the LESS documentation, and does not result in invalid CSS when compiled, it does not need to be further changed, revised, updated, or documented. The same goes for SASS and any other preprocessor languages coming down the pike.  It&#039;s important that your LESS or SASS files be clear and accessible to others, and where the rules above apply, for example, with regard to line breaks and syntax, please follow them. &lt;br /&gt;
&lt;br /&gt;
Some additional features allowed in LESS or SASS conflict with CSS usage. One example is inline comments in LESS. However, these inline comments do not appear in the compiled CSS file. The rule of thumb is that so long as the feature is part of the documented LESS or SASS feature set, is clear and usable by other developers (who have read the LESS or SASS documentation), and does not break or interfere with the functioning of the compressed CSS file, we let it stand in peer review.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39804</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39804"/>
		<updated>2013-05-17T14:06:55Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Progressive Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores or hyphens.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector-name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#Sel-Name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space, unless it is the last rule in the list of CSS mark-up.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and use the shorthand version where possible, (e.g: #fff instead of #ffffff or #c06 instead of #cc0066). If you use HSLA or RGBA, provide a HEX fallback (always).&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important unless the is a good reason! If you need to use !important, something is wrong with the CSS you are trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
A block-style comment at the top of the CSS file should explain the purpose of the rules in the file.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* base.css&lt;br /&gt;
* Contains base styles for theme basic.&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Block-style comments can also be used to denote a section in a CSS file where all rules pertain to a specific component, view, or functionality:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* SCORM Navigation Sidebar&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use single-line comments to provide more information to other developers about a single rule or small subset of rules:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Required because YUI resets add a black border to all tables */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
* The standard property should preferably come after the vendor-prefixed property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
=== LESS and Other CSS Preprocessors ===&lt;br /&gt;
[http://lesscss.org/ LESS] is not CSS. LESS will be evaluated according to the [http://lesscss.org/#docs LESS documentation]. If the LESS is valid according to the LESS documentation, and does not result in invalid CSS when compiled, it does not need to be further changed, revised, updated, or documented. The same goes for SASS and any other preprocessor languages coming down the pike.  It&#039;s important that your LESS or SASS files be clear and accessible to others, and where the rules above apply, for example, with regard to line breaks and syntax, please follow them. &lt;br /&gt;
&lt;br /&gt;
Some additional features allowed in LESS or SASS conflict with CSS usage. One example is inline comments in LESS. However, these inline comments do not appear in the compiled CSS file. The rule of thumb is that so long as the feature is part of the documented LESS or SASS feature set, is clear and usable by other developers (who have read the LESS or SASS documentation), and does not break or interfere with the functioning of the compressed CSS file, we let it stand in peer review.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39581</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39581"/>
		<updated>2013-05-09T14:19:09Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* LESS and Other CSS Preprocessors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores or hyphens.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector-name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#Sel-Name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space, unless it is the last rule in the list of CSS mark-up.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and use the shorthand version where possible, (e.g: #fff instead of #ffffff or #c06 instead of #cc0066). If you use HSLA or RGBA, provide a HEX fallback (always).&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important unless the is a good reason! If you need to use !important, something is wrong with the CSS you are trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
A block-style comment at the top of the CSS file should explain the purpose of the rules in the file.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* base.css&lt;br /&gt;
* Contains base styles for theme basic.&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Block-style comments can also be used to denote a section in a CSS file where all rules pertain to a specific component, view, or functionality:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* SCORM Navigation Sidebar&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use single-line comments to provide more information to other developers about a single rule or small subset of rules:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Required because YUI resets add a black border to all tables */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
=== LESS and Other CSS Preprocessors ===&lt;br /&gt;
[http://lesscss.org/ LESS] is not CSS. LESS will be evaluated according to the [http://lesscss.org/#docs LESS documentation]. If the LESS is valid according to the LESS documentation, and does not result in invalid CSS when compiled, it does not need to be further changed, revised, updated, or documented. The same goes for SASS and any other preprocessor languages coming down the pike.  It&#039;s important that your LESS or SASS files be clear and accessible to others, and where the rules above apply, for example, with regard to line breaks and syntax, please follow them. &lt;br /&gt;
&lt;br /&gt;
Some additional features allowed in LESS or SASS conflict with CSS usage. One example is inline comments in LESS. However, these inline comments do not appear in the compiled CSS file. The rule of thumb is that so long as the feature is part of the documented LESS or SASS feature set, is clear and usable by other developers (who have read the LESS or SASS documentation), and does not break or interfere with the functioning of the compressed CSS file, we let it stand in peer review.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39580</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39580"/>
		<updated>2013-05-09T14:18:35Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* LESS and Other CSS Preprocessors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores or hyphens.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector-name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#Sel-Name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space, unless it is the last rule in the list of CSS mark-up.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and use the shorthand version where possible, (e.g: #fff instead of #ffffff or #c06 instead of #cc0066). If you use HSLA or RGBA, provide a HEX fallback (always).&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important unless the is a good reason! If you need to use !important, something is wrong with the CSS you are trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
A block-style comment at the top of the CSS file should explain the purpose of the rules in the file.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* base.css&lt;br /&gt;
* Contains base styles for theme basic.&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Block-style comments can also be used to denote a section in a CSS file where all rules pertain to a specific component, view, or functionality:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* SCORM Navigation Sidebar&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use single-line comments to provide more information to other developers about a single rule or small subset of rules:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Required because YUI resets add a black border to all tables */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
=== LESS and Other CSS Preprocessors ===&lt;br /&gt;
[http://lesscss.org/ LESS] is not CSS. LESS will be evaluated according to the [http://lesscss.org/#docs LESS documentation]. If the LESS is valid according to the LESS documentation, and does not result in invalid CSS when compiled, it does not need to be further changed, revised, updated, or documented. The same goes for SASS and any other preprocessor languages coming down the pike.  It&#039;s important that your LESS or SASS files be clear and accessible to others, and where the rules above apply, for example, with regard to line breaks, and syntax, please attempt to follow the style guidelines above. &lt;br /&gt;
&lt;br /&gt;
Some additional features allowed in LESS or SASS conflict with CSS usage. One example is inline comments in LESS. However, these inline comments do not appear in the compiled CSS file. The rule of thumb is that so long as the feature is part of the documented LESS or SASS feature set, is clear and usable by other developers (who have read the LESS or SASS documentation), and does not break or interfere with the functioning of the compressed CSS file, we let it stand in peer review.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39579</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39579"/>
		<updated>2013-05-09T14:05:37Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Documentation and Comments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores or hyphens.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector-name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#Sel-Name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space, unless it is the last rule in the list of CSS mark-up.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and use the shorthand version where possible, (e.g: #fff instead of #ffffff or #c06 instead of #cc0066). If you use HSLA or RGBA, provide a HEX fallback (always).&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important unless the is a good reason! If you need to use !important, something is wrong with the CSS you are trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
A block-style comment at the top of the CSS file should explain the purpose of the rules in the file.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* base.css&lt;br /&gt;
* Contains base styles for theme basic.&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Block-style comments can also be used to denote a section in a CSS file where all rules pertain to a specific component, view, or functionality:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* SCORM Navigation Sidebar&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use single-line comments to provide more information to other developers about a single rule or small subset of rules:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Required because YUI resets add a black border to all tables */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
=== LESS and Other CSS Preprocessors ===&lt;br /&gt;
[http://lesscss.org/ LESS] is not CSS. LESS will be evaluated according to the [http://lesscss.org/#docs LESS documentation]. If the LESS is valid according to the LESS documentation, and does not result in invalid CSS when compiled, it does not need to be further changed, revised, updated, or documented. The same goes for SASS and any other preprocessor languages coming down the pike.  It&#039;s important that your LESS or SASS files be clear and accessible to others, and where the rules above apply, for example, with regard to line breaks, and syntax, please attempt to follow these style guides. &lt;br /&gt;
&lt;br /&gt;
Some additional features allowed in LESS or SASS conflict with CSS usage. One example is inline comments in LESS. The rule of thumb is that so long as the feature is part of the documented LESS or SASS feature set, is clear and usable by other developers (who have read the LESS or SASS documentation), and does not break or interfere with the functioning of the compressed CSS file, we let it stand in peer review.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39578</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=39578"/>
		<updated>2013-05-09T13:58:26Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Browser Hacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores or hyphens.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector-name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#Sel-Name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space, unless it is the last rule in the list of CSS mark-up.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and use the shorthand version where possible, (e.g: #fff instead of #ffffff or #c06 instead of #cc0066). If you use HSLA or RGBA, provide a HEX fallback (always).&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important unless the is a good reason! If you need to use !important, something is wrong with the CSS you are trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0, 0%, 100%, 1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
=== LESS and Other CSS Preprocessors ===&lt;br /&gt;
[http://lesscss.org/ LESS] is not CSS. LESS will be evaluated according to the [http://lesscss.org/#docs LESS documentation]. If the LESS is valid according to the LESS documentation, and does not result in invalid CSS when compiled, it does not need to be further changed, revised, updated, or documented. The same goes for SASS and any other preprocessor languages coming down the pike.  It&#039;s important that your LESS or SASS files be clear and accessible to others, and where the rules above apply, for example, with regard to line breaks, and syntax, please attempt to follow these style guides. &lt;br /&gt;
&lt;br /&gt;
Some additional features allowed in LESS or SASS conflict with CSS usage. One example is inline comments in LESS. The rule of thumb is that so long as the feature is part of the documented LESS or SASS feature set, is clear and usable by other developers (who have read the LESS or SASS documentation), and does not break or interfere with the functioning of the compressed CSS file, we let it stand in peer review.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37846</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37846"/>
		<updated>2013-02-16T00:51:11Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important! If you need to use !important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37845</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37845"/>
		<updated>2013-02-16T00:50:57Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important  If you need to use !important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37844</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37844"/>
		<updated>2013-02-16T00:50:39Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use *!important*  If you need to use *!important*, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a [http://tracker.moodle.org Tracker ticket] to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37843</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37843"/>
		<updated>2013-02-16T00:46:10Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Selectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a [http://tracker.moodle.org Tracker ticket] to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37842</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37842"/>
		<updated>2013-02-16T00:44:46Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Progressive Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle. Supported browsers are listed in the [https://docs.moodle.org/dev/Releases Release notes] for the Moodle version.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the supported browser in question does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37841</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37841"/>
		<updated>2013-02-16T00:41:46Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Progressive Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the [https://docs.moodle.org/dev/Moodle_2.3_release_notes#Requirements Supported browser in question] does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37840</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37840"/>
		<updated>2013-02-16T00:39:37Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Progressive Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the unprefixed property. Outdated vendor prefixes can be removed. Use  [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37839</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37839"/>
		<updated>2013-02-16T00:39:18Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Progressive Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the unprefixed property. Outdated vendor prefixes can be removed. There are [http://caniuse.com/ Can I use] or like resource to determine what&#039;s supported. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37838</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37838"/>
		<updated>2013-02-16T00:35:15Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the unprefixed property. Outdated vendor prefixes can be removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37837</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37837"/>
		<updated>2013-02-16T00:34:48Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1)&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: hsla(0,0%,100%,1)&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the unprefixed property. Outdated vendor prefixes can be removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37836</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37836"/>
		<updated>2013-02-16T00:33:55Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* For color codes, avoid uppercase, and shorten values when possible. If you use HSLA or RGBA, provide a HEX fallback.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
    color: hsla(0,0%,100%,1)&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF;&lt;br /&gt;
    background-color: rgb(0, 0, 0);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the unprefixed property. Outdated vendor prefixes can be removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37835</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37835"/>
		<updated>2013-02-16T00:31:46Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Properties and Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* Use hex code for colors. Avoid RBG and uppercase, and shorten values when possible.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
* Do not use !important. If you need to use important, something is wrong with the CSS you&#039;re trying to override. Rather than adding more problematic CSS, submit a tracker ticket to get the existing problem fixed. &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF;&lt;br /&gt;
    background-color: rgb(0, 0, 0);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF !important;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the unprefixed property. Outdated vendor prefixes can be removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37834</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37834"/>
		<updated>2013-02-16T00:29:41Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Progressive Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* Use hex code for colors. Avoid RBG and uppercase, and shorten values when possible.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF;&lt;br /&gt;
    background-color: rgb(0, 0, 0);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the unprefixed property. Outdated vendor prefixes can be removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37833</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37833"/>
		<updated>2013-02-16T00:27:48Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Progressive Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* Use hex code for colors. Avoid RBG and uppercase, and shorten values when possible.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF;&lt;br /&gt;
    background-color: rgb(0, 0, 0);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided.&lt;br /&gt;
* Use vendor prefixes only when the browser and version in question (only those supported by Moodle) does not support the standard &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37832</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37832"/>
		<updated>2013-02-16T00:26:24Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Selectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write the needed selectors successfully without using an ID, then submit a Tracker ticket to have classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* Use hex code for colors. Avoid RBG and uppercase, and shorten values when possible.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF;&lt;br /&gt;
    background-color: rgb(0, 0, 0);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided as well as vendor prefixes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37831</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37831"/>
		<updated>2013-02-16T00:26:00Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Selectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
* Avoid using IDs as selectors wherever possible. IDs are a tad faster, but far more difficult to maintain and override. If you can&#039;t write a selectors successfully without using an ID, then submit a Tracker ticket to have the necessary classnames added.  &lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* Use hex code for colors. Avoid RBG and uppercase, and shorten values when possible.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF;&lt;br /&gt;
    background-color: rgb(0, 0, 0);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided as well as vendor prefixes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:CSS_Coding_Style&amp;diff=37381</id>
		<title>Talk:CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:CSS_Coding_Style&amp;diff=37381"/>
		<updated>2013-01-24T20:12:14Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A few questions about these style guidelines, as they seem a bit outdated: &lt;br /&gt;
# Do we need to restrict color settings to only HEX? This probably made sense when there was only HEX &amp;amp; RGB, but we now have really cool stuff like HSLA which is supported in all the browsers we support except IE8. It&#039;s also very easy to provide fallback to HEX:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  .selector {&lt;br /&gt;
    background-color: #hex;&lt;br /&gt;
    background-color: hsla(170, 50%, 45%, 1);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# For many properties, browser prefixes are no longer needed for our supported browsers. Shouldn&#039;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?)&lt;br /&gt;
# What about !important being a bad thing? If you can&#039;t override existing rules without !important, that indicates that existing selectors are too aggressive (usually using IDs rather than classes and elements).&lt;br /&gt;
# How about we recommend OOCSS and where you can&#039;t use it request classes added to Moodle&#039;s markup so you can?&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:CSS_Coding_Style&amp;diff=37380</id>
		<title>Talk:CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:CSS_Coding_Style&amp;diff=37380"/>
		<updated>2013-01-24T20:11:34Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: Created page with &amp;quot;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...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A few questions about these style guidelines, as they seem a bit outdated: &lt;br /&gt;
1) Do we need to restrict color settings to only HEX? This probably made sense when there was only HEX &amp;amp; RGB, but we now have really cool stuff like HSLA which is supported in all the browsers we support except IE8. It&#039;s also very easy to provide fallback to HEX:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  .selector {&lt;br /&gt;
    background-color: #hex;&lt;br /&gt;
    background-color: hsla(170, 50%, 45%, 1);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
2) For many properties, browser prefixes are no longer needed for our supported browsers. Shouldn&#039;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?)&lt;br /&gt;
3) What about !important being a bad thing? If you can&#039;t override existing rules without !important, that indicates that existing selectors are too aggressive (usually using IDs rather than classes and elements).&lt;br /&gt;
4) How about we recommend OOCSS and where you can&#039;t use it request classes added to Moodle&#039;s markup so you can?&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37379</id>
		<title>CSS Coding Style</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=CSS_Coding_Style&amp;diff=37379"/>
		<updated>2013-01-24T20:08:10Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Browser Hacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
The Moodle CSS coding style &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Scope ===&lt;br /&gt;
&lt;br /&gt;
This document describes style guidelines for developers working on or with Moodle code. It talks purely about the mechanics of code layout and the choices we have made for Moodle. &lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Consistent coding style is important in any development project, and particularly when many developers are involved. A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.&lt;br /&gt;
&lt;br /&gt;
Abstract goals we strive for: &lt;br /&gt;
&lt;br /&gt;
* simplicity&lt;br /&gt;
* readability&lt;br /&gt;
* tool friendliness&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
Within plugins, CSS files are normally named *styles.css*.&lt;br /&gt;
&lt;br /&gt;
In the theme, files can be named according to the theme designer&#039;s wishes but should:&lt;br /&gt;
&lt;br /&gt;
* use lowercase letters only&lt;br /&gt;
* be as short as possible&lt;br /&gt;
&lt;br /&gt;
== Block Style ==&lt;br /&gt;
&lt;br /&gt;
* Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.&lt;br /&gt;
* Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.&lt;br /&gt;
* The closing brace should use the same level of indentation as the opening selector.&lt;br /&gt;
* Add a blank line between sections, but leave no lines between blocks in a section.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;@media only screen and (min-width: 768px) {&lt;br /&gt;
    #selector_one,&lt;br /&gt;
    #selector_two {&lt;br /&gt;
        color: #fff;&lt;br /&gt;
        background-color: #000;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_one, #selector_two { color: #fff; background-color: #000; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
* Follow Moodle [[Coding style]] for naming selectors.&lt;br /&gt;
* Names should be simple English lowercase words.&lt;br /&gt;
* Words should be separated by underscores.&lt;br /&gt;
* Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.&lt;br /&gt;
* Use [http://css-tricks.com/semantic-class-names/ semantic names]: names tell what this is instead of what should it look like.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector_name {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selName {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties and Values ==&lt;br /&gt;
&lt;br /&gt;
* Properties should be followed by a colon and a space.&lt;br /&gt;
* All properties and values should be lowercase, except for font names and vendor-specific properties.&lt;br /&gt;
* Use hex code for colors. Avoid RBG and uppercase, and shorten values when possible.&lt;br /&gt;
* Use shorthand (except when overriding styles) for background, border, font, list-style, margin, and padding values.&lt;br /&gt;
* Prefixed vendor-specific properties pairs should appear directly before the generic property they refer to.&lt;br /&gt;
&lt;br /&gt;
=== Correct ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Incorrect ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    color: #FFFFFF;&lt;br /&gt;
    background-color: rgb(0, 0, 0);&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Comments ==&lt;br /&gt;
&lt;br /&gt;
== Progressive Enhancement ==&lt;br /&gt;
&lt;br /&gt;
* Code should follow the Moodle principle of progressive enhancement for all supported browsers for that specific version of Moodle.&lt;br /&gt;
* Fallbacks should always be provided as well as vendor prefixes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#selector {&lt;br /&gt;
    background-color: #444; /* Fallback for browsers that don&#039;t support gradients */&lt;br /&gt;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=&#039;#444&#039;, EndColorStr=&#039;#999&#039;); /* IE6-IE9 */&lt;br /&gt;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#444), to(#999)); /* Safari 4+, Chrome */&lt;br /&gt;
    background-image: -webkit-linear-gradient(top, #444, #999); /* Chrome 10+, Safari 5.1+, iOS 5+ */&lt;br /&gt;
    background-image: -moz-linear-gradient(top, #444, #999); /* Firefox 3.6 */&lt;br /&gt;
    background-image: -ms-linear-gradient(top, #444, #999); /* IE10 */&lt;br /&gt;
    background-image: -o-linear-gradient(top, #444, #999); /* Opera 11.10+ */&lt;br /&gt;
    background-image: linear-gradient(top, #444, #999); /* W3C Standard */&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser Hacks ===&lt;br /&gt;
&lt;br /&gt;
* Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.ie7 .forum-post {&lt;br /&gt;
    min-height: 1px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* It is not necessary to include hacks for versions of browsers that Moodle Core does not provide support for (e.g. IE6 in Moodle 2, except legacy theme).&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This document was drawn from the following sources:&lt;br /&gt;
&lt;br /&gt;
# The [http://codex.wordpress.org/CSS_Coding_Standards WordPress CSS Coding Standards] &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Coding]]&lt;br /&gt;
* [[Coding_style|Coding style]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|CSS Coding style]]&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36990</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36990"/>
		<updated>2012-12-20T22:49:42Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Revise span.maincontent */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* CSS selectors should use classnames over IDs. The logic being that we build reusable classes for application in multiple contexts, with consistent markup across numerous page view and elements, rather than writing CSS to target individual IDs.&lt;br /&gt;
&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span#maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is mentioned again in the Consolidation item below.&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate Selectors for Several Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Table====&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36968</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36968"/>
		<updated>2012-12-19T21:23:34Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Success Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* CSS selectors should use classnames over IDs. The logic being that we build reusable classes for application in multiple contexts, with consistent markup across numerous page view and elements, rather than writing CSS to target individual IDs.&lt;br /&gt;
&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is mentioned again in the Consolidation item below.&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate Selectors for Several Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Table====&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36967</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36967"/>
		<updated>2012-12-19T21:23:12Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* CSS selectors should use classnames over IDs. The logic being that we build reusable classes for application in multiple contexts, with consistent markup across numerous page view and elements, rather than writing CSS to target individual IDs.&lt;br /&gt;
&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is mentioned again in the Consolidation item below.&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate Selectors for Several Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Table====&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36966</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36966"/>
		<updated>2012-12-19T21:20:42Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Move away from use of IDs as CSS selectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* CSS selectors should use classnames over IDs. The logic being that we build reusable classes for application in multiple contexts, with consistent markup across numerous page view and elements, rather than writing CSS to target individual IDs.&lt;br /&gt;
&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is mentioned again in the Consolidation item below.&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate Selectors for Several Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Table====&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36965</id>
		<title>Talk:Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36965"/>
		<updated>2012-12-19T21:03:39Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I like the way this is going. Naturally I will only comment on the bits I don&#039;t completely like ;-)&lt;br /&gt;
&lt;br /&gt;
I still don&#039;t get why &amp;quot;Eliminate span.maincontent&amp;quot; is a good idea, but then I already explained my reasoning in MDL-34723.&lt;br /&gt;
&lt;br /&gt;
On an unrelated note, I recommend reading some articles like http://css-tricks.com/efficiently-rendering-css/ and http://boblet.tumblr.com/post/34751669/tips-for-css-performance and the classic https://developer.mozilla.org/en-US/docs/CSS/Writing_Efficient_CSS that they both link to. Hence, some parts of your recommendations worry me a bit, like the one to always prefer classes to ids.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tim Hunt|Tim Hunt]] 15:31, 30 November 2012 (WST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Tim. I hear you on the selectors issue. From the bottom of the CSS-Tricks post: &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
So we know that ID&#039;s are the most efficient selectors. If you wanted to make the most efficiently rendering page possible, you would literally give every single element on the page a unique ID, then apply styling with single ID selectors. That would be super fast, and also super ridiculous. It would probably be extremely non-semantic and extremely difficult to maintain. You don&#039;t see this approach even on hardcore performance based sites. I think the lesson here is not to sacrifice semantics or maintainability for efficient CSS.&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36964</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36964"/>
		<updated>2012-12-19T19:13:02Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Standardize inheritance for tables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is mentioned again in the Consolidation item below.&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate Selectors for Several Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Table====&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36963</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36963"/>
		<updated>2012-12-19T19:09:41Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Consolidate a Variety of Elements to a Set Number of Content Types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate Selectors for Several Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Table====&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36962</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36962"/>
		<updated>2012-12-19T19:08:26Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Table====&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36961</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36961"/>
		<updated>2012-12-19T19:08:16Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Form Buttons */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Form Buttons====&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36960</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36960"/>
		<updated>2012-12-19T19:08:08Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Info Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Info Alert====&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36959</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36959"/>
		<updated>2012-12-19T19:08:00Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Error Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Error Alert====&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36958</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36958"/>
		<updated>2012-12-19T19:07:51Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Success Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Alert====&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36957</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36957"/>
		<updated>2012-12-19T19:07:38Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Alert====&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Alert===&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36956</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36956"/>
		<updated>2012-12-19T19:07:28Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Success Label */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Success Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Success Alert===&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36955</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36955"/>
		<updated>2012-12-19T19:07:08Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Warning Label */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Warning Label====&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Success Alert===&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36954</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36954"/>
		<updated>2012-12-19T18:57:02Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Consolidate a Variety of Elements to a Set Number of Content Types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap. In each case, we should implement a single class, and if possible eliminate unnecessary extra classes and IDs.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Warning Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Success Alert===&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36953</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36953"/>
		<updated>2012-12-19T18:55:43Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Warning Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Success Alert===&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#tables. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36952</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36952"/>
		<updated>2012-12-19T18:55:22Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Error Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Warning Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Success Alert===&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Info Alert===&lt;br /&gt;
The following elements all present info alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-info class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
div.performanceinfo.pageinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Form Buttons===&lt;br /&gt;
The following elements all present form button elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. DS notes that there are other form element types in need of consolidation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#fgroup_id_buttonar,&lt;br /&gt;
#fitem_id_submitbutton,&lt;br /&gt;
table#form td.submit,&lt;br /&gt;
.form-buttons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Table===&lt;br /&gt;
The following elements all present table elements. DS chose to associate them with Bootstrap&#039;s form-actions class, which can be viewed here: http://twitter.github.com/bootstrap/base-css.html#forms. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
table#explaincaps,&lt;br /&gt;
table#defineroletable,&lt;br /&gt;
table.grading-report,&lt;br /&gt;
table#listdirectories,&lt;br /&gt;
table.rolecaps,&lt;br /&gt;
table.userenrolment,&lt;br /&gt;
table#form,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
form#movecourses table,&lt;br /&gt;
#page-report-log-user .generaltable,&lt;br /&gt;
#page-admin-course-index .editcourse,&lt;br /&gt;
.forumheaderlist,&lt;br /&gt;
.userprofilebox table.list,&lt;br /&gt;
.generaltable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36951</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36951"/>
		<updated>2012-12-19T18:50:59Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Warning Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Success Alert===&lt;br /&gt;
The following elements all present success alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.notifysuccess&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Error Alert===&lt;br /&gt;
The following elements all present error alert-type elements. DS chose to associate them with Bootstrap&#039;s alert-error class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36950</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36950"/>
		<updated>2012-12-19T18:48:24Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Alert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Warning Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
DS also implemented the .alert .close class for the following Moodle element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a#closehelpbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36949</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36949"/>
		<updated>2012-12-19T18:45:56Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Success Label */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Warning Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alert===&lt;br /&gt;
The following elements all present alert-type elements. DS chose to associate them with Bootstrap&#039;s alert class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#alerts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#page-admin-roles-assign h2 + .box.generalbox,&lt;br /&gt;
div.notifysuccess,&lt;br /&gt;
div.notifyproblem,&lt;br /&gt;
body.admin div.info,&lt;br /&gt;
div.box.copyright,&lt;br /&gt;
body.pagelayout-report div.info,&lt;br /&gt;
div.redirectmessage,&lt;br /&gt;
div.adminwarning,&lt;br /&gt;
div.forumnodiscuss,&lt;br /&gt;
div#notice p,&lt;br /&gt;
div.performanceinfo.pageinfo,&lt;br /&gt;
div.noticebox,&lt;br /&gt;
div#helppopupbox,&lt;br /&gt;
div.releasenoteslink,&lt;br /&gt;
.errorbox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36948</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36948"/>
		<updated>2012-12-19T18:44:17Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Important Label */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Warning Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-warning class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.warn,&lt;br /&gt;
p.warn,&lt;br /&gt;
span.editinstructions,&lt;br /&gt;
#page-admin-report-security-index span.statuswarning,&lt;br /&gt;
span.statuswarning,&lt;br /&gt;
tr.rolecap td.risk.spam a,&lt;br /&gt;
.form-overridden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Success Label===&lt;br /&gt;
The following elements all present warning-type elements. DS chose to associate them with Bootstrap&#039;s label-success class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
span.ok,&lt;br /&gt;
span.pathok,&lt;br /&gt;
span.statusok,&lt;br /&gt;
font[color=&amp;quot;green&amp;quot;],&lt;br /&gt;
tr.rolecap td.risk.config a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36947</id>
		<title>Standardize classnames and layout to facilitate theming</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Standardize_classnames_and_layout_to_facilitate_theming&amp;diff=36947"/>
		<updated>2012-12-19T18:42:09Z</updated>

		<summary type="html">&lt;p&gt;Aegroshek: /* Reduce Various Selectors to Specific Content Types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Working notes on standardization of classnames and layout across Moodle activity types, with the intention of making theme design faster and more foolproof.&lt;br /&gt;
&lt;br /&gt;
In order to be sure all bases are covered in standardization, I began with a [[Survey of existing page views and markup]]. I&#039;m going to exclude editing screens from this survey because it would just be too much to cover. Additionally, student views should probably be the first priority. &lt;br /&gt;
&lt;br /&gt;
==Recommendations==&lt;br /&gt;
===Move away from use of IDs as CSS selectors===&lt;br /&gt;
* IDs are needed for elements which need identification for JavaScript. Elements which do not need to be accessed or manipulated by JavaScript can be identified by classnames. &lt;br /&gt;
* Wherever possible, CSS selectors should use classnames over IDs.&lt;br /&gt;
===Add a paragraph renderer===&lt;br /&gt;
Add a paragraph renderer. The container() renderer encourages developers to render text that is not appropriately tagged as paragraph text. This would be a simple thing to add. Or if not, at least discourage instructions and other text within bare divs. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// similar to the heading renderer&lt;br /&gt;
heading();&lt;br /&gt;
// to replace container() as a default text function to print a block of text&lt;br /&gt;
paragraph();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===.generalbox for text features===&lt;br /&gt;
Use generalbox only for a box/block of text, &#039;&#039;&#039;not&#039;&#039;&#039; for container of all content in the central column. (In following with purported original purposes of .generalbox, assuming it used to be similar to .generaltable.) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we aren&#039;t going to implement a framework, then this will suffice. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- If we are going to implement a framework, then, at least with regard to Twitter Bootstrap, &lt;br /&gt;
.generalbox is analogous to the .well class. &lt;br /&gt;
We might implement them both. --&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;generalbox well&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, tables should not be getting the .generalbox class, as they are tables, not boxes.&lt;br /&gt;
&lt;br /&gt;
===#intro ID a classname instead===&lt;br /&gt;
The #intro item is common to all activity types. It is not a target of JavaScript and in addition is not really different from any generalbox element in most cases. It could very easily just be another notification box. &lt;br /&gt;
&lt;br /&gt;
Currently:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;intro&amp;quot; class=&amp;quot;box generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;intro generalbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use .maincontent instead of .generalbox to indicate parent of all content in central column===&lt;br /&gt;
Expand the role=&amp;quot;main&amp;quot; container div with a classname so it can take the place of .generalbox as a container of all content in the central column: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;main&amp;quot; class=&amp;quot;maincontent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Revise span.maincontent===&lt;br /&gt;
Link to main content is needed for accessibility, but do we need a special element to do it? span.maincontent is not really semantic... MDL-34723&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span id=&amp;quot;maincontent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going recommendation is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;a id=&amp;quot;maincontent-target&amp;quot; name=&amp;quot;maincontent-target&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Standardize inheritance for tables===&lt;br /&gt;
The .generaltable instances look nice and are commonly used. But there are some activities where tables are given their own classes entirely, and not given the .generaltable as well. This makes it hard to style all tables with general styles. It&#039;s no problem for a mod developer to add additional classnames to target with the mod&#039;s own CSS, but the parent classname should be retained.  &lt;br /&gt;
&lt;br /&gt;
An example of this is the forum. At present, the table of threads for a news forum has only one classname: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that anything special theme designers did with .generaltable will not apply to the forum table. A better strategy would be to include the .generaltable class, and then add additional classes for mod-specific styling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;generaltable forumheaderlist&amp;quot; id=&amp;quot;yui_3_5_1_1_1353535026017_577&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Header usage should be hierarchical within page views===&lt;br /&gt;
* Headers should be hierarchical, with two or more &amp;amp;lt;h3&amp;amp;gt; under each &amp;amp;lt;h2&amp;amp;gt; and so forth. &lt;br /&gt;
* &amp;amp;lt;h2&amp;amp;gt; is the top-level header of the page content/central column. There should be only one &amp;amp;lt;h2&amp;amp;gt;&lt;br /&gt;
* Headers should not be used for notification. Notification classes should be used for notification.&lt;br /&gt;
* We shouldn&#039;t even need the .main class. The fact that the header is located in the central column/main content area, and is a header, should be enough. The only reason we need it is because we&#039;re recruiting headers for other purposes. &lt;br /&gt;
&lt;br /&gt;
Not this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;These is your score on XX activity.&amp;lt;/h2&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;A paragraph of content.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h2 class=&amp;quot;main&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Generic submit button&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;This is the top-level header&amp;lt;/h2&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This paragraph gives additional information and explains what&#039;s to come.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Content sub-header&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;More paragraph content content content&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;notifyproblem&amp;quot;&amp;gt;You must make a selection to proceed.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Consolidate a Variety of Elements to a Set Number of Content Types===&lt;br /&gt;
These elements were identified and organized by David Scotson, and their first listing can be found here: https://moodle.org/mod/forum/discuss.php?d=216519 The content types are based on components in Twitter Bootstrap.&lt;br /&gt;
&lt;br /&gt;
====Important Label====&lt;br /&gt;
The following elements all present an error-type element. DS chose to associate them with Bootstrap&#039;s label-important class, which can be viewed here: http://twitter.github.com/bootstrap/components.html#labels-badges&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
div.felement.error span.error,&lt;br /&gt;
span.error,&lt;br /&gt;
span.patherror,&lt;br /&gt;
tr.rolecap td.risk.xss a,&lt;br /&gt;
div.form-warning&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aegroshek</name></author>
	</entry>
</feed>