diff --git a/lib/plugins/styling/script.js b/lib/plugins/styling/script.js
index 409148471d8c6319d8795143608ede99e66458a6..6fc2b9043c79ee5f58a6cc6313080fb0a62a7aef 100644
--- a/lib/plugins/styling/script.js
+++ b/lib/plugins/styling/script.js
@@ -2,12 +2,15 @@
 
 jQuery(function () {
 
+    var doreload = 1;
+
     var $styling_plugin = jQuery('#plugin__styling');
     if (!$styling_plugin.length) return;
 
     // add the color picker
     $styling_plugin.find('.color').iris({});
 
+    // add button on main page
     if (!$styling_plugin.hasClass('ispopup')) {
         var $hl = $styling_plugin.find('h1').first();
         var $btn = jQuery('<button class="btn">' + LANG.plugins.styling.popup + '</button>');
@@ -20,6 +23,23 @@ jQuery(function () {
         return;
     }
 
+    // reload the main page on close
+    window.onunload = function(e) {
+        if(doreload) {
+            window.opener.document.location.reload();
+        }
+        return null;
+    };
+
+    // don't reload on our own buttons
+    jQuery('input[type=submit]').click(function(e){
+        doreload = false;
+    });
+
+    // remove style
+    var $style = window.opener.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');
+    $style.attr('href', '');
+
     // append the loader screen
     $loader = window.opener.jQuery('#plugin__styling_loader');
     if (!$loader.length) {
@@ -41,8 +61,11 @@ jQuery(function () {
         window.opener.jQuery('body').append($loader);
     }
 
-    // load preview in main window
-    var now = new Date().getTime();
-    var $style = window.opener.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');
-    $style.attr('href', DOKU_BASE + 'lib/exe/css.php?preview=1&tseed=' + now);
+    // load preview in main window (timeout works around chrome updating CSS weirdness)
+    window.setTimeout(function() {
+        var now = new Date().getTime();
+        $style.attr('href', DOKU_BASE + 'lib/exe/css.php?preview=1&tseed=' + now);
+    }, 500);
+
+
 });