Skip to content

Instantly share code, notes, and snippets.

View pablolobos's full-sized avatar

Pablo Lobos pablolobos

View GitHub Profile
@pablolobos
pablolobos / scss_vertical-center.scss
Created February 11, 2015 12:45
scss_vertical-center.scss
@mixin vertically-centred
{
display: flex;
align-items: center;
justify-content: center;
}
@pablolobos
pablolobos / scss_sass-create-classes.scss
Created January 9, 2015 20:17
scss_sass-create-classes.scss
$colours:
"red" #FF0000,
"blue" #001EFF,
"green" #00FF00,
"yellow" #F6FF00;
@each $i in $colours{
.#{nth($i, 1)}-background {
background: nth($i, 2);
@pablolobos
pablolobos / scss_sass_if.scss
Created January 9, 2015 20:15
scss_sass_if.scss
@mixin absolute-position($top, $right, $bottom, $left)
{
position: absolute;
@if $top != '' {
top: $top;
}
@if $right != '' {
right: $right;
@pablolobos
pablolobos / css_min-height-vh.css
Created November 21, 2014 16:34
css_min-height-vh.css
min-height: 100vh;
@pablolobos
pablolobos / css_ol_complex-numbers.css
Created August 25, 2014 13:51
css_ol_complex-numbers.css
ol {
counter-reset: section;
list-style-type: none;
}
ol ol ol{
background:#c0c0c0; padding-left:10px;
}
ol li {
counter-increment: section;
}
@pablolobos
pablolobos / grig_nth-child_last-child_orphan.scss
Created June 6, 2014 17:00
grig_nth-child_last-child_orphan.scss
li:nth-child(3n + 1):last-child {
/* Now you are safe to do some orphan styling */
float: none;
width: auto;
}
@pablolobos
pablolobos / css_force-gpu-animation.css
Created April 9, 2014 15:34
css_force-gpu-animation.css
transform: translateZ(0);
@pablolobos
pablolobos / javascript_equal-height.js
Created March 28, 2014 19:29
javascript_equal-height.js
/* Equal height columns */
equalheight = function(container){
var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
$el,
topPosition = 0;
$(container).each(function() {
@pablolobos
pablolobos / js_focused-element.js
Created March 25, 2014 12:21
js_focused-element.js
var focusedElement = document.activeElement;
var triggerElement = document.activeElement;
myModal = new MyModal({
onOpen: function() {
this.container.focus();
},
onClose: function() {
triggerElement.focus();
}
@pablolobos
pablolobos / html_numeric-impu-field-ios.html
Created March 14, 2014 18:42
html_numeric-impu-field-ios.html
type="number" min="0" inputmode="numeric" pattern="[0-9]*"