(function($){
"use strict";
$(document).ready(function(){
var pattern = {
base1 : /(\,)\r?(\s)*?(?=[\w\*\.\#])/gi,
// Remove space and return characters after comma
// Replace with ""
base2 : /([\w\d\]\)\*])\s*?(?={)/gi,
// Remove space between selector and opening curly brace
// Replace with "$1"
base3 : /({)([\s\S]*?)(?=(\w|\-|\.|\#|\*|\@|\[|\/))/gi,
// Remove space between opening curly brace and property
// Replace with "$1"
base4 : /\s*?\:\s*?(?=[\w\.\#])/gi,
// Remove space before and after colon
// Replace with :
base5 : /(\;)([\s\S])*?(?=[\d\w\-\}\*\@])/gi,
// Remove space between semicolon and property
// Replace with ;
base6 : /(\})([\s])*?(?=[\w\@\[\.\#\*\}])/gi,
// Remove space between closing curly brace and selector
// Replace with "$1"
comments : /\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/gi,
// Remove comments
lastSemiColon : /\;([\s])*?(?=})/gi,
// Remove last semicolon
// Replace with ""
zeroPxWithZero : /(\s)0px/gi,
// Replace 0px with 0
// Replace with "$10"
colorHex : /#[0-9a-f]{6,8}/gi,
// hexadecimal color value: #fefefe
colorRGB : /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi,
// RGB color values: rgb(255, 0, 255)
curlyToCurly : /\{[^\}\{]*\}/g,
// Select data from opening curly to closing curly
allSpaces : / /g,
// Captures all spaces
allEnters : /[\r\n]/g,
// Captures all enters/carriage returns
allTabs : /[\t]/g,
// Captures all tabs
allMatch : /[\s\W\w]/g
// Match everything
};
$('#low').on('click', function() {
$('.comp-options').slideDown();
$('.comp-options >...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.