Skip to content

Instantly share code, notes, and snippets.

View hileon's full-sized avatar

Leon Zhang hileon

View GitHub Profile
@hileon
hileon / base.css
Created August 4, 2010 01:20 — forked from sofish/base.css
css reset
@charset "utf-8";
/*
@名称: base
@功能: 重设浏览器默认样式
@例子: null
*/
/* 防止用户自定义背景颜色对网页的影响 */
html{
@hileon
hileon / _css3.scss
Created March 27, 2012 03:49
LESSCSS CSS3 Mixins
///*---------------------------------------------------------------------*/
.mixin-border-radius(@topleft:5px,@topright:5px,@bottomright:5px,@bottomleft:5px) {
border-top-left-radius: @topleft;
border-top-right-radius: @topright;
border-bottom-right-radius: @bottomright;
border-bottom-left-radius: @bottomleft;
-moz-border-radius-topleft: @topleft;
-moz-border-radius-topright: @topright;
-moz-border-radius-bottomright: @bottomright;
-moz-border-radius-bottomleft: @bottomleft;
@hileon
hileon / h5bp-twitter-bootstrap
Created March 27, 2012 03:37 — forked from paulirish/h5bp-twitter-bootstrap
h5bp + twitter bootstrap integration
#!/bin/sh
echo "
Cool, let's start.
"
src=$PWD
@hileon
hileon / dabblet.css
Created March 27, 2012 03:47
CSS3 selectors
/**
* CSS3 selectors
*/
p:first-child {
color: blue;
}
p:last-child {
color: red;
@hileon
hileon / roundedCorners.less
Created March 27, 2012 04:05 — forked from jackreichert/roundedCorners.less
LessCSS Rounded Corners
.rounded-corners (@radius: 5px) {
border-radius: @radius;
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
}

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@hileon
hileon / mixins.less
Created March 27, 2012 04:07 — forked from andreruffert/mixins.less
LESS CSS mixins Collection
.border-radius(@radius:15px)
{
-webkit-border-radius:@radius;
-moz-border-radius:@radius;
border-radius:@radius;
}
.multi-rounded-corners(@topLeft: 5px, @topRight: 5px, @bottomRight: 5px, @bottomLeft: 5px)
{
-webkit-border-radius: @topLeft @topRight @bottomRight @bottomLeft;
@hileon
hileon / common.less
Created March 27, 2012 04:07 — forked from danieleli/common.less
less / css - common functions
.clear_margin_padding() {
margin: 0 !important;
padding: 0 !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.rounded-corners (@radius: 5px) {
border-radius: @radius;
-webkit-border-radius: @radius;
@hileon
hileon / git-cheatsheet.mkd
Created March 27, 2012 04:13 — forked from javifr/git-cheatsheet.mkd
git cheatsheet

GIT CHEATSHEET

De una máquina a otra en la misma red

( siendo xxxx ip de la máquina y YYYYYY carpeta del repo )
CLONE
git clone -u /usr/local/git/bin/git-upload-pack ssh://XXXXXXX/users/javier/Sites/YYYYYYYYY

PULL
git pull --upload-pack /usr/local/git/bin/git-upload-pack ssh://XXXXXXX/users/javier/Sites/YYYYYYYYY

@hileon
hileon / gist:2212834
Created March 27, 2012 05:33 — forked from palimadra/gist_template
ZenCoding Cheatsheet

syntax

  • ID and CLASS attributes: div*page.section.main.
  • Custom attributes: div[title], a[title="Hello world" rel], td[colspan=2].
  • Element multiplication: li*5 will output <li> tag five times.
  • Item numbering with $ character: li.item$*3 will output <li> tag three times, replacing $ character with item number.
  • Multiple $ characters in a row are used as '''zero padding''', i.e.: li.item$$$li.item001
  • Abbreviation groups with unlimited nesting: div*page>(div*header>ul*nav>li*4>a)+(div*page>(h1>span)+p*2)+div*footer. You can literally write a full document markup with just a single line. *Filters support div tag name can be omitted when writing element starting from ID or CLASS: *content>.section is the same as div*content>div.section.
  • (v0.7) Text support: p>{Click }+a{here}+{ to continue}.