Created
August 20, 2012 15:57
-
-
Save cam-gists/3405355 to your computer and use it in GitHub Desktop.
LESS: Mixins + Reset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .text-shadow(@color: #000, @size: 1px){ | |
| text-shadow: @size @size 1px @color; | |
| }/* Eric Meyer's Reset Reloaded *//* http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ */html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, font, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td {margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;vertical-align: baseline;background: transparent;}body {line-height: 1;}ol, ul {list-style: none;}blockquote, q {quotes: none;}/* remember to define focus styles! */:focus {outline: 0;}/* remember to highlight inserts somehow! */ins {text-decoration: none;}del {text-decoration: line-through;}/* tables still need 'cellspacing="0"' in the markup */table {border-collapse: collapse;border-spacing: 0;} | |
| .clearfix:after { | |
| visibility: hidden; | |
| display: block; | |
| font-size: 0; | |
| content: " "; | |
| clear: both; | |
| height: 0; | |
| } | |
| * html .clearfix { zoom: 1; } /* IE6 */ | |
| *:first-child+html .clearfix { zoom: 1; } /* IE7 */ | |
| .text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) { | |
| text-shadow: @string; | |
| } | |
| .box-shadow (@string) { | |
| -webkit-box-shadow: @string; | |
| -moz-box-shadow: @string; | |
| box-shadow: @string; | |
| } | |
| .drop-shadow (@x: 0, @y: 1px, @blur: 2px, @spread: 0, @alpha: 0.25) { | |
| -webkit-box-shadow: @x @y @blur @spread rgba(0, 0, 0, @alpha); | |
| -moz-box-shadow: @x @y @blur @spread rgba(0, 0, 0, @alpha); | |
| box-shadow: @x @y @blur @spread rgba(0, 0, 0, @alpha); | |
| } | |
| .inner-shadow (@x: 0, @y: 1px, @blur: 2px, @spread: 0, @alpha: 0.25) { | |
| -webkit-box-shadow: inset @x @y @blur @spread rgba(0, 0, 0, @alpha); | |
| -moz-box-shadow: inset @x @y @blur @spread rgba(0, 0, 0, @alpha); | |
| box-shadow: inset @x @y @blur @spread rgba(0, 0, 0, @alpha); | |
| } | |
| .box-sizing (@type: border-box) { | |
| -webkit-box-sizing: @type; | |
| -moz-box-sizing: @type; | |
| box-sizing: @type; | |
| } | |
| .border-radius (@radius: 5px) { | |
| -webkit-border-radius: @radius; | |
| -moz-border-radius: @radius; | |
| border-radius: @radius; | |
| -moz-background-clip: padding; | |
| -webkit-background-clip: padding-box; | |
| background-clip: padding-box; | |
| } | |
| .border-radiuses (@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) { | |
| -webkit-border-top-right-radius: @topright; | |
| -webkit-border-bottom-right-radius: @bottomright; | |
| -webkit-border-bottom-left-radius: @bottomleft; | |
| -webkit-border-top-left-radius: @topleft; | |
| -moz-border-radius-topright: @topright; | |
| -moz-border-radius-bottomright: @bottomright; | |
| -moz-border-radius-bottomleft: @bottomleft; | |
| -moz-border-radius-topleft: @topleft; | |
| border-top-right-radius: @topright; | |
| border-bottom-right-radius: @bottomright; | |
| border-bottom-left-radius: @bottomleft; | |
| border-top-left-radius: @topleft; | |
| -moz-background-clip: padding; | |
| -webkit-background-clip: padding-box; | |
| background-clip: padding-box; | |
| } | |
| .opacity (@opacity: 0.5) { | |
| -webkit-opacity: @opacity; | |
| -moz-opacity: @opacity; | |
| opacity: @opacity; | |
| } | |
| .gradient (@startColor: #eee, @endColor: white) { | |
| background-color: @startColor; | |
| background: -webkit-gradient(linear, left top, left bottom, from(@startColor), to(@endColor)); | |
| background: -webkit-linear-gradient(top, @startColor, @endColor); | |
| background: -moz-linear-gradient(top, @startColor, @endColor); | |
| background: -ms-linear-gradient(top, @startColor, @endColor); | |
| background: -o-linear-gradient(top, @startColor, @endColor); | |
| } | |
| .horizontal-gradient (@startColor: #eee, @endColor: white) { | |
| background-color: @startColor; | |
| background-image: -webkit-gradient(linear, left top, right top, from(@startColor), to(@endColor)); | |
| background-image: -webkit-linear-gradient(left, @startColor, @endColor); | |
| background-image: -moz-linear-gradient(left, @startColor, @endColor); | |
| background-image: -ms-linear-gradient(left, @startColor, @endColor); | |
| background-image: -o-linear-gradient(left, @startColor, @endColor); | |
| } | |
| .animation (@name, @duration: 300ms, @delay: 0, @ease: ease) { | |
| -webkit-animation: @name @duration @delay @ease; | |
| -moz-animation: @name @duration @delay @ease; | |
| -ms-animation: @name @duration @delay @ease; | |
| } | |
| .transition (@transition) { | |
| -webkit-transition: @transition; | |
| -moz-transition: @transition; | |
| -ms-transition: @transition; | |
| -o-transition: @transition; | |
| } | |
| .transform(@string){ | |
| -webkit-transform: @string; | |
| -moz-transform: @string; | |
| -ms-transform: @string; | |
| -o-transform: @string; | |
| } | |
| .scale (@factor) { | |
| -webkit-transform: scale(@factor); | |
| -moz-transform: scale(@factor); | |
| -ms-transform: scale(@factor); | |
| -o-transform: scale(@factor); | |
| } | |
| .rotate (@deg) { | |
| -webkit-transform: rotate(@deg); | |
| -moz-transform: rotate(@deg); | |
| -ms-transform: rotate(@deg); | |
| -o-transform: rotate(@deg); | |
| } | |
| .skew (@deg, @deg2) { | |
| -webkit-transform: skew(@deg, @deg2); | |
| -moz-transform: skew(@deg, @deg2); | |
| -ms-transform: skew(@deg, @deg2); | |
| -o-transform: skew(@deg, @deg2); | |
| } | |
| .translate (@x, @y:0) { | |
| -webkit-transform: translate(@x, @y); | |
| -moz-transform: translate(@x, @y); | |
| -ms-transform: translate(@x, @y); | |
| -o-transform: translate(@x, @y); | |
| } | |
| .translate3d (@x, @y: 0, @z: 0) { | |
| -webkit-transform: translate3d(@x, @y, @z); | |
| -moz-transform: translate3d(@x, @y, @z); | |
| -ms-transform: translate3d(@x, @y, @z); | |
| -o-transform: translate3d(@x, @y, @z); | |
| } | |
| .perspective (@value: 1000) { | |
| -webkit-perspective: @value; | |
| -moz-perspective: @value; | |
| -ms-perspective: @value; | |
| perspective: @value; | |
| } | |
| .transform-origin (@x:center, @y:center) { | |
| -webkit-transform-origin: @x @y; | |
| -moz-transform-origin: @x @y; | |
| -ms-transform-origin: @x @y; | |
| -o-transform-origin: @x @y; | |
| } | |
| .round_corner(@radius: 12px){ | |
| -moz-border-radius: @radius; | |
| -webkit-border-radius: @radius; | |
| border-radius: @radius; | |
| } | |
| .round_corner_bottom(@radius: 12px){ | |
| -moz-border-radius-bottomleft: @radius; | |
| -webkit-border-bottom-left-radius: @radius; | |
| border-bottom-left-radius: @radius; | |
| -moz-border-radius-bottomright: @radius; | |
| -webkit-border-bottom-right-radius: @radius; | |
| border-bottom-right-radius: @radius; | |
| } | |
| .gradient-3colors(@from: #444, @middleColor: #ff0000, @to: #999) { | |
| background-color: @from; | |
| background-image: -webkit-gradient( | |
| linear, | |
| left bottom, | |
| left top, | |
| color-stop(0.1, @from), | |
| color-stop(0.50, @middleColor), | |
| color-stop(0.99, @to) | |
| ); | |
| background-image: -moz-linear-gradient(center bottom, @from 1%, @middleColor 50%, @to 99%); | |
| background-image: -webkit-linear-gradient(center bottom, @from 1%, @middleColor 50%, @to 99%); | |
| background-image: -ms-linear-gradient(center bottom, @from 1%, @middleColor 50%, @to 99%); | |
| background-image: -o-linear-gradient(center bottom, @from 1%, @middleColor 50%, @to 99%); | |
| background-image: linear-gradient(center bottom, @from 1%, @middleColor 50%, @to 99%); | |
| } | |
| .shadow(@disp: 10px, @color: #000){ | |
| -moz-box-shadow: 0px 0px @disp @color; | |
| -webkit-box-shadow: 0px 0px @disp @color; | |
| box-shadow: 0px 0px @disp @color; | |
| } | |
| .shadow_rbottom(@disp: 10px, @color: #000){ | |
| -moz-box-shadow: 2px 1px @disp @color; | |
| -webkit-box-shadow: 2px 1px @disp @color; | |
| box-shadow: 2px 1px @disp @color; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment