Skip to content

Instantly share code, notes, and snippets.

@sgobin
sgobin / gist:3145316
Created July 19, 2012 17:00
Botões: CSS3 Gradients (degradês) Usando SASS e Darken Firter
/* Variáveis Cores */
$GVCinza: #A7A9AC; /* descanso */
$GVOrange: #F4A330; /* ativo e down */
/* Classe */
a.botao {
color: #FFF;
display: inline-block;
padding: 0.5em 1em 0.4em;
cursor: pointer;
@sgobin
sgobin / select-uf
Last active October 7, 2015 12:28 — forked from mateusreis/gist:2022140
select de estados em formatos variados
<label for="uf">Estado</label>
<select name="uf" id="uf">
<option selected="selected" value="">&nbsp;</option>
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
@sgobin
sgobin / gist:3165578
Created July 23, 2012 19:15
Calcula Idade / Maioridade jQuery
function calculaMaioridade(nasc) {
var hoje = new Date(), idade;
idade = (
(hoje.getMonth() > nasc.getMonth())
||
(hoje.getMonth() == nasc.getMonth() && hoje.getDate() >= nasc.getDate())
) ? hoje.getFullYear() - nasc.getFullYear() : hoje.getFullYear() - nasc.getFullYear()-1;
if (idade > 18) { return true; }
@sgobin
sgobin / gist:3294733
Created August 8, 2012 12:21
Unicode Triângulos
&#x25B2; and &#x25BC; if you can't include Unicode characters directly. (Use UTF-8!)
U+25B2 (Black up-pointing triangle ▲)
U+25BC (Black down-pointing triangle ▼)
U+25C0 (Black left-pointing triangle ◀)
U+25B6 (Black right-pointing triangle ▶)
U+25B3 (White up-pointing triangle △)
U+25BD (White down-pointing triangle ▽)
U+25C1 (White left-pointing triangle ◁)
@sgobin
sgobin / helvetica-neue-light.scss
Last active December 11, 2015 11:48
#Helvetica Neue Light como família para fonte.- Baseado em: http://tumblr.gesteves.com/post/36097597/helvetica-neue-light;- adicionada fonte Segoe UI Light como fallback para Windows.
@mixin fontLight {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "wf_SegoeUILight", "wf_SegoeUI", "Segoe UI", "Roboto Light", sans-serif;
font-weight: 300;
}
@sgobin
sgobin / media-queries-retina.scss
Created January 23, 2013 17:45
Esquema de media queries incluindo Retina Displays (iPhone, iPad). O esquema funciona com "Mobile First", ou seja, é necessário iniciar com os estilos de smartphones e ir "subindo".
// Mobile First
// Médio - landscape smartphones e tablets pequenos
@media screen and (min-width: 28.75em) {
estilos...
}
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@sgobin
sgobin / conversorRWD.scss
Created February 14, 2013 14:14
Mixing converter medidas fixas em responsivas ou encontrar o valor baseado no contexto. Um mixing para % e outro para ems.
// Converte para em
@function re($target, $context){
@return ($target/$context)+0em;
}
// Converte para %
@function rp( $target, $context ) {
@return $target / $context * 100%;
}
@sgobin
sgobin / _gridSgobin.scss
Last active December 18, 2015 23:29
Um mínimo grid para importar por SCSS. Pode ser fixo ou responsivo.
/* RESETS */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
/**********
Variaveis
**********/
$gridPad: 10px;
/*******************
@sgobin
sgobin / menu.html
Created December 19, 2013 16:27
Menu Dropdown Ativo por Clique
<ul class="menu">
<li><a href="javascript:;">Home</a></li>
<li class="tem-submenu"><a href="javascript:;">Viagens para o Peru</a>
<div class="submenu">
<ul>
<li><a href="#">Peru</a></li>
<li><a href="#">Peru &amp; Argentina</a></li>
<li><a href="#">Peru &amp; Amazônia</a></li>
</ul>
<ul>