<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>plaintxt.org &#187; special classes</title>
	<atom:link href="http://www.plaintxt.org/tag/special-classes/feed/rss2" rel="self" type="application/rss+xml" />
	<link>http://www.plaintxt.org</link>
	<description>Minimalism in blog design, an experiment</description>
	<pubDate>Wed, 03 Sep 2008 20:44:58 +0000</pubDate>
	
	<language>en</language>
			<item>
		<title>Special classes in themes</title>
		<link>http://www.plaintxt.org/2007/01/special-classes-in-themes/</link>
		<comments>http://www.plaintxt.org/2007/01/special-classes-in-themes/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 15:43:10 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[semantic markup]]></category>

		<category><![CDATA[special classes]]></category>

		<category><![CDATA[wordpress community]]></category>

		<category><![CDATA[wordpress development]]></category>

		<guid isPermaLink="false">http://www.plaintxt.org/2007/01/22/standard-special-classes-in-themes/</guid>
		<description><![CDATA[I standardize some special classes across my themes. Classes used for aligning images (or other elements) or styling text (think all caps). And then there are the classes to indicate <abbr title="XHTML Friends Network">XFN</abbr> relationships. Maybe we can make our lives better.]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve been revising my themes for the 2.1 version of WordPress, I&#8217;ve been working towards establishing certain &#8220;special classes&#8221; across each of my themes. Some of these I&#8217;ve seen in other themes, some of them I just made up.</p>
<p>There are a few I&#8217;d like for more WordPress theme developers to consider standardizing across the board.</p>
<p>First of all, they are classes, so they shouldn&#8217;t semantically impact the content. This is important because if, in the future, some person shockingly decides to change themes, the content of their posts isn&#8217;t affected.</p>
<h3>Image classes</h3>
<p>First of these class would be image positioning classes: <code>.alignleft</code>, <code>.alignright</code>, and <code>.center</code>. Since the positioning and/or float of images should be determined by <abbr title="Cascading Style Sheet">CSS</abbr> in <abbr title="eXtensible Hypertext Markup Language">XHTML</abbr>, I think these are probably the safest special classes to agree upon.</p>
<pre><del datetime="2007-01-23T03:29:01+00:00">img</del>.alignleft {
   float: left;
   margin: 0.5em 1em 0.5em 0;
}

<del datetime="2007-01-23T03:29:01+00:00">img</del>.alignright {
   float: right;
   margin: 0.5em 0 0.5em 1em;
}

<del datetime="2007-01-23T03:29:01+00:00">img</del>.center {
   display: block;
   margin: 0.5em auto;
   text-align: center;
}</pre>
<p><ins datetime="2007-01-23T03:29:01+00:00">I deleted the <code>img</code> element prefix from the descriptors above because I agree with Adam&#8217;s comment below. Still not sure about what to do about content columns.</ins></p>
<h3>An all-caps class</h3>
<p>Another that I noticed first in Kubrick and have since seen all over the place is <code>span.caps</code>. I&#8217;m not sure why this came about, but I find it useful enough. It&#8217;s purely presentational.</p>
<pre>span.caps {
   font-variant: small-caps;
}</pre>
<p>This could also be <code>text-transform:uppercase;</code> with essentially the same use. A per theme choice, I suppose.</p>
<h3><abbr title="XHTML Friends Network">XFN</abbr> relationship classes</h3>
<p>I&#8217;m also adding <abbr title="XHTML Friends Network">XFN</abbr> link classes to my theme revisions. Why? Because I&#8217;m fascinated with <a href="http://microformats.org/" title="Microformats" rel="external">Microformats</a>, frankly. I found these great <a href="http://www.factorycity.net/projects/microformats-icons/" title="Microformat icons" rel="external">microformat</a> icons, notably the <abbr title="XHTML Friends Network">XFN</abbr> relationship icons.</p>
<p>Now, there is a more technically accurate way to style links with <abbr title="XHTML Friends Network">XFN</abbr> relationship attributes, as noted on the <a href="http://gmpg.org/xfn/intro" title="XFN: Introduction and Examples" rel="external">XFN intro</a> page:</p>
<pre>a[rel~="friend"]{
   background: url('xfn-friend.png') no-repeat center right;
   margin-right: 2px;
   padding: 2px 26px 2px 0;
}</pre>
<p>But this, of course, requires the browser to be whooly CSS 2.1 compliant, i.e., handle <a href="http://www.w3.org/TR/CSS21/selector.html#attribute-selectors" title="CSS 2.1 attribute selectors" rel="external"><abbr title="Cascading Style Sheet">CSS</abbr> attribute selectors</a>. And can we guess which browser doesn&#8217;t do this? (If you guessed <abbr title="Internet Explorer">IE</abbr>, then you already knew the answer.)</p>
<p>Using attribute selectors in <abbr title="Cascading Style Sheet">CSS</abbr> can cause <abbr title="Internet Explorer">IE</abbr> do all sorts of strange things, like ignore any inline selectors and following descriptors. Which means that not only will <abbr title="Cascading Style Sheet">CSS</abbr> not display an icon (as is set above) but might also screw up following <abbr title="Cascading Style Sheet">CSS</abbr> selectors. It&#8217;s touchy.</p>
<p>So this is my compromise. Which is fine, and forward-compatible:</p>
<pre>a.xfn-friend {
   background: url('xfn-friend.png') no-repeat center right;
   margin-right: 2px;
   padding: 2px 26px 2px 0;
}</pre>
<p>The downfall of this is that it would be undermined if the link had the class but not the <code>rel="friend"</code> attribute. Which would be deception by icon.</p>
<p>Anyhow, those are just the most minor of things I&#8217;ve been considering and I&#8217;d like to hear what others had to say on the subject.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plaintxt.org/2007/01/special-classes-in-themes/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
