<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Push cx &#187; css</title>
	<atom:link href="http://push.cx/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://push.cx</link>
	<description>A tea-drinking web geek's coffee-flavored blog</description>
	<lastBuildDate>Fri, 09 Jul 2010 12:37:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How To De-Asshole-ify Links</title>
		<link>http://push.cx/2007/how-to-de-asshole-ify-links</link>
		<comments>http://push.cx/2007/how-to-de-asshole-ify-links#comments</comments>
		<pubDate>Thu, 01 Nov 2007 16:26:30 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[assholes]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[user experience]]></category>

		<guid isPermaLink="false">http://push.cx/2007/how-to-de-asshole-ify-links</guid>
		<description><![CDATA[I loathe sites that set unvisited and visited links to be the same color. There are exactly two reasons that sites do this: A graphic designer thought it would be more harmonious to have them the same color. A business guy thought it would increase pageviews. The worst part is, they&#8217;re both right. But they&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>
I loathe sites that set unvisited and visited links to be the same color. There are exactly two reasons that sites do this:
</p>

<ol>
    <li>A graphic designer thought it would be more harmonious to have them the same color.</li>
    <li>A business guy thought it would increase pageviews.</li>
</ol>

<p>
The worst part is, they&#8217;re both right. But they&#8217;re assholes because they&#8217;re selling out user experience to avoid picking a color or to inflate a not-very-useful statistic. Users are deliberately confused and led to click in circles for their trivial convenience or wrongheaded book-cooking.
</p>

<p>
This boiled over for me when I was trying to read <a href="http://push.cx/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jb3B5YmxvZ2dlci5jb20=">CopyBlogger</a>. They have some really nice writing, but I found myself opening the articles over and over because I couldn&#8217;t see that I&#8217;d visited it. I just gave up on reading the site, who needs assholes?
</p>

<p>
A few days later I remembered that Firefox has a setting in the preferences to override page and link colors. Unfortunately, it doesn&#8217;t let me override link colors and leave page colors alone.
</p>

<p>
The way to do undo the damage these assholes have done to their own site is to add a user stylesheet to Firefox. It&#8217;s a styling file that Firefox loads for every single page you visit. In Linux it&#8217;s <kbd>~/.mozilla/firefox/<i>random junk</i>/chrome/userContent.css</kbd>. On other systems, search for the file <kbd>userContent.css</kbd>, though you may just need to search for the <kbd>chrome</kbd> directory and create the file. Here&#8217;s what to put in there:
</p>

<pre>&nbsp;
p &gt; a <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #000000; font-weight: bold;">blue</span> !important; <span style="color: #000000; font-weight: bold;">text-decoration</span>: <span style="color: #993333;">underline</span> !important; <span style="color: #66cc66;">&#125;</span>
p &gt; a<span style="color: #3333ff;">:visited </span><span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #993333;">purple</span> !important; <span style="color: #000000; font-weight: bold;">text-decoration</span>: <span style="color: #993333;">underline</span> !important; <span style="color: #66cc66;">&#125;</span></pre>

<p>
This forces all unvisited links in the text of a page to be blue and underlined, and all visited links to be purple and underlined. This isn&#8217;t perfect, sometimes the text of a page will be <a href="http://push.cx/wp-content/plugins/feed-statistics.php?url=aHR0cDovL21ldGFmaWx0ZXIuY29t">on a blue background</a>, but it works well for nearly all pages I visit. The best part about is is the <kbd>p &gt;</kbd> keeps it from changing link colors in headers and other parts of the page that are almost never on white backgrounds.
</p> <img src="http://push.cx/wp-content/plugins/feed-statistics.php?view=1&post_id=269" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2007/how-to-de-asshole-ify-links/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tidy Stylesheets in Rails</title>
		<link>http://push.cx/2006/tidy-stylesheets-in-rails</link>
		<comments>http://push.cx/2006/tidy-stylesheets-in-rails#comments</comments>
		<pubDate>Sat, 28 Oct 2006 03:06:06 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[maintainability]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://push.cx/2006/tidy-stylesheets-in-rails</guid>
		<description><![CDATA[It&#8217;s very easy for a site&#8217;s CSS to grow a single giant, brittle stylesheet. It becomes impossible to change anything because of bizarre interactions between elements, unexpected interactions, and simply because it&#8217;s just too big for anyone to understand. Much of programming is managing complexity, and I&#8217;ll share a nice technique in that vein. I [...]]]></description>
			<content:encoded><![CDATA[<p>
It&#8217;s very easy for a site&#8217;s CSS to grow a single giant, brittle stylesheet. It becomes impossible to change anything because of bizarre interactions between elements, unexpected interactions, and simply because it&#8217;s just too big for anyone to understand. Much of programming is managing complexity, and I&#8217;ll share a nice technique in that vein.
</p>

<p>
I like to break down stylesheets so there&#8217;s a site-wide stylesheet with global stylings like fonts, the site&#8217;s template, and common elements. This is the file that metastasizes on you.
</p>

<p>
My solution is to break down stylesheets by controller and action, and Rails makes this quite easy:
</p>

<pre>&nbsp;
<span style="color: #808080; font-style: italic;"># app/views/layout/application.rb</span>
&lt;%= stylesheet_link_tag *<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'global'</span><span style="color: #66cc66;">&#93;</span> + <span style="color: #0000ff;">@stylesheets</span><span style="color: #66cc66;">&#41;</span> %&gt;</pre>

<pre>&nbsp;
<span style="color: #808080; font-style: italic;"># app/controllers/application.rb</span>
class ApplicationController &lt; ActionController::<span style="color: #006600;">Base</span>
  before_filter :add_stylesheets
&nbsp;
  def initialize
    <span style="color: #0000ff;">@stylesheets</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>
  <span style="color: #b1b100;">end</span>
&nbsp;
  def add_stylesheets
    <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">"#{controller_name}/_controller"</span>, <span style="color: #ff0000;">"#{controller_name}/#{action_name}"</span><span style="color: #66cc66;">&#93;</span>.<span style="">each</span> <span style="color: #b1b100;">do</span> |stylesheet|
      <span style="color: #0000ff;">@stylesheets</span> &lt;&lt; stylesheet <span style="color: #b1b100;">if</span> File.<span style="">exists</span>? <span style="color: #ff0000;">"#{Dir.pwd}/stylesheets/#{stylesheet}.css"</span>
    <span style="color: #b1b100;">end</span>
  <span style="color: #b1b100;">end</span>
end</pre>

<p>
This code automatically loads stylesheets for the controller and the action if they exist. The subdivision allows you to make them as compact and specific as possible. If a partial needs its own code, write at the top:
</p>

<pre>&nbsp;
&lt;% <span style="color: #0000ff;">@styleshets</span> &lt;&lt; <span style="color: #ff0000;">"controller/_partial_name"</span> %&gt;</pre>

<p>
Nice and tidy.
</p> <img src="http://push.cx/wp-content/plugins/feed-statistics.php?view=1&post_id=186" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2006/tidy-stylesheets-in-rails/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
