Skip to content

Instantly share code, notes, and snippets.

View stephanie-walter's full-sized avatar
🦊

Stéphanie Walter stephanie-walter

🦊
View GitHub Profile
@stephanie-walter
stephanie-walter / modernizr-load-polyfill
Created August 24, 2012 11:57
Modernizr conditionnal Load media queries polyfill
/** Detect support for media queries (all size and browser) and add a polyfill for browser that don't support it
Find the polyfill under http://code.google.com/p/css3-mediaqueries-js/
This required the modernizr load to be in the build
**/
Modernizr.load([{
test : Modernizr.mq('only all'),
yep : '',
nope : 'css3-mediaqueries.js',
}]);
@stephanie-walter
stephanie-walter / input type search - webkit
Last active December 11, 2015 22:39
Make Webkit Input Type = Search Behave Like Type = Text
input[type=search]{
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
}
@stephanie-walter
stephanie-walter / gist:4687341
Last active December 12, 2015 00:58
WP CF7 Revamp
/* in function */
function my_deregister_javascript() {
/**adding some cleanup for plugin **/
if (!is_page('contact')){
wp_deregister_script( 'jquery-form' );
}
}
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
@stephanie-walter
stephanie-walter / gist:5014232
Created February 22, 2013 15:31
WordPress Branch embed - WordPress short code to embed
// Adds [branch id=""] shortcode in WordPress
if ( !function_exists('branch_embedded')) {
function branch_embedded($atts) {
$atts = shortcode_atts(array('id' => ''), $atts);
$output = '<script type="text/javascript" src="http://embed-script.branch.com/assets/embed/embed.m.js?body=0" data-branch-embedid="' . esc_attr($atts['id']) . '" ></script>';
@stephanie-walter
stephanie-walter / -webkit-tap-highlight-color
Created April 18, 2013 10:30
Remove webkit tab highliht color for Android and iOS (when user tabs on a link on mobile)
a {
-webkit-tap-highlight-color:rgba(0,0,0,0);
}
@stephanie-walter
stephanie-walter / toggleClassRawJS
Last active December 16, 2015 19:19
Toggle Class in RAW JavaScript when element is clicked (for menu purpose here)
function changeClass(elem,className1,className2){
elem.className = (elem.className == className1)?className2:className1;
}
document.getElementById('menutoggle').onclick = function() {
changeClass(this, 'navtoogle active', 'navtoogle');
}
// Many thanks to https://twitter.com/Martel_Louis
@stephanie-walter
stephanie-walter / this.value
Created May 18, 2013 13:50
retrieve a value from an input element
this.value
@stephanie-walter
stephanie-walter / AddClass Raw JS
Created May 18, 2013 13:50
Add class to element
document.body.className = 'hasJS';
@stephanie-walter
stephanie-walter / Append Class
Created May 18, 2013 13:51
Append class to an existing one in raw JS
document.body.className += ' hasJS'
@stephanie-walter
stephanie-walter / logo-base-64
Created May 19, 2013 15:51
Logo base 64 image
<a href="/" class="site-logo">
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt=" " class="logo ">
</a>