Skip to content

Instantly share code, notes, and snippets.

View trumball's full-sized avatar

Todd Rumball trumball

  • London Ontario, Canada
View GitHub Profile
@trumball
trumball / Box shadow
Created September 9, 2013 17:18
Box shadow
/* Mixin */
.box-shadow (@x: 0px, @y: 3px, @blur: 5px, @alpha: 0.5) {
-webkit-box-shadow: @x @y @blur rgba(0, 0, 0, @alpha);
-moz-box-shadow: @x @y @blur rgba(0, 0, 0, @alpha);
box-shadow: @x @y @blur rgba(0, 0, 0, @alpha);
}
/* Implementation */
#somediv {
.box-shadow(5px, 5px, 6px, 0.3);
@trumball
trumball / Custom border radius
Created September 9, 2013 17:16
custom border radius
/* Mixin */
.border-radius-custom (@topleft: 5px, @topright: 5px, @bottomleft: 5px, @bottomright: 5px) {
-webkit-border-radius: @topleft @topright @bottomright @bottomleft;
-moz-border-radius: @topleft @topright @bottomright @bottomleft;
border-radius: @topleft @topright @bottomright @bottomleft;
}
/* Implementation */
#somediv {
.border-radius-custom(20px, 20px, 0px, 0px);
@trumball
trumball / border radius
Created September 9, 2013 17:16
border-radius
/* Mixin */
.border-radius (@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
/* Implementation */
#somediv {
.border-radius(20px);
@trumball
trumball / paragraph
Created September 9, 2013 14:26
Paragraph padding and indent
p{
margin-bottom:20px;
}
p+p{
text-indent:2em;
margin-top:-20px;
}
@trumball
trumball / print
Created September 7, 2013 19:08
Print Link Style
@media print {
#main-content a[href]:after { " (" attr(href) ") "; }
}
/* file structure based on: https://github.com/tylersavery/jQueryTO2013/tree/master/code/BasicApp.js */
//set global app
var App = {};
App.Init = function() {
App.Cache();
App.BindListeners();
App.InitVideo();
@trumball
trumball / Form PUT DELETE
Created May 24, 2013 21:04
Form PUT This is the correct way to use PUT and DELETE in a HTML form
<form method="POST">
<input type="hidden" name="_METHOD" value="PUT"/>
</form>
<form method="POST">
<input type="hidden" name="_METHOD" value="DELETE"/>
</form>
@trumball
trumball / Featured CSS3 Display Banner
Created May 24, 2013 20:49
Featured CSS3 Display Banner Generally you would need to setup a background image to duplicate this effect in other browsers. But in CSS3-supported engines we can generate dynamic banners which hang off the edge of your content wrappers, all without images! These may look good attached onto e-commerce products, image thumbnails, video previews, …
@trumball
trumball / Glowing Anchor Links
Created May 24, 2013 20:49
Glowing Anchor Links CSS3 text shadows offer a unique method of styling your webpage typography. And more specifically this snippet is an excellent resource for custom creative links with glowing hover effects. I doubt this effect can be pulled off elegantly in the majority of websites, but if you have the patience to get it looking nice you are…
@trumball
trumball / Paper Page Curl Effect
Created May 24, 2013 20:48
Paper Page Curl Effect This page curl effect can be applied to almost any container which holds website content. Immediately I thought about image media and quoted text, but really this could be anything at all. Check out the snippet’s live demo page for a better grasp of how these page curls function.
ul.box {
position: relative;
z-index: 1; /* prevent shadows falling behind containers with backgrounds */
overflow: hidden;
list-style: none;
margin: 0;
padding: 0;
}
ul.box li {