Skip to content

Instantly share code, notes, and snippets.

View nessthehero's full-sized avatar
💭
🍕

Ian Moffitt nessthehero

💭
🍕
View GitHub Profile
# Accordions
Self contained, repeatable, and unpack when there is no JavaScript.
@nessthehero
nessthehero / mixins.scss
Created September 12, 2013 18:33
Mixins
@mixin bp($point) {
@if $point == print {
@media only print { @content; }
}
}
@mixin em_width($px) { width: #{$px / 16}em; }
@mixin em_maxwidth($px) { max-width: #{$px / 16}em; }
@nessthehero
nessthehero / mixins.scss
Last active December 23, 2015 04:59 — forked from eightdotthree/mixins.scss
Forked again, but with additions to the EM translation functions to include default font size. I found out if you change the font size in an element, then do anything else with EMs in that same element, it changes what an EM actually is. With these additions, you can include the new font size and the widths will end up being the same as they wou…
@mixin bp($point) {
@if $point == print {
@media only print { @content; }
}
}
@mixin em_width($px, $default: 16) { width: #{$px / $default}em; }
@mixin em_height($px, $default: 16) { height: #{$px / $default}em; }
@nessthehero
nessthehero / YouTube CKEditor Plugin
Last active December 25, 2015 21:29
YouTube CKEditor Plugin
ckeditor
-plugins
--youtube
---dialogs
----youtube.js
---icons
----youtube.png
---plugin.js
@nessthehero
nessthehero / _module.scss
Last active December 28, 2015 21:09
Example of SASS Module
.module { // Uses Chris Coyier's SASS style guide
// Extends
@extends %module;
// Native styles
background-color: lightpink;
// Includes (mixins and whatnot)
@include transition(all 0.3s ease-out);
@nessthehero
nessthehero / template.php
Created January 15, 2014 14:11
Drupal template.php file
<?php
/**
* Include our template.whatever.php files
*/
$theme_path = drupal_get_path('theme', 'your_theme');
// Specify the path to our template.php files
// I decided that my template.php files will
// reside in a folder named "php"
$filePath = "$theme_path/php";
// Open the directory
@nessthehero
nessthehero / polyfill.js
Created March 20, 2014 18:58
Placeholder polyfill
// Placeholder polyfill
if (!Modernizr.input.placeholder) {
$('input[placeholder]:not(.ph), textarea[placeholder]:not(.ph)').each(function () {
var place = $(this).attr('placeholder');
$(this).attr('value', place);
$(this).bind('focus', function () {
if ($.trim($(this).attr('value')) === place) {
$(this).attr('value', '');
@nessthehero
nessthehero / access.html
Last active August 29, 2015 14:04
Awesome Accessibility Navigation
<!-- ACCESSIBILITY NAVIGATION -->
<div class="access">
<h1 id="top">Welcome to the University Website</h1>
<h2>Accessibility Navigation:</h2>
<ul>
<li><a href="#primary-navigation" title="Skip to the primary site navigation" class="skip">Skip to the primary site navigation</a></li>
<li><a href="#main" title="Skip to the main content" class="skip">Skip to the main content</a></li>
<li><a href="#footer" title="Skip to the footer" class="skip">Skip to the footer</a></li>
</ul>
</div><!-- /access -->
@nessthehero
nessthehero / _mixin.scss
Created August 14, 2014 12:51
Breakpoint Mixin
@mixin bp($point, $mode: "min") {
@if $point == small {
@media only screen and (#{$mode}-width: 420px) { @content; }
}
@if $point == medium {
@media only screen and (#{$mode}-width: 768px) { @content; }
}
@nessthehero
nessthehero / README.md
Created August 18, 2014 14:56
How to get HQ thumb from YouTube