Create a gist now

Instantly share code, notes, and snippets.

@mgol /jQuery-rcssAutoPx.js Secret
Last active Apr 23, 2018

What would you like to do?
define( function() {
"use strict";
// Regex visualized:
//
// /------------------------------\
// | |
// | /-----------\ |
// | | | |
// | | / top- \ | |
// | / margin- \ | | right- | | | / width \
// |-| border- |-+-| bottom- |-+-|-| |-\
// | \ padding- / \ left- / | \ height / |
// BEGIN -| | |- END
// | / min- \ | |
// |----------------| |-----/ |
// | \ max- / |
// | |
// |------------------ font-size -------------------|
// |--------------------- top ----------------------|
// |-------------------- right ---------------------|
// |-------------------- bottom --------------------|
// \-------------------- left --------------------/
return /(?:(?:(?:(?:margin-|border-|padding-)(?:top-|right-|bottom-|left-)?)|(?:min-|max-))?(?:width|height))|font-size|top|right|bottom|left/;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment