<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Template%3AMxt%2FUser_CSS_for_a_monospaced_coding_font</id>
	<title>Template:Mxt/User CSS for a monospaced coding font - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Template%3AMxt%2FUser_CSS_for_a_monospaced_coding_font"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Template:Mxt/User_CSS_for_a_monospaced_coding_font&amp;action=history"/>
	<updated>2026-04-22T15:25:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Template:Mxt/User_CSS_for_a_monospaced_coding_font&amp;diff=13723134&amp;oldid=prev</id>
		<title>imported&gt;TarnishedPath: Per page move: Changed link from Class (computer programming) to Class (programming) using MovePlus</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Template:Mxt/User_CSS_for_a_monospaced_coding_font&amp;diff=13723134&amp;oldid=prev"/>
		<updated>2025-10-17T09:36:29Z</updated>

		<summary type="html">&lt;p&gt;Per page move: Changed link from &lt;a href=&quot;/index.php/Class_(computer_programming)&quot; class=&quot;mw-redirect&quot; title=&quot;Class (computer programming)&quot;&gt;Class (computer programming)&lt;/a&gt; to &lt;a href=&quot;/index.php/Class_(programming)&quot; title=&quot;Class (programming)&quot;&gt;Class (programming)&lt;/a&gt; using &lt;a href=&quot;/index.php/User:TarnishedPath/MovePlus.js&quot; title=&quot;User:TarnishedPath/MovePlus.js&quot;&gt;MovePlus&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Wikipedia how-to}}&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;&amp;lt;div style=&amp;quot;float:right; padding:0 1em;&amp;quot;&amp;gt;{{navbar|Mxt/User CSS for a monospaced coding font|plain=y}}&amp;lt;/div&amp;gt;&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To consistently use a [[monospaced font]] with well-designed characters for coding so as to clearly distinguish between &amp;lt;code&amp;gt;l&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and between &amp;lt;code&amp;gt;O&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, and between &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;−&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;–&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;—&amp;lt;/code&amp;gt;, the system-default monospaced font can be changed:&lt;br /&gt;
