Skip to content

Instantly share code, notes, and snippets.

View robertmagnusson's full-sized avatar

Robert Magnusson robertmagnusson

View GitHub Profile
@robertmagnusson
robertmagnusson / alignHeight.js
Created June 30, 2014 13:57
Align height on several objects.
// Equal height
var $box = $('.align-height');
var boxHeight = 0;
// Equal heights for the sub menus.
$box.each(function() {
boxHeight = Math.max($(this).height(), boxHeight);
});
$box.height(boxHeight);
@mixin centerer {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@mixin ellipsis() {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@robertmagnusson
robertmagnusson / disable_ajax.js
Created May 8, 2014 13:59
Useful snippet for theming Drupal ajax throbbers. Execute it in the console and it stops all future ajax requests from working. The throbbers will be displayed but never removed.
XMLHttpRequest = function(){};
XMLHttpRequest.prototype = {
open: function(){},
send: function(){}
};
@robertmagnusson
robertmagnusson / sticky_footer.css
Created May 7, 2014 09:19
Sticky footer HTML 5
@robertmagnusson
robertmagnusson / firefox_select_hack.scss
Created March 12, 2014 07:48
Hide select arrow in Firefox on custom designed select list.
select {
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
}
@robertmagnusson
robertmagnusson / hamburger_cross.scss
Created February 25, 2014 09:25
Open menu button - Pure css
.button span {
position: absolute;
z-index: 999;
top: 50%;
right: 0;
display: block;
width: 30px;
height: 4px;
margin-top: -2px;
background-color: #fff;
@robertmagnusson
robertmagnusson / throbber-style.scss
Created February 19, 2014 08:06
Throbber for loading screens.
/* Filter reload styling */
#throbber,
#loading {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
@robertmagnusson
robertmagnusson / absolute_positioning_mixin.scss
Created February 11, 2014 15:32
Position absolute mixin
@mixin abs-pos ($top: auto, $right: auto, $bottom: auto, $left: auto) {
top: $top;
right: $right;
bottom: $bottom;
left: $left;
position: absolute;
}
@robertmagnusson
robertmagnusson / text_truncate.scss
Created February 11, 2014 15:30
Text truncate mixin
@mixin text-truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}