Dynamically add CSS to the visual editor

The reason why this isn’t working is because the WordPress core isn’t loaded when this dynamic style sheet is loaded. get_option() hasn’t been defined yet.

What you need to do is load WordPress at the top of your dynamic stylesheet:

<?php
include("../../../wp-load.php");
?>