Cannabis Ruderalis

TemplateStyles allow custom CSS pages to be used to style content without an administrator having to edit sitewide CSS. This will make it more convenient for editors to style templates; for example, those templates for which the sitewide CSS for the mobile skin or another skin (e.g. Timeless) currently negatively affects the display of the template.

Guidelines

  • Style pages should be associated with a specific template or group of templates, and named accordingly.
    • This allows styles pages to be easily identified and edited.
    • In general, this means it should be a subpage of the related template, e.g.: Template:myTemplate/style.css or Template:myTemplate/style-foo.css, but not Template:style-foo.css nor Template:foo.css
  • Only style the associated template's output.
    • It would be confusing if adding a template to one part of a page would completely or partially change the display/styling of another part of the page.
  • Use selectors and class names that are highly likely to be unique to that template.
    • This reduces the chance of conflicting CSS rules arising accidentally.
    • Examples: Use .myTemplate-row rather than .row; use table.myTemplate > tr rather than tr
  • Avoid using !important.
    • Using !important can make it hard or impossible for user CSS to override styles.
  • Only images which don't require attribution can be used as background images
    • For normal file usage, attribution is provided on the file description page, accessed by clicking the image. This is not possible if the image is being used as the background.
  • The protection level of style pages should match that of their associated template.
    • If a template is high risk, then its styles are also high risk, and should have the same protection.
    • If a template is not high risk, then vandalism to cause chaos could be achieved just by editing the template itself.
    • A higher protection level for the style page would encourage inline styles to be added on top of the TemplateStyles CSS, since the template was editable but not the style page.

Note that the Manual of Style, including the Accessibility guidelines, still apply.

Examples

Leave a Reply