Skip to content

Instantly share code, notes, and snippets.

@mojaray2k
Created September 12, 2013 07:12
Show Gist options
  • Save mojaray2k/6533883 to your computer and use it in GitHub Desktop.
Save mojaray2k/6533883 to your computer and use it in GitHub Desktop.
The following code sample is an example of how to make inline style sheets editable in the browser like other elements.
<!--editable-inline-stylesheet.html -->
<style type="text/css" id="regular-style-block">
html{
background-color:#222229;
position:relative;
}
body{
font:14px/1.3 'Segoe UI', Arial, sans-serif;
color:#e4e4e9;
min-height:500px;
}
</style>
//To make the style block visible and editable, execute this code in your console:
$('#regular-style-block').css({'display':'block', 'white-space':'pre'})
.attr('contentEditable',true);
/*
The changes you make to the stylesheet affect the page in real time. Recently this live-editing stopped working
in Chrome, so you will have to try it out in Firefox to see the results.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment