JSFiddle - React, Tailwind, and code Playground

CSS

pre {
    margin: 1em;
    padding: 1em;
    background: #f2f2f2;
    border: 1px solid #aaa;
}

JavaScript

// 1. Setup
var frameElement = document.createElement( 'iframe' );
var frameWrapDiv = document.createElement( 'div' );
frameWrapDiv.appendChild(frameElement);
document.body.appendChild(frameWrapDiv);
var frameWin = frameElement.contentWindow;
var frameDoc = frameWin.document;
var frameBody = frameDoc.body;
frameDoc.open();
frameDoc.write('<!doctype html><html><body><div>Hi</div></body></html>');
frameDoc.close();

// 2. Hide
frameWrapDiv.style.display = 'none';

// 3a. jQuery.css
var dirJQ, dirGlobalGCS, dirOwnerDocGCS, computed;
try {
    // Read style from iframe'sjq <body>
    // http://bugs.jquery.com/ticket/15098
    // Worked in 1.8.3, broken in 1.11.1
    dirJQ = $( frameBody ).css( 'direction' );
} catch (e) {
    // Firefox throwing NS_ERROR_NOT_AVAILABLE?
    dirJQ = e;
}

// 3b. Vanilla window.getComputedStyle
try {
    computed = window.getComputedStyle( frameBody, null );
    dirGlobalGCS = computed && {
        sub: computed.direction,
        call: computed.getPropertyValue('direction')
    };
} catch (e) {
    dirGlobalGCS = e;
}

// 3c. Vanilla node.ownerDocumenet.defaultView.getComputedStyle
try {
    computed = frameBody.ownerDocument.defaultView.getComputedStyle( frameBody, null );
    dirOwnerDocGCS = computed && {
        sub: computed.direction,
        call: computed.getPropertyValue('direction')
    };
} catch (e) {
    dirOwnerDocGCS = e;
}
    
// Log
var pre = document.createElement('pre');
document.body.appendChild(pre);
function dump(x) {
    if (typeof x === 'object' && x !== null) {
        if (x.sub) {
            return '- sub: ' + x.sub + '\n- getPropertyValue(): ' + x.call;
        }
        return x;
    }
    if (typeof x !== 'string') {
        return x;
    }
    if (x.length) {
        return x;
    }
    return '(string) ""';
}
pre.appendChild(document.createTextNode(
    'jQuery:\n' + dump(dirJQ)
    + '\n\n\n' + 'window.getComputedStyle:\n' + dump(dirGlobalGCS)
    + '\n\n\n' +...