TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Spiffing CSS: the preprocessor made for Brits

60 pointsby dhuramasabout 11 years ago

19 comments

beneschabout 11 years ago
The full list of transformations:<p><pre><code> &#x27;colour&#x27; =&gt; &#x27;color&#x27;, &#x27;grey&#x27; =&gt; &#x27;gray&#x27;, &#x27;!please&#x27; =&gt; &#x27;!important&#x27;, &#x27;transparency&#x27; =&gt; &#x27;opacity&#x27;, &#x27;centre&#x27; =&gt; &#x27;center&#x27;, &#x27;plump&#x27; =&gt; &#x27;bold&#x27;, &#x27;photograph&#x27; =&gt; &#x27;image&#x27;, &#x27;capitalise&#x27; =&gt; &#x27;capitalize&#x27; </code></pre> In case someone actually tries to use this in production (lol), I&#x27;m wouldn&#x27;t trust the transformation to this search&#x2F;replace regex:<p><pre><code> &#x27;&#x2F;(?:(?:\s|\t)*|\;)([\w-]*):&#x2F;i&#x27; </code></pre> You know, considering CSS is context-free &#x27;n all.
评论 #7411248 未加载
评论 #7411230 未加载
评论 #7411511 未加载
martin-adamsabout 11 years ago
Splendid. Makes one feel right at home.<p>However, transparency: 0.5 -&gt; opacity: 0.5 is a very poor example. One would assume that transparency: 1 = opacity: 0.<p>It&#x27;s like putting an example date of 01-01-2014.
评论 #7411181 未加载
vezzy-fnordabout 11 years ago
Don&#x27;t forget to pair it with British PHP: <a href="http://www.addedbytes.com/blog/if-php-were-british/" rel="nofollow">http:&#x2F;&#x2F;www.addedbytes.com&#x2F;blog&#x2F;if-php-were-british&#x2F;</a><p>Now you have a royal web development stack.
评论 #7411283 未加载
评论 #7411274 未加载
languagehackerabout 11 years ago
I usually don&#x27;t mind stupid jokes, but stupid jokes that auto-play music? Big thumbs down.
评论 #7411497 未加载
评论 #7411705 未加载
stevenheidelabout 11 years ago
As a Canadian even, I can&#x27;t count the number of times I wrote &quot;colour&quot; with a &#x27;u&#x27; in my CSS and was surprised when it didn&#x27;t work.
评论 #7411533 未加载
d0mabout 11 years ago
Something I find inconsistent is the &quot;color&quot;, shouldn&#x27;t it be &quot;font-color&quot;? (I definitely could be wrong, I&#x27;m terrible in css)
评论 #7411361 未加载
tonybaroneeeabout 11 years ago
When the music started playing I lost it.
elwellabout 11 years ago
I went ahead and drew up a petition to include these changes in CSS4. Please add your sig!!! <a href="http://bit.ly/1kzxheU" rel="nofollow">http:&#x2F;&#x2F;bit.ly&#x2F;1kzxheU</a>
shortdivabout 11 years ago
As someone who learned british english all the way until high school, I appreciate this. It would&#x27;ve been nice if there was an audio off button though.
randunelabout 11 years ago
I hate websites with sound playing without my consent.
dvidsilvaabout 11 years ago
there are tools that let you create your own preprocessor that are far better than regexp in php.<p><a href="http://createyourproglang.com/" rel="nofollow">http:&#x2F;&#x2F;createyourproglang.com&#x2F;</a><p>Or you can go through sass or less source code and change things :P<p>cool joke tho
Axsuulabout 11 years ago
I&#x27;d imagine this would introduce a lot of unintended side effects.
JoshTriplettabout 11 years ago
Warning: page plays audio.
评论 #7411147 未加载
评论 #7411374 未加载
Ryelabout 11 years ago
5&#x2F;8 people in my office audibly laughed at this.<p>Give me a sec I&#x27;ll fire up the &#x27;ol D3 and give you a statistical analysis of age, gender, race, hair-colour, (noticed I used colour, not color), etc..
batuhanicozabout 11 years ago
This is bloody stupid; it should be able to save compiled CSS file and not compile it at every request. AND WHERE IS THE GRUNT PLUGIN FOR THIS?!1
collywabout 11 years ago
Another London centric view of &quot;Britain&quot;. Roll on Scottish independence.
评论 #7411525 未加载
评论 #7411450 未加载
_dztfabout 11 years ago
Really? Of all things, this is what we need?
jjgreenabout 11 years ago
Top hole!
masswerkabout 11 years ago
fab!
评论 #7411810 未加载