JSFiddle - React, Tailwind, and code Playground
by cmruser
HTML
<section class="droppable-block">
<div class="block breaksection">
<hgroup></hgroup>
</div>
<div class="block dropsection">
<ul class="dropable"></ul>
</div>
</section>
JavaScript
//https://github.com/kajic/jquery-injectCSS
(function (jQuery) {
'use strict';
function toCSS(jss, options) {
function jsonToCSS(scope, css) {
if (scope && !result[scope]) {
result[scope] = {};
}
for (var property in css) {
var value = css[property];
if (value instanceof Array) {
var values = value;
for (var i = 0; i < values.length; i++) {
addProperty(scope, property, values[i]);
}
}
else {
switch (typeof(value)) {
case "number":
case "string":
addProperty(scope, property, value);
break;
case "object":
var endChar = property.charAt(property.length - 1);
if (scope && (endChar === "_" || endChar === "-")) {
var variants = value;
for (var key in variants) {
// key may be a comma separted list
var list = key.split(/\s*,\s*/);
for (var j = 0; j < list.length; j++) {
var valueVariant = variants[key];
if (valueVariant instanceof Array) {
var valuesVariant = valueVariant;
for (var k = 0; k < valuesVariant.length; k++) {
addProperty(scope, property + list[j], valuesVariant[k]);
}
}
else {
addProperty(scope,...