&lt;br /&gt;
If like it as-is, you can simply &amp;lt;code&amp;gt;@import&amp;lt;/code&amp;gt; (transclude) it: see [[meta:User:SMcCandlish/codefont.css]] for quick instructions.&lt;br /&gt;
&lt;br /&gt;
Otherwise, copy one of the code snippets below to your [[Special:MyPage/common.css]] or [[meta:Special:MyPage/global.css]] page, replacing {{kbd|&amp;quot;Roboto Mono&amp;quot;}} in the code with your preferred coding font. ([https://fonts.google.com/specimen/Roboto+Mono Roboto Mono] was used in this example as it is good, free coding font, for user-editable material on the wiki).&lt;br /&gt;
&lt;br /&gt;
This code will:&lt;br /&gt;
* Apply a consistent monospace font of choice to all the normally monospaced HTML elements like {{tag|code|o}}, {{tag|pre|o}}, etc.&lt;br /&gt;
* Fallback to system-default {{samp|monospace}} font, should the chosen font be unavailable or lack the necessary characters.&lt;br /&gt;
* Do the same for the output of all [[:Category:Example-formatting templates|Example-formatting templates]], such as {{tlx|mxt}} and {{tlx|xt}}.&lt;br /&gt;
* Apply to additional site-wide classes identified so far (e.g., &amp;lt;code&amp;gt;.monospaced&amp;lt;/code&amp;gt;) that output as monospace.&lt;br /&gt;
* Make the three most frequently encountered editing fields also use this font stack: the main editing window, the edit summary line, and the search entry box.&lt;br /&gt;
* If any additional [[Class (programming)|classes]] are known that should be added, please update this page or mention it on [[Template talk:Mxt/User CSS for a monospaced coding font|the talk page]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--DO NOT ADD var TO THIS LIST! It must be able to inherit the font of surrounding text, because it is used outside code, as in &amp;quot;If &amp;lt;var&amp;gt;A&amp;lt;/var&amp;gt; then &amp;lt;var&amp;gt;B&amp;lt;/var&amp;gt;&amp;quot;, and in math equations.--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Horizontal style&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{syntaxhighlight|lang=css|1=&lt;br /&gt;
/* Use my font, when available, for code */&lt;br /&gt;
code, pre, samp, kbd, tt, .example-mono, .userlinks-username, .monospaced, .keyboard-key, .button, .plaincode { font-family: &amp;quot;Roboto Mono&amp;quot;, monospace !important; }&lt;br /&gt;
/*  Make some of the editable stuff monospaced */&lt;br /&gt;
#wpTextbox1, #wpSummary, #searchInput, #searchText { font-family: &amp;quot;Roboto Mono&amp;quot;, monospace !important; }&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Vertical style&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{syntaxhighlight|lang=css|1=&lt;br /&gt;
/* Use my font, when available, for code */&lt;br /&gt;
code,&lt;br /&gt;
pre,&lt;br /&gt;
samp,&lt;br /&gt;
kbd,&lt;br /&gt;
tt,&lt;br /&gt;
.example-mono,&lt;br /&gt;
.userlinks-username,&lt;br /&gt;
.monospaced,&lt;br /&gt;
.keyboard-key,&lt;br /&gt;
.button&lt;br /&gt;
.plaincode {&lt;br /&gt;
  font-family: &amp;quot;Roboto Mono&amp;quot;, monospace !important;&lt;br /&gt;
}&lt;br /&gt;
/*  Make some of the editable stuff monospaced */&lt;br /&gt;
#wpTextbox1,&lt;br /&gt;
#wpSummary,&lt;br /&gt;
#searchInput,&lt;br /&gt;
#searchText {&lt;br /&gt;
  font-family: &amp;quot;Roboto Mono&amp;quot;, monospace !important;&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{anchor|Cleanup efforts}}&amp;#039;&amp;#039;&amp;#039;Cleanup efforts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;d like to help clean up instances of the {{tag|{{!mxt|tt}}}} element – which has been discouraged since the 1990s, and should usually be replaced with {{tag|{{mxt|code}}}} (this may vary by context) – you can add something like the following to your {{samp|common.css}} to make {{tag|{{!mxt|tt}}|o}} stick out like a sore thumb:&lt;br /&gt;
&lt;br /&gt;
{{syntaxhighlight|lang=css|1=&lt;br /&gt;
/* Flag bad code for cleanup */&lt;br /&gt;
tt { color: DarkRed; background: Pink; }&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can also do this with {{tag|font|o}}, {{tag|center|o}}, {{tag|strike|o}}, and other [[Wikipedia:HTML 5#Obsolete elements and attributes|deprecated elements]].  For CSS you can just import for this, see [[meta:User:SMcCandlish/lint.css]].&amp;lt;noinclude&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;{{Documentation|content=This is a documentation snippet page transcluded (without the banner or this doc section) into other template documentation, and into [[Help:User style]], for consistency. It takes no parameters.  &lt;br /&gt;
&lt;br /&gt;
Typical usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
== User CSS for a monospaced coding font ==&lt;br /&gt;
{{collapse top|left=y|title=Have monospaced templates in this group – and your editing window – use your preferred monospaced font:}}&lt;br /&gt;
{{Mxt/User CSS for a monospaced coding font}}&lt;br /&gt;
{{collapse bottom}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be used as a stand-alone how-to page; a redirect to it, [[Help:User CSS for a monospaced coding font]], is categorized as such. It is also transcluded as a section, at [[Help:User style#User CSS for a monospaced coding font]].&lt;br /&gt;
{{Wikipedia technical help}}&lt;br /&gt;
[[Category:Documentation templates]]&lt;br /&gt;
&amp;lt;!--End documentation.--&amp;gt;}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;TarnishedPath</name></author>
	</entry>
</feed>