Skip to content

Instantly share code, notes, and snippets.

View sloyless's full-sized avatar
👓

Sean Loyless sloyless

👓
View GitHub Profile
@sloyless
sloyless / wordpress.php
Last active February 22, 2021 14:24
WordPress cheat sheet
<!-- WP Template Dir -->
<?php bloginfo('template_directory'); ?>
<!-- WP Child Theme Template Dir -->
<?php get_stylesheet_directory_uri(); ?>
<!-- WP Home Link -->
<?php echo get_option('home') ?>
<!-- WP Search Form -->
@sloyless
sloyless / cube.html
Last active July 11, 2016 17:43
Rotating Cube CSS transition
<!-- originally from http://cssdeck.com/labs/css3-flipping-cube -->
<style>
/* Set-up */
body {
color: rgb(6, 106, 117);
text-transform: uppercase;
font-family: sans-serif;
font-size: 100%;
background: #F4F6F8;
padding: 3em 0 0 0;
@sloyless
sloyless / filter-transition.sass
Created July 17, 2016 03:07
Achieve a CSS transition on the filter property in chrome
transition: -webkit-filter 500ms, filter 500ms
@sloyless
sloyless / wordpress-plugin.php
Created July 28, 2016 15:40
WordPress Custom Plugin
<?php
/*
Plugin Name: Custom Plugin
Description: Custom text and image widgets
Version: 1.0
Author: Sean Loyless
Author URI: http://seanloyless.info
*/
/* Widgets */
@sloyless
sloyless / fallback-image.html
Last active April 13, 2017 14:41
Fallback Image if missing
<img src="logo.png" alt="" onerror="if (this.src != 'default.png') this.src = 'default.png';"/>
@sloyless
sloyless / numeric-input.html
Last active February 19, 2017 01:05
iPhone/Android numeric input pad
<input id="quantity" class="form-control" type="number" name="quantity" placeholder="Enter Number" inputmode="numeric" pattern="[0-9]*" />
@sloyless
sloyless / spin.css
Last active April 23, 2017 17:24
Forever spinning and pulsing graphic
img {
animation-name: rotate;
animation-duration: 0.75s;
animation-fill-mode: none;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes rotate {
0% {
@sloyless
sloyless / loading-dots.scss
Last active May 2, 2017 17:21
Loading dot animation CSS
@keyframes blink {
/**
* At the start of the animation the dot
* has an opacity of .2
*/
0% {
opacity: .2;
}
/**
* At 20% the dot is fully visible and
@sloyless
sloyless / grid.scss
Last active January 2, 2019 12:37
CSS Grid with Flexbox fallback
// Based on https://css-tricks.com/browser-compatibility-css-grid-layouts-simple-sass-mixins/
// This CSS Grid mixin and styles allow modern browsers to use the newer display: grid functionality,
// but allow a fallback to Flexbox to support older browsers like IE 11.
@mixin basic-styles {
display: flex;
align-items: center; // Vertically center all content
}
@mixin grid-child ($col-start, $col-end, $row-start, $row-end) {
@sloyless
sloyless / firefoxmargin.css
Created October 18, 2017 21:51
Firefox Weird Margin Issues
// This is to accommodate weird spacing issues in Firefox only.
@-moz-document url-prefix() {
margin-top: 10px;
}