This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*HTML (the easy part)*/ | |
<ul> | |
<li>Daniel Furze</li> | |
<li class="ellipsis">Mc Testerson Longname IV</li> | |
</ul> | |
/*CSS (still a pretty easy part)*/ | |
.ellipsis{ | |
overflow: hidden; | |
text-overflow: ellipsis; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.query { | |
position:absolute; | |
top: 5px; | |
left: 5px; | |
} | |
.query:after{ | |
content: "[YOUR MEDIA QUERY HERE]"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Modernizr to check | |
if (!Modernizr.svg) { | |
// Using jQuery | |
$('img').each(function () { // Could also be more specific if you know where the svg's will be e.g. $('#work-content img') | |
var $img = this, // Cache current image DOM element in a variable | |
src = $img.src.split('.'), // Split the source | |
extension = src[src.length - 1]; // Make sure it's the last part of the split string | |
if (extension === 'svg') { | |
src[src.length - 1] = 'png'; // If it's svg, do all the things |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media all and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/*style all the things*/ | |
} | |
@media all and (max-width : 320px) { | |
/*style all the things*/ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//=Variables | |
//=Media Queries | |
$breakpoint-tiny: 20em; | |
$breakpoint-small: 30em; | |
$breakpoint-medium: 50em; | |
$breakpoint-extra-medium: 65em; //lol | |
$breakpoint-large: 80em; | |
$breakpoint-extra-large: 100em; | |
//=Global Styles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gist { | |
color: #000; | |
.render-container { | |
.render-viewer-error, | |
.render-viewer-fatal, | |
.octospinner { | |
display: none; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var domLinks = document.getElementsByTagName('link'); // Get all the <link>'s | |
// Will most likely find stylesheets but will find any with rels eg rel="canonical/author/external..." | |
// Unfortunately we can't just traverse the <head> as the Gist stylesheet is embedding with the Gist in your pages <body> | |
var gistLinks = []; | |
for (var i = 0, l = domLinks.length; i < l; i++) {//loop 'em | |
var el = domLinks[i]; //current link | |
// If 'gist' is in the href - | |
if (el.href.indexOf('gist') > -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Goes in your anchor/config/db.php file | |
//$$REPLACE_THESE$$ with your demo and live db details | |
switch ($_SERVER['SERVER_NAME']) { | |
case 'demo.domain.com': //eg. 'demodaniel.furzeface.com' for me | |
return array( | |
'default' => 'mysql', | |
'prefix' => 'anchor_', //change if you want |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wrap it so if GA is not initialised it doesn't go 'undefined'! | |
function analytics_custom_event_tracker(name, event, label) | |
{ | |
if (typeof ga === 'function') | |
{ | |
return ga('send', 'event', name, event, label); | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//=My breakpoint variables | |
//Usually kept in _variables.scss | |
$breakpoint-extra-small: 20em; //320px | |
$breakpoint-small: 30em; //480px | |
$breakpoint-medium: 50em; //800px | |
$breakpoint-extra-medium: 65em; //1040px | |
$breakpoint-large: 80em; //1280px | |
$breakpoint-extra-large: 100em; //1600px |
OlderNewer