Skip to content

Instantly share code, notes, and snippets.

@maddesigns
maddesigns / @mixin x-rem()
Created September 2, 2013 18:35
@mixin x-rem() // thanks to Eric Meyer for https://github.com/ericam/susy // and Hans Christian Reinl for http://drublic.de/blog/rem-fallback-sass-less/
// @mixin x-rem()
//
// mixin for easy use of rem with px as fallback
// usage: @include x-rem(14px);
// usage: @include x-rem(14px, font-size);
// usage: @include x-rem(0 12px 2 1.2, margin);
// usage: @include x-rem(1.5 24px, padding);
//
// thanks to Eric Meyer for https://github.com/ericam/susy
// and Hans Christian Reinl for http://drublic.de/blog/rem-fallback-sass-less/
@maddesigns
maddesigns / lib.adaptive-images
Created August 29, 2013 12:15
TYPO3 Snippet for Adaptive Images with <noscript> Sample: http://t3ip.maddesigns.de/examples/adaptive-images-noscript/
#adaptive images lib for TYPO3
lib.adaptive-images = COA
lib.adaptive-images {
1 = TEXT
1.value = <figure class="csc-textpic-imagecolumn###CLASSES###"><noscript
10 = IMG_RESOURCE
10 {
file.import.current = 1
file.maxW = 480
file.override.data = {$styles.content.imgtext.maxW}
@maddesigns
maddesigns / index.html
Created August 15, 2013 14:42
A CodePen by Sven Wolfermann. iOS font rendering - test of iOS font rendering (landscape bolding of text)
<div class="block1">
<h1>type rendering – black on white</h1>
<h2>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </h2>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.
</p>
</div>
<div class="block2">
# General
output_style = :expanded
relative_assets = true
line_comments = false
project_path = File.dirname(__FILE__) + "/"
utils_dir = project_path + "utils/"
# Sass Paths
http_path = "/"
@maddesigns
maddesigns / gist:6138317
Last active December 20, 2015 13:19
Sublime searches for modernizer classes and CSS3 pseudo classes (Selectivizr)
// Modernizr search
\.(no-)?(flexbox|canvas|canvastext|webgl|touch|geolocation|postmessage|websqldatabase|indexeddb|hashchange|history|draganddrop|websockets|rgba|hsla|multiplebgs|backgroundsize|borderimage|borderradius|boxshadow|textshadow|opacity|cssanimations|csscolumns|cssgradients|cssreflections|csstransforms|csstransforms3d|csstransitions|fontface|generatedcontent|video|audio|localstorage|sessionstorage|webworkers|applicationcache|svg|inlinesvg|smil|svgclippaths)\s
// Selectivizr search
:(root|nth-of-type|nth-last-of-type|first-of-type|last-of-type|only-of-type|only-child|last-child|nth-child|nth-last-child|empty|target|checked|:selection|enabled|disabled|not)
@maddesigns
maddesigns / Preferences.sublime-settings
Last active August 26, 2016 07:10
my sublime text (3) user preference file
{
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin, text.html.basic",
"binary_file_patterns":
[
"dist/*",
".tmp/*",
"node_modules/*",
"*.jpg",
"*.jpeg",
"*.png",
compiletype = environment
project_path = File.dirname(__FILE__) + "/"
utils_dir = "utilities/"
utils_path = project_path + utils_dir
# callback - on_sprite_saved
# http://compass-style.org/help/tutorials/configuration-reference/
on_sprite_saved do |filename|
if File.exists?(filename)
if (compiletype == :production)
@maddesigns
maddesigns / spancount.js
Created December 2, 2012 16:46 — forked from bejes/spancount.js
Simple jquery plugin to insert spans in text and a defined character limit
/**
* Plugin function to insert spans into text:
* usage
* $(document).ready(function() {
* $('p.charcount').charSpanCount(); });
* or $(document).ready(function() {
* $('p.charcount').charSpanCount({'charcount' : 15});
* });
*/
(function($) {
@maddesigns
maddesigns / dabblet.css
Created May 23, 2012 09:54
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.item {
width: 120px;
height: 120px;
}
.img-wrap {
@maddesigns
maddesigns / CssRule.js
Created March 23, 2012 18:37 — forked from mseeley/CssRule.js
Easily alter CSS rules via JS
// Allows programmatic altering of CSS rules. Turn this class into a flyweight by enabling modification of the underlying rule property.
function CssRule (selector, stylesheet) {
var rules = stylesheet.rules,
len = rules.length,
i = 0,
rule = null;
for (i; i < len; i++) {
rule = rules[i];
if (rule.selectorText === selector) {