Skip to content

Instantly share code, notes, and snippets.

View andrexduarte's full-sized avatar

André Duarte andrexduarte

View GitHub Profile
@mixin mobile_bg($file){
background-image: image-url('mobile/standard/#{$file}');
@media screen and (-webkit-min-device-pixel-ratio: 2) {
background-image: image-url('mobile/retina/#{$file}');
background-size: image-width('mobile/standard/#{$file}') image-height('mobile/standard/#{$file}');
}
}
// Usage
// Placeholder @mixin for Sass
//
// A mixin to style placeholders in HTML5 form elements.
// Includes also a .placeholder class to be used with a polyfill e.g.
// https://github.com/mathiasbynens/jquery-placeholder
// Requires Sass 3.2.
//
// Example usage (.scss):
//
// input {
// blog post: http://blog.slashpoundbang.com/post/15096433153/css3-scss-mixins
// Mixins ----------------------------------------------------------------------
// http://css3please.com/
@mixin background-rgba($red, $green, $blue, $opacity, $rgba) {
background-color: transparent;
background-color: rgba($red, $green, $blue, $opacity);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$rgba}',endColorstr='#{$rgba}');
zoom: 1;
}
$(function(){
var $quote = $(".post p:first");
var $numWords = $quote.text().split(" ").length;
if (($numWords >= 1) && ($numWords < 10)) {
$quote.css("font-size", "36px");
}
else if (($numWords >= 10) && ($numWords < 20)) {
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
$(".more").click(function() {
var txt = $(".clip").is(':visible') ? 'Saiba mais' : 'Esconder';
$(".more").text(txt);
$(".clip").slideToggle();
});
/*------------------------------------*\
$NAV
\*------------------------------------*/
/*
TAGS: ^lists ^navigation ^text
*/
/*
As per csswizardry.com/2011/09/the-nav-abstraction
*/
.nav{
@andrexduarte
andrexduarte / browser-hacks.css
Created November 26, 2012 17:37
Browser specific hacks
/* -- IE 6 -- */
* html .class { }
/* -- IE 7 -- */
*+html .class{ }
/* -- IE 7 and modern browsers -- */
html>body .class { }
/* -- Modern browsers (not IE 7) -- */
@andrexduarte
andrexduarte / hide-text.css
Created November 21, 2012 16:34
hide text
/* --- Text-indent --- */
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@andrexduarte
andrexduarte / text-rendering.css
Created November 21, 2012 16:25
Text Rendering
/* text rendering */
body * {
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
font-smoothing: antialiased;
}
h1,