<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2chinesetwfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Sivan's Blog</title>
	
	<link>http://lightcss.com</link>
	<description>一念心清凈，走進極樂境。</description>
	<lastBuildDate>Wed, 17 Apr 2013 10:35:59 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sivan" /><feedburner:info uri="sivan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license><image><link>http://lightcss.com/</link><url>http://feeds.feedburner.com/~fc/sivan?bg=99CCFF&amp;amp;fg=444444&amp;amp;anim=0</url><title>Sivan's Blog</title></image><feedburner:emailServiceId>sivan</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://reader.youdao.com/b.do?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://img.feedsky.com/images/icon_subshot02_youdao.gif">订阅到有道</feedburner:feedFlare><feedburner:feedFlare href="http://9.douban.com/reader/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://img.feedsky.com/images/icon_subshot02_douban.gif">订阅到九点</feedburner:feedFlare><feedburner:feedFlare href="http://www.zhuaxia.com/add_channel.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://img.feedsky.com/images/icon_subshot02_zhuaxia.gif">订阅到抓虾</feedburner:feedFlare><feedburner:feedFlare href="http://xianguo.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://xgres.com/static/images/sub/sub_XianGuo_01.gif">订阅到鲜果</feedburner:feedFlare><feedburner:feedFlare href="http://mail.qq.com/cgi-bin/feed?u=http%3A%2F%2Ffeeds.feedburner.com%2Fsivan" src="http://img.feedsky.com/images/icon_subshot02_qq.gif">订阅到 QQ邮箱</feedburner:feedFlare><feedburner:browserFriendly>欢迎订阅我的Blog，主要分享一些互联网应用和我在做博客时的心得。FeedBurner的种子包含我博客的所有文章更新。所以，赶快订阅这里吧！</feedburner:browserFriendly><item>
		<title>在 WebStorm/PhpStorm 中开启对 Compass 的支持</title>
		<link>http://lightcss.com/get-compass-support-in-webstorm-and-phpstorm/</link>
		<comments>http://lightcss.com/get-compass-support-in-webstorm-and-phpstorm/#comments</comments>
		<pubDate>Wed, 13 Mar 2013 13:23:51 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[软件技巧]]></category>
		<category><![CDATA[Compass]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PhpStorm]]></category>
		<category><![CDATA[Sass]]></category>
		<category><![CDATA[SCSS]]></category>
		<category><![CDATA[WebStorm]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=254</guid>
		<description><![CDATA[在最新的 WebStorm/PhpStorm 6 更新中，加入了一系列优秀的前端 &#8230; <a href="http://lightcss.com/get-compass-support-in-webstorm-and-phpstorm/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>在最新的 <a href="http://www.jetbrains.com/webstorm/">WebStorm</a>/<a href="http://www.jetbrains.com/phpstorm/">PhpStorm 6</a> 更新中，加入了一系列优秀的前端开发工具。其中的 File Watchers 功能可以自动编译诸如 Sass、SCSS、LESS、CoffeeScript 和 TypeScript 等预处理器语言。对我来说这是一个非常实用的扩展功能，通过它已经可以替代过去 <a href="http://incident57.com/codekit/">CodeKit</a> 所做的部分工作。但是 File Watchers 目前还缺乏对 Compass 框架的支持，这对使用 Sass/SCSS 的开发者来说影响是非常大的。</p>
<p>下面就说说如何配置 WebStorm/PhpStorm，使其对 Compass 提供良好的支持。<br />
<span id="more-254"></span></p>
<h3>开启 File Watchers 对 Compass 的支持</h3>
<h4>安装 Compass</h4>
<p>首先要确保系统已经安装了 <a href="http://compass-style.org/">Compass</a> （需要 <a href="http://www.ruby-lang.org/zh_cn/downloads/">Ruby</a> 环境）。如果「终端」中不存在 <code>compass</code> 指令则说明 Compass 还未安装，需要执行下面的命令：</p>
<pre><code>$ gem install compass</code></pre>
<h4>在 File Watchers 中添加 Compass 配置文件</h4>
<p>在 WebStorm/PhpStorm 设置里，找到项目设置中的「File Watchers」。点击 [+] 添加配置。可以看到许多内置模板，根据需要选择 SASS 或 SCSS。</p>
<p><img alt="Compass 配置文件" src="http://lightcss.com/wp-content/uploads/2013/03/scss-compass-600x504.png" /></p>
<p>具体配置如下：</p>
<ul>
<li>File type: SASS files 或 SCSS files</li>
<li>Scope: Project Files</li>
<li>Program: bash（Win 下可能是 <code>C:\Ruby\bin\compass.bat</code>）</li>
<li>Arguments: <code>-login -c "compass compile"</code></li>
<li>Working directory: <code>$ProjectFileDir$</code></li>
<li>Output paths: <code>$FileNameWithoutExtension$.css</code> 或留空</li>
</ul>
<p>注意事项：</p>
<ol>
<li>如果遇到奇怪的编译错误，可以把「Arguments」设置为 <code>-login -c "compass clean &amp;&amp; compass compile"</code> 。</li>
<li>「Working directory」必须指向带有 Compass 配置文件 <code>config.rb</code> 的路径。一般在项目根目录，使用 <code>$ProjectFileDir$</code> 即可。</li>
<li>如果你想让输出文件与 SCSS 文件在不同的路径，比如 SCSS 文件在 scss 目录，输出的 CSS 文件在项目根目录，那么只要把「Output paths」设置为 <code>$ProjectFileDir$/$FileNameWithoutExtension$.css</code> 就可以了。其他结构可以根据后面的「Insert macro...」自行设置；</li>
<li>如果觉得自动编译太讨厌，可以把「Immediate files syncchronization」自动编译关掉。</li>
</ol>
<p>确认后保存设置。就可以通过 Compass 自动编译 SCSS 文件了。</p>
<h4>如何忽略指定文件的编译</h4>
<p>比起 CodeKit，File Watchers 还缺少一个快速忽略指定文件编译的功能。你只能采用 <code>_filename.scss</code> 这样在文件名开头加下划线的方式来指定忽略编译这个文件。当然出于模块化考虑，这样的命名方式本身是有好处的。</p>
<h3>取消错误的语法检查</h3>
<p>WebStorm/PhpStorm 默认的语法检查并不支持 Compass 语法，所以 <code>@import "compass";</code> 会被错误警告。</p>
<p>解决方法：在「Project Settings - Inspection」里取消「SASS/SCSS」的「Cannot resolve import into sass/scss file」和「Unresolved mixin」这两个选项就不会乱报错了。</p>
<p>通过上面的设置，WebStorm/PhpStorm 已经可以很好的对 Compass 进行支持了。我想大部分使用 Sass/SCSS 的前端工作者都在用 Compass 框架，也希望 JetBrains 早日加入原生支持。</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2013. 作者：Sivan |
<a href="http://lightcss.com/get-compass-support-in-webstorm-and-phpstorm/">固定链接</a> |
<a href="http://lightcss.com/get-compass-support-in-webstorm-and-phpstorm/#comments">一条评论</a><br />
Tags: <a href="http://lightcss.com/tag/compass/" rel="tag">Compass</a>, <a href="http://lightcss.com/tag/css/" rel="tag">CSS</a>, <a href="http://lightcss.com/tag/phpstorm/" rel="tag">PhpStorm</a>, <a href="http://lightcss.com/tag/sass/" rel="tag">Sass</a>, <a href="http://lightcss.com/tag/scss/" rel="tag">SCSS</a>, <a href="http://lightcss.com/tag/webstorm/" rel="tag">WebStorm</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=DhFWaav35Qc:XA2BzQTLEno:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=DhFWaav35Qc:XA2BzQTLEno:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=DhFWaav35Qc:XA2BzQTLEno:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=DhFWaav35Qc:XA2BzQTLEno:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=DhFWaav35Qc:XA2BzQTLEno:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=DhFWaav35Qc:XA2BzQTLEno:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=DhFWaav35Qc:XA2BzQTLEno:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/get-compass-support-in-webstorm-and-phpstorm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 重构的真相与糟糕的「语义化」新标签</title>
		<link>http://lightcss.com/truth-about-structuring-html5-page/</link>
		<comments>http://lightcss.com/truth-about-structuring-html5-page/#comments</comments>
		<pubDate>Wed, 26 Sep 2012 15:02:39 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=218</guid>
		<description><![CDATA[推荐看看这篇讲 HTML5 重构的文章，说到了目前 HTML5 新标签遇到的诸多 &#8230; <a href="http://lightcss.com/truth-about-structuring-html5-page/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>推荐看看这篇讲 HTML5 重构的文章，说到了目前 HTML5 新标签遇到的诸多问题。<br />
<a title="The truth about structuring an HTML5 page" href="http://www.netmagazine.com/features/truth-about-structuring-html5-page  " target="_blank">http://www.netmagazine.com/features/truth-about-structuring-html5-page</a></p>
<p><span id="more-218"></span>“We shouldn’t use them.” 一句道破 HTML5 新标签面临的许多窘境。当你真正采用它们重构一个大型项目时，往往会发现这些所谓的“语义化”新标签是多么矛盾和啰嗦。尤其是对有代码洁癖、选择强迫症的人来书，会带来了一堆棘手的问题。</p>
<hr />
Update 2013.02.25：这不~本文发布后短短几个月，名为 <code>&lt;main&gt;</code>、<code>&lt;template&gt;</code> 的新标签又蹦出来了。</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/truth-about-structuring-html5-page/">固定链接</a> |
<a href="http://lightcss.com/truth-about-structuring-html5-page/#comments">3 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/html5/" rel="tag">HTML5</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=EYpFdtfusMw:OIonUew9pY8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=EYpFdtfusMw:OIonUew9pY8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=EYpFdtfusMw:OIonUew9pY8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=EYpFdtfusMw:OIonUew9pY8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=EYpFdtfusMw:OIonUew9pY8:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=EYpFdtfusMw:OIonUew9pY8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=EYpFdtfusMw:OIonUew9pY8:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/truth-about-structuring-html5-page/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>【视频】《Perfect Workflow in Sublime Text 2》视频教程全集打包</title>
		<link>http://lightcss.com/improve-workflow-in-sublime-text-2-video-course/</link>
		<comments>http://lightcss.com/improve-workflow-in-sublime-text-2-video-course/#comments</comments>
		<pubDate>Wed, 26 Sep 2012 05:26:42 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[软件技巧]]></category>
		<category><![CDATA[Sublime Text 2]]></category>
		<category><![CDATA[视频]]></category>
		<category><![CDATA[视频教程]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=217</guid>
		<description><![CDATA[Sublime Text 2 是今年非常火的一款编辑器，这款轻便的编辑器提供了诸 &#8230; <a href="http://lightcss.com/improve-workflow-in-sublime-text-2-video-course/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Sublime Text 2 是今年非常火的一款编辑器，这款轻便的编辑器提供了诸多功能实用的功能，「tutsplus」也做了一套教程，可以深入了解这款编辑器的各种功能。在线看的话有点慢，所以我把它打包到网盘了，如有失效请告知。</p>
<p>目录见这里：<a href="https://tutsplus.com/course/improve-workflow-in-sublime-text-2/" rel="nofollow" target="_blank">https://tutsplus.com/course/improve-workflow-in-sublime-text-2/</a></p>
<p>百度网盘打包下载：<br />
<a href="http://pan.baidu.com/share/link?shareid=61833&amp;uk=1479479056" rel="nofollow" target="_blank">http://pan.baidu.com/share/link?shareid=61833&amp;uk=1479479056</a></p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/improve-workflow-in-sublime-text-2-video-course/">固定链接</a> |
<a href="http://lightcss.com/improve-workflow-in-sublime-text-2-video-course/#comments">6 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/sublime-text-2/" rel="tag">Sublime Text 2</a>, <a href="http://lightcss.com/tag/video/" rel="tag">视频</a>, <a href="http://lightcss.com/tag/video-course/" rel="tag">视频教程</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=VxSulP606-U:OIa2ndey2Ss:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=VxSulP606-U:OIa2ndey2Ss:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=VxSulP606-U:OIa2ndey2Ss:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=VxSulP606-U:OIa2ndey2Ss:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=VxSulP606-U:OIa2ndey2Ss:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=VxSulP606-U:OIa2ndey2Ss:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=VxSulP606-U:OIa2ndey2Ss:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/improve-workflow-in-sublime-text-2-video-course/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>从右键菜单快速在 Sublime Text 2 中打开目录</title>
		<link>http://lightcss.com/right-click-open-with-sublime-text-2/</link>
		<comments>http://lightcss.com/right-click-open-with-sublime-text-2/#comments</comments>
		<pubDate>Tue, 25 Sep 2012 13:28:28 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Sublime Text 2]]></category>
		<category><![CDATA[服务]]></category>
		<category><![CDATA[编辑器]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=211</guid>
		<description><![CDATA[在《Perfect Workflow in Sublime Text》系列视频中 &#8230; <a href="http://lightcss.com/right-click-open-with-sublime-text-2/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>在《<a title="打开《Perfect Workflow in Sublime Text》系列视频" href="http://net.tutsplus.com/articles/news/perfect-workflow-in-sublime-text-free-course/" target="_blank">Perfect Workflow in Sublime Text</a>》系列视频中，我看到了第三讲通过 Mac OSX 的「系统服务」快速在 Sublime Text 2 中打开目录的方法。跟着试了一遍，总是出错，其实还有更简单的方法，使用「Automator」自带的「打开 Finder 项目」模板即可。<br />
<span id="more-211"></span></p>
<ol>
<li>首先打开「Automator」，在弹出的文稿类型中选「服务」；</li>
<li>在左侧的模板栏搜索「Finder」，找到「打开 Finder 项目」，拖到右侧空白区域；<br />
<img class="alignnone size-full wp-image-213" title="automator-02" src="http://lightcss.com/wp-content/uploads/2012/09/automator-02.jpg" alt="" width="541" height="306" /></li>
<li>设置打开方式为「Sublime Text 2」，上面设定为“服务”收到选定的「文件或文件夹」位于「Finder」；<br />
<img class="alignnone size-medium wp-image-214" title="automator-03" src="http://lightcss.com/wp-content/uploads/2012/09/automator-03-600x172.jpg" alt="" width="600" height="172" /></li>
<li>保存项目，在目录或文件上右键就可看到「在 Sublime Text 2 打开」的快捷方式了。<br />
<img class="alignnone size-full wp-image-215" title="automator-04" src="http://lightcss.com/wp-content/uploads/2012/09/automator-04.jpg" alt="" width="300" height="185" /></li>
</ol>
<p>如果「系统服务」项目太多出现了二级菜单，可以到「系统偏好设置…」-「键盘」-「服务」中去掉不需要的选项。</p>
<p>p.s. 活用「Automator」可以轻松实现更多功能。</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/right-click-open-with-sublime-text-2/">固定链接</a> |
<a href="http://lightcss.com/right-click-open-with-sublime-text-2/#comments">2 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/osx/" rel="tag">Mac OS X</a>, <a href="http://lightcss.com/tag/sublime-text-2/" rel="tag">Sublime Text 2</a>, <a href="http://lightcss.com/tag/service/" rel="tag">服务</a>, <a href="http://lightcss.com/tag/editor/" rel="tag">编辑器</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=KwARuljIEfw:tOuyccAxOrg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=KwARuljIEfw:tOuyccAxOrg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=KwARuljIEfw:tOuyccAxOrg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=KwARuljIEfw:tOuyccAxOrg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=KwARuljIEfw:tOuyccAxOrg:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=KwARuljIEfw:tOuyccAxOrg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=KwARuljIEfw:tOuyccAxOrg:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/right-click-open-with-sublime-text-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>一种通过伪元素实现的更好的图片替换技术</title>
		<link>http://lightcss.com/better-image-replacement-technique/</link>
		<comments>http://lightcss.com/better-image-replacement-technique/#comments</comments>
		<pubDate>Mon, 17 Sep 2012 13:02:20 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=205</guid>
		<description><![CDATA[昨天收到一条垃圾评论，内容是「多更新，要不然还以为您老人家去保卫钓鱼岛了呢」。所 &#8230; <a href="http://lightcss.com/better-image-replacement-technique/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<blockquote><p>昨天收到一条垃圾评论，内容是「多更新，要不然还以为您老人家去保卫钓鱼岛了呢」。所以今天说什么也得写一篇证明我还没那么热血。</p></blockquote>
<p>在过去很长一段时间里，我们都习惯用负值 <code>text-indent</code> 的方法来进行图片替换。在最新的 HTML5 Boilerplate 中，我看到了一种新的图片替换技术。它采用 CSS 伪元素来实现，相对于以前的图片替换技术，它很好的解决一些手机浏览器的 bug，且没有属性覆盖的问题，并且不需要额外的标签。<br />
<span id="more-205"></span></p>
<pre class="prettyprint linenums"><code class="language-css">.ir {
    overflow: hidden;
    *text-indent: -999em;
}

.ir:before {
    content: "";
    display: block;
    width: 0;
    height: 100%;
}</code></pre>
<p>在下面的范例中可以看到，伪元素设定为块元素，高度同容器一致，所以把文字顶到第二排去了，再结合 <code>overflow:hidden;</code> 将溢出的部分隐藏掉。面对不支持 <code>:before</code> 伪元素的 IE6/7，采用传统的负值 <code>text-indent</code> 方法。需要注意的是，采用这个图片替换技术后不能再对该元素设置 <code>padding-bottom</code>，否则文字会显示出来一部分。</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/Sivan/GfhVW/embedded/result/" allowfullscreen="allowfullscreen" frameborder="0"></iframe></p>
<p>这个图片替换的技术可以替换所有元素的背景（IE8+），不会出现需要 <code>!important</code> 的情况，对 SEO 非常友好，且向下兼容至 IE6。没有什么学习成本，现在就可以在自己的项目中换上这个技术了。</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/better-image-replacement-technique/">固定链接</a> |
<a href="http://lightcss.com/better-image-replacement-technique/#comments">2 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/css/" rel="tag">CSS</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=UDHjnUxwFq0:i-bpSyx8Nf8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=UDHjnUxwFq0:i-bpSyx8Nf8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=UDHjnUxwFq0:i-bpSyx8Nf8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=UDHjnUxwFq0:i-bpSyx8Nf8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=UDHjnUxwFq0:i-bpSyx8Nf8:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=UDHjnUxwFq0:i-bpSyx8Nf8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=UDHjnUxwFq0:i-bpSyx8Nf8:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/better-image-replacement-technique/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>通过 CSS3 根据子元素数量为其定义不同样式</title>
		<link>http://lightcss.com/styling-children-based-on-their-number-with-css3/</link>
		<comments>http://lightcss.com/styling-children-based-on-their-number-with-css3/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 09:10:55 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=192</guid>
		<description><![CDATA[在 LEA VEROU 的博客翻到这么一篇文章——《Styling childr &#8230; <a href="http://lightcss.com/styling-children-based-on-their-number-with-css3/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>在 LEA VEROU 的博客翻到这么一篇文章——<a title="Styling children based on their number, with CSS3" href="http://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/">《Styling children based on their number, with CSS3》</a>。原文谈到使用“:nth-child 伪类元素选择器”的方法在 2009 年被提出，LEA VEROU 又通过普通相邻选择器（General sibling combinator<sup><a href="#sup1">[1]</a></sup>）改良了一下。最终的代码很酷。</p>
<h3 style="clear:none;">内容介绍</h3>
<p>标题写的有些拗口，看看下面的例子应该可以明白。主要作用是无论父元素有多少子元素，都根据子元素的数量设定样式，而无需使用任何 class。<br />
<span id="more-192"></span></p>
<h4>主要代码</h4>
<pre class="prettyprint linenums"><code class="language-css">/* one item */
li:first-child:nth-last-child(1) {
	width: 100%;
}

/* two items */
li:first-child:nth-last-child(2),
li:first-child:nth-last-child(2) ~ li {
	width: 50%;
}

/* three items */
li:first-child:nth-last-child(3),
li:first-child:nth-last-child(3) ~ li {
	width: 33.3333%;
}

/* four items */
li:first-child:nth-last-child(4),
li:first-child:nth-last-child(4) ~ li {
	width: 25%;
}</code></pre>
<p><code>li:first-child:nth-last-child()</code>部分，<code>:first-child</code>选择了第一个子元素，<code>:nth-last-child()</code>用来判断这个元素属于“几个之一”。<code>li:first-child:nth-last-child(3)</code>即选择属于倒数第三个<code>li</code>的同时还是第一个元素的情况，即共 3 个子元素时的第一个。</p>
<p><code>li:first-child:nth-last-child() ~ li</code>通过普通相邻选择器为第二个之后的所有元素设定样式<sup><a href="#sup2">[2]</a></sup>。</p>
<p><iframe style="width: 100%; height: 280px;" src="http://jsfiddle.net/leaverou/HdfaT/embedded/result,css,html" width="320" height="240"></iframe></p>
<h4>同 table 的区别</h4>
<p>实现类似效果的方法当然不只这一种，最常用的就是表格。LEA VEROU 指出了两点不同之处：</p>
<ol>
<li>表格有着特别的含义，有时并不符合我们需要的语义；</li>
<li>表格对宽度的控制没有上面的灵活（例如上面的方法可以实现子元素不完整填充父元素）。</li>
</ol>
<h4>使用范围</h4>
<p><img class="alignnone size-full wp-image-193" title=":nth-last-child 浏览器支持" src="http://lightcss.com/wp-content/uploads/2012/07/nth-last-child.png" alt=":nth-last-child 浏览器支持" width="402" height="166" /></p>
<p>由于 :nth-child 直到 IE9 才被支持，所以这个技术在移动端使用更加安全。</p>
<h3>相关链接</h3>
<ol>
<li id="sup1">普通相邻选择器（General sibling combinator）<sup>[1]</sup>：<a title="General sibling combinator" href="http://www.w3.org/TR/css3-selectors/#general-sibling-combinators">W3C 相关文档</a>；</li>
<li id="sup2">a~b 和 a+b 的区别<sup>[2]</sup>：<a title="查看 W3C 相关文档" href="http://www.w3.org/TR/selectors/#sibling-combinators">W3C 相关文档</a>；</li>
</ol>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/styling-children-based-on-their-number-with-css3/">固定链接</a> |
<a href="http://lightcss.com/styling-children-based-on-their-number-with-css3/#comments">6 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/css/" rel="tag">CSS</a>, <a href="http://lightcss.com/tag/css3/" rel="tag">CSS3</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=ba3Z-ER1KQY:6YqDntZKg68:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=ba3Z-ER1KQY:6YqDntZKg68:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=ba3Z-ER1KQY:6YqDntZKg68:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=ba3Z-ER1KQY:6YqDntZKg68:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=ba3Z-ER1KQY:6YqDntZKg68:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=ba3Z-ER1KQY:6YqDntZKg68:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=ba3Z-ER1KQY:6YqDntZKg68:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/styling-children-based-on-their-number-with-css3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>使用 Better Touch Tool 和 Jitouch 让 Magic Mouse 更好地工作</title>
		<link>http://lightcss.com/make-magic-mouse-work-better/</link>
		<comments>http://lightcss.com/make-magic-mouse-work-better/#comments</comments>
		<pubDate>Sun, 03 Jun 2012 13:12:37 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[软件技巧]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=175</guid>
		<description><![CDATA[前段时间我的 Logitech V470 鼠标左键坏掉了，由于自己之前拆开清过灰 &#8230; <a href="http://lightcss.com/make-magic-mouse-work-better/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>前段时间我的 Logitech V470 鼠标左键坏掉了，由于自己之前拆开清过灰，所以失去了保修。把它扔到墙角吃灰后，从同事那借来了 Magic Mouse 一用。Magic Mouse 是苹果推出的一款蓝牙触控鼠标，借助下面两款小工具，可以实现许多不错的功能，让它增色不少。<br />
<span id="more-175"></span></p>
<h3>Jitouch 2</h3>
<p><a title="打开 Jitouch 主页" href="http://www.jitouch.com/">Jitouch</a> 是一款售价 $6.99 的 Magic Mouse/Trackpad 增强工具，对 Magic Mouse 上的手势识别率非常高，此外还可以设置触控板的一些增强手势。可以说不光是 Magic Mouse 用户，所有 MacBook 用户都值得一用。</p>
<p>我的 Jitouch for Magic Mouse 设置如下（图1）：</p>
<div id="attachment_177" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-177" title="Jitouch" src="http://lightcss.com/wp-content/uploads/2012/06/jitouch-01.png" alt="图一" width="600" height="507" /><p class="wp-caption-text">此图设置为拇指区域为中键；三指上下左右滑动分别对应“显示桌面”、“Mission Control”、“前一个标签”、“后一个标签”</p></div>
<p>我的 Jitouch for Trackpad 设置如下（图2）：</p>
<div id="attachment_178" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-178" title="Jitouch-2" src="http://lightcss.com/wp-content/uploads/2012/06/jitouch-02.png" alt="图2" width="600" height="507" /><p class="wp-caption-text">三指上下左右滑动分别为：滚到顶部、滚到底部、前一个标签、后一个标签。</p></div>
<p>Jitouch 尽管是个收费应用，但是由于识别准确度较高，还是值得一用的。</p>
<h3>Better Touch Tool</h3>
<p>俗称“BTT”的免费鼠标/触控板增强工具。由于 Jitouch 不支持 Magic Mouse 左右键区域轻拍的动作，所以需要用 Better Touch Tool 来弥补一下。<br />
<img class="alignnone size-medium wp-image-176" title="Better Touch Tool" src="http://lightcss.com/wp-content/uploads/2012/06/bettertouchtool-600x420.jpg" alt="图三" width="600" height="420" /></p>
<p>需要注意的是，BTT 对 Magic Mouse 内置动作的识别似乎不是很灵敏。有时候因为识别不出反而让人感到火大，所以不用 Magic Mouse 的朋友我建议只用 Jitouch 即可。</p>
<h3>最终效果</h3>
<p>在同时开启这两款插件后，基本实现了下面的功能：</p>
<ul>
<li>Magic Mouse 左键、右键区域轻触即可按下；</li>
<li>Magic Mouse 中心区域滑动等同鼠标四向滚轮；</li>
<li>Magic Mouse 拇指区域对应鼠标中间；</li>
<li>Magic Mouse 实现快速切换标签；</li>
<li>更多的触控板手势：三指代表应用手势，四指代表系统手势。</li>
</ul>
<p>总算让 Magic Mouse 在功能上丰富了一些，也不用一直按硬梆梆的按键了，所有操作全部触控搞定。</p>
<p>不过我最后要说的是，由于 Magic Mouse 定位不准和手感不太好的原因，我在使用一周后还是重新买了有线鼠标 Razer DeathAdder 来使用，Better Touch Tool 我也卸了。</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/make-magic-mouse-work-better/">固定链接</a> |
<a href="http://lightcss.com/make-magic-mouse-work-better/#comments">没有评论</a><br />
Tags: <a href="http://lightcss.com/tag/osx/" rel="tag">Mac OS X</a>, <a href="http://lightcss.com/tag/software/" rel="tag">Software</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=jH4Xp-D0nKg:cNUIBy4lyM4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=jH4Xp-D0nKg:cNUIBy4lyM4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=jH4Xp-D0nKg:cNUIBy4lyM4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=jH4Xp-D0nKg:cNUIBy4lyM4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=jH4Xp-D0nKg:cNUIBy4lyM4:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=jH4Xp-D0nKg:cNUIBy4lyM4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=jH4Xp-D0nKg:cNUIBy4lyM4:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/make-magic-mouse-work-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>去掉 Evernote Clearly 在 Chrome 右键菜单中的选项</title>
		<link>http://lightcss.com/evernote-clearly-context-menu/</link>
		<comments>http://lightcss.com/evernote-clearly-context-menu/#comments</comments>
		<pubDate>Thu, 31 May 2012 03:43:44 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[软件技巧]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Evernote]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=169</guid>
		<description><![CDATA[Evernote Clearly（中文版名为“印象笔记·悦读”）是一个提高网页阅 &#8230; <a href="http://lightcss.com/evernote-clearly-context-menu/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a title="打开 Evernote Clearly 英文官网" href="http://evernote.com/clearly/">Evernote Clearly</a>（中文版名为“<a title="打开印象笔记·悦读官网" href="https://www.yinxiang.com/clearly/">印象笔记·悦读</a>”）是一个提高网页阅读体验的浏览器插件，它可以将网页快速过滤到多余内容，让你安心阅读正文。功能类似于 <a title="打开 Readability 官网" href="http://www.readability.com/">Readability</a>，但是 Clearly 本地转换，速度快了很多。</p>
<p>美中不足的是 <a title="下载 Evernote Clearly for Chrome" href="https://chrome.google.com/webstore/detail/iooicodkiihhpojmmeghjclgihfjdjhj/details">Chrome 版插件</a>在工具栏有一个按钮，也支持快捷键，却还加了一个不能去掉的右键菜单项，每次看见这个多余的东西都难受。</p>
<p>去掉的方法很简单：<br />
<span id="more-169"></span></p>
<ol>
<li>进入 Chrome 扩展文件夹的 “iooicodkiihhpojmmeghjclgihfjdjhj”目录；<br />
<img class="alignnone size-medium wp-image-170" title="插件路径" src="http://lightcss.com/wp-content/uploads/2012/05/evernote-clearly-1-600x210.png" alt="图1" width="600" height="210" /></li>
<li>用编辑器打开 background.html 文件，注释掉 26 行～34 行有关“context menu”的代码（不同版本可能位置不一样）；<br />
<img class="alignnone size-medium wp-image-171" title="注释掉图中选定的代码" src="http://lightcss.com/wp-content/uploads/2012/05/evernote-clearly-2-600x362.png" alt="图2" width="600" height="362" /></li>
<li>保存文件，重启 Chrome 即可看到效果。</li>
<li>注：每次插件升级都需要重新修改。</li>
</ol>
<p>去掉后右键菜单终于变干净了，心里舒服多了。当然我更希望官方可以提供隐藏右键菜单的设定，因为 Evernote Clipper 是有这个设定的。</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/evernote-clearly-context-menu/">固定链接</a> |
<a href="http://lightcss.com/evernote-clearly-context-menu/#comments">3 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/chrome/" rel="tag">Chrome</a>, <a href="http://lightcss.com/tag/evernote/" rel="tag">Evernote</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=fE_bS0LkqVk:-67O4RqAQzc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=fE_bS0LkqVk:-67O4RqAQzc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=fE_bS0LkqVk:-67O4RqAQzc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=fE_bS0LkqVk:-67O4RqAQzc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=fE_bS0LkqVk:-67O4RqAQzc:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=fE_bS0LkqVk:-67O4RqAQzc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=fE_bS0LkqVk:-67O4RqAQzc:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/evernote-clearly-context-menu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Mac]使用系统自带的词典程序快速取词翻译</title>
		<link>http://lightcss.com/mac-dictionary/</link>
		<comments>http://lightcss.com/mac-dictionary/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 08:46:56 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=157</guid>
		<description><![CDATA[在 Win 时代，我最爱的词典工具是 Lingoes，免费而且可以快速取词。在  &#8230; <a href="http://lightcss.com/mac-dictionary/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>在 Win 时代，我最爱的词典工具是 Lingoes，免费而且可以快速取词。在 Mac 下我却一直找不到一个好用的词典程序，以至于在浏览器里保存了一个“QQ 词典”的 Bookmarklet。后来才发现最好用的东西，原来一直在自己手里。苹果系统自带的词典就非常好用，可以添加词典并支持屏幕快速取词，非常方便。</p>
<p><img class="size-full wp-image-158" title="屏幕取词" src="http://lightcss.com/wp-content/uploads/2012/02/mac-dictionary-01.png" alt="" width="507" height="329" /><br />
<span id="more-157"></span></p>
<h3>安装中文词典</h3>
<p>Mac 系统词典默认没有英汉词典，目前可使用 DictUnifier 导入星际译王的词库。</p>
<p><img class="size-full wp-image-159" title="DictUnifier" src="http://lightcss.com/wp-content/uploads/2012/02/mac-dictionary-02.png" alt="" width="334" height="228" /></p>
<p><a title="打开 DictUnifier 主页" href="http://code.google.com/p/mac-dictionary-kit/">DictUnifier</a> 这个小工具可以快速转换星际译王的词典并自动添加到系统中。只需在<a title="打开星际译王词库" href="http://abloz.com/huzheng/stardict-dic/zh_CN/">星际译王词库</a>下载词典后，拖入 DictUnifier 转换（直接将 .tar.bz2 的压缩包拖进去）， 然后等待解压转换至完成（耗时约十几分钟，需耐心等待）。</p>
<p>推荐《朗道英汉字典》、《牛津现代英汉双解词典》、《现代汉语词典（修正版）》这三个词典。现代汉语词典上中学时应该都买过，方便查生僻字词的解释和拼音。如果需要删除词典，到“~/Library/Dictionaries”目录删除对应的 .dictionary 文件即可。</p>
<p><img class="alignnone size-full wp-image-161" title="调整词库" src="http://lightcss.com/wp-content/uploads/2012/02/mac-dictionary-03.png" alt="" width="479" height="338" /></p>
<p>安装后在“字典”的“偏好设置”里调整词典的查询顺序，把本地词典都放在前面，最后放个维基百科可以在线查询更多解释。</p>
<h3>鼠标取词</h3>
<p>在任何文字区域上按下 control+cmd+D 就可呼出取词窗口，词典会根据鼠标的位置自动取词（不用启动词典程序哦～）。当然你也可以先选定字词再按快捷键获取更精确的查询内容，非常方便。我试了 Safari、Chrome、QQ、Sublime Text 2 等都支持系统自带的鼠标取词，Firefox 目前还不可以。</p>
<p><img class="alignnone size-full wp-image-162" title="鼠标选定后取词" src="http://lightcss.com/wp-content/uploads/2012/02/mac-dictionary-04.png" alt="" width="374" height="328" /></p>
<h3>更多使用</h3>
<p>在 Spotlight 中，也可以快速通过系统词典查询词汇。而安装 Alfred 的用户亦可直接从中查询，呼出 Alfred 后输入“define + 词语”即可。</p>
<p><img class="alignnone size-medium wp-image-163" title="Alfred" src="http://lightcss.com/wp-content/uploads/2012/02/mac-dictionary-05-600x206.png" alt="" width="600" height="206" /></p>
<p>如果你有其他心得，不妨交流一下 <img src='http://lightcss.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>-- EOF --</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2012. 作者：Sivan |
<a href="http://lightcss.com/mac-dictionary/">固定链接</a> |
<a href="http://lightcss.com/mac-dictionary/#comments">21 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/software/" rel="tag">Software</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=6ERdJTK-wjA:zr2QzYQXnDg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=6ERdJTK-wjA:zr2QzYQXnDg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=6ERdJTK-wjA:zr2QzYQXnDg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=6ERdJTK-wjA:zr2QzYQXnDg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=6ERdJTK-wjA:zr2QzYQXnDg:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=6ERdJTK-wjA:zr2QzYQXnDg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=6ERdJTK-wjA:zr2QzYQXnDg:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/mac-dictionary/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>解除网页禁止右键和禁止选字的 Bookmarklet</title>
		<link>http://lightcss.com/a-bookmarklet-to-unlock-right-button/</link>
		<comments>http://lightcss.com/a-bookmarklet-to-unlock-right-button/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 12:33:12 +0000</pubDate>
		<dc:creator>Sivan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Bookmarklet]]></category>

		<guid isPermaLink="false">http://lightcss.com/?p=155</guid>
		<description><![CDATA[很多网站为了防止别人复制内部的文字，都使用了 oncontextmenu 来防止 &#8230; <a href="http://lightcss.com/a-bookmarklet-to-unlock-right-button/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>很多网站为了防止别人复制内部的文字，都使用了 oncontextmenu 来防止右键。但是想快速看看他写的代码也有点麻烦，所以我写了段 js 来解除，只要把下面的链接拖到书签栏就可以快速使用了，不包成功。</p>
<p><a href="javascript:body = document.getElementsByTagName('body')[0];body.setAttribute('oncontextmenu','return true');body.setAttribute('onmousedown','return true');body.setAttribute('onselectstart','return true');body.setAttribute('onpaste','return true');">全部解除</a></p>
<p>使用后可以解除右键、选择拖动和粘贴的锁定。</p>
<hr />
<p><small>Copyright &copy; <a href="http://lightcss.com">Sivan&#039;s Blog</a>, 2011. 作者：Sivan |
<a href="http://lightcss.com/a-bookmarklet-to-unlock-right-button/">固定链接</a> |
<a href="http://lightcss.com/a-bookmarklet-to-unlock-right-button/#comments">9 条评论</a><br />
Tags: <a href="http://lightcss.com/tag/bookmarklet/" rel="tag">Bookmarklet</a>, <a href="http://lightcss.com/tag/javascript/" rel="tag">JavaScript</a></small></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sivan?a=5eE3OBggdTA:eR8aP4XFQfU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sivan?i=5eE3OBggdTA:eR8aP4XFQfU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=5eE3OBggdTA:eR8aP4XFQfU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sivan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=5eE3OBggdTA:eR8aP4XFQfU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/sivan?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=5eE3OBggdTA:eR8aP4XFQfU:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/sivan?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=5eE3OBggdTA:eR8aP4XFQfU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/sivan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sivan?a=5eE3OBggdTA:eR8aP4XFQfU:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/sivan?d=YwkR-u9nhCs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://lightcss.com/a-bookmarklet-to-unlock-right-button/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
