Wikipedia:Don't use hiddenStructure: Difference between revisions
Content deleted Content added
Locke Cole (talk | contribs) m →Quotes: fmt quote (partial) |
Locke Cole (talk | contribs) expand opening, solutions, make qif most preferred solution |
||
Line 1:
Recently a [[cascading style sheets]] (CSS) "hack" known more generally as "[[Wikipedia:HiddenStructure|''hiddenStructure'']]" has seen widespread use on Wikipedia. This hack makes it possible to conditionally hide rows of data in tables dependent upon whether or not certain parameters are passed (or are/aren't empty/blank).
By using hiddenStructure in templates, editors are creating deficient templates that may output invalid or poor HTML. Further, CSS (normally a way of applying styles such as fonts, colors, and so forth) was never really intended to be used in this manner, and doing so violates at least one WAI accessibility guideline.
==Problems==
Line 29 ⟶ 31:
Solutions, in order of preference, are.
* Use Weeble code (such as {{tl|row}}).▼
* Use meta-templates such as {{tl|qif}} to conditionally display data.
**'''Advantage''': When conditional syntax is brought into MediaWiki, using [[Special:Whatlinkshere]] should make it easy to identify templates which need to be upgraded.
**'''Problem''': Can clutter up templates with HTML, but not as bad as Weeble usually.
▲* Use Weeble code (such as {{tl|row}}).
**'''Advantage''': Can avoid meta-templates altogether.
**'''Problem''': Requires that a blank parameter (usually <code>=if</code>) be passed. Also, if and when conditionals are implemented in MediaWiki, it may be more difficult to find and replace templates utilizing this method. Finally, templates that use Weeble are generally the ugliest as far as the code is concerned.
* Limit or eliminate conditional rows.
Line 46 ⟶ 50:
*:''...it's using a CSS hack to hide structure elements, which can fail for text browsers, plaintext renderings of articles, and any HTML display of the article that doesn't use the stylesheet on this site. This harms both the primary site's accessibility and offsite reuse of material.'' –{{user|Brion VIBBER}}
* [http://en.wikipedia.org/w/index.php?title=MediaWiki_talk%3ACommon.css&diff=36319008&oldid=36287089 2006-01-23 05:08:05] — Here Graham87, a blind Wikipedian, discusses screen reading software and the limitations therein, and also states that he doesn't believe we should use CSS hacks.
*:''
==See also==
|