Skip to content

Instantly share code, notes, and snippets.

@dumbledork
Created March 4, 2015 03:06
Show Gist options
  • Select an option

  • Save dumbledork/0a602d6096c0478d239d to your computer and use it in GitHub Desktop.

Select an option

Save dumbledork/0a602d6096c0478d239d to your computer and use it in GitHub Desktop.
// my-wdiget.js
+function ($) { 'use strict';
var Plugin = function (element, options) {
this.element = element;
this.options = options ? options : Plugin.DEFAULTS;
return this;
};
Plugin.VERSION = '0.1.0';
Plugin.DEFAULTS = {};
$.fn.awesome = function (opts) {
var options = $.extend({}, $.fn.awesome.defaults, opts);
return this.each (function () {
var awesome = new Plugin ($(this)[0], options);
awesome();
});
};
$.fn.awesome.defaults = Plugin.DEFAULTS;
}(jQuery);
/*! my-wdiget.less */
@base: #f938ab;
.box-shadow(@style, @c) when (iscolor(@c)) {
-webkit-box-shadow: @style @c;
box-shadow: @style @c;
}
.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) {
.box-shadow(@style, rgba(0, 0, 0, @alpha));
}
.box {
color: saturate(@base, 5%);
border-color: lighten(@base, 30%);
div { .box-shadow(0 0 5px, 30%) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment