4 ms·
great tips! auto reloading css is perhaps my most favorite timesaver. i add this snippet to a page when in development: <script> if(location.href.indexOf
by ammmir 15y ago
great tips! auto reloading css is perhaps my most favorite timesaver. i add this snippet to a page when in development:
<script>
if(location.href.indexOf('file://') == 0 || location.href.indexOf('http://localhost') == 0) {
var s = document.createElement('script'); s.async = true;
s.src = 'js/css_auto-reload.js'; s.onload = function() {
document.styleSheets.start_autoreload(1000);
};
document.getElementsByTagName('head')[0].appendChild(s);
}
</script>
it uses http://nv.github.com/css_auto-reload/ http://nv.github.com/css_auto-reload/ and updates the page (in place) nearly instantly after i save css in my editor. i use sassy/scss, so i also run "compass watch" in a terminal. it's css tweaking heaven for me :)
- tomvo 15y agocheck out LiveReload, does that plus auto compile.