Skip to content

Instantly share code, notes, and snippets.

View paulmsmith's full-sized avatar

Paul Smith paulmsmith

View GitHub Profile
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@paulmsmith
paulmsmith / redrawIEBeforeContentSnipper.css
Created May 28, 2014 10:02
IE8:before content trigger redraw
/* This triggers a redraw in IE to Fix IE8's :before content rendering. */
html:hover [class^="ss-"]{-ms-zoom: 1;}
@paulmsmith
paulmsmith / css_only_select_styling.html
Created July 12, 2014 15:02
css only custom styled select
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
@paulmsmith
paulmsmith / emmet_demo.html
Created August 12, 2014 20:35
emmet comment filter example for Noah
article.foo>div.bar|c
@paulmsmith
paulmsmith / _tools.mixins.maintainaspect.scss
Created November 27, 2014 10:48
maintain aspect ratio mixin
// Maintain ratio mixin. Great for responsive grids, or videos.
// https://gist.github.com/brianmcallister/2932463
//
// $ratio - Ratio the element needs to maintain.
//
// Examples
//
// // A 16:9 ratio would look like this:
// .element {
// @include maintain-ratio(16 9);
@paulmsmith
paulmsmith / bem_example_libsass.scss
Last active August 29, 2015 14:11
BEM libsass simple example
// mark-up example
// <div class="block block--sml"><span class="block__label">Text here</span></div>
.block { color: #000; }
// outputted css
.block {
color: #000;
}
@paulmsmith
paulmsmith / bem_question.scss
Last active August 29, 2015 14:11
BEM nested blocks and modifiers question
// block one (the containing block)
.accordion {}
// block two (the nested BEM block)
.toggler {}
// when the accordion is toggled open I need to update it's
// appearance whilst adhearing to the BEM methodology. How?
// option one:
@paulmsmith
paulmsmith / SassMeister-input.scss
Created June 4, 2015 15:59
Generated by SassMeister.com.
// ----
// libsass (v3.2.4)
// ----
.c-nav {
position: relative;
&:before {
content: 'Menu';
display: inline-block;
@paulmsmith
paulmsmith / SassMeister-input.scss
Created June 4, 2015 16:02
Generated by SassMeister.com.
// ----
// libsass (v3.2.4)
// ----
.c-nav {
position: relative;
&:before {
content: 'Menu';
display: inline-block;