I want to edit my sass file from Chrome dev tool from element tab, is that possible?

感情迁移 提交于 2019-12-02 17:04:35

问题


In my project I have a sass file which I set sourcemappath through the node-sass. I am using Node-sass to compile my sass file. I have map my .css file on my system. so any changes I made through source panel save my file on the disk. and it's compiled back by node-sass. I am not seeing reload my auto-generated css anywhere so I think it's on by default.

I want to save the changes that I made on element panel. When I click on css file from element panel (which is scss file, work through sourcemap) it doesn't have my changes.

Is it possible to save my changes from element panel. I made some changes and I didn't see in source panel. when I refresh I can still see my changes but it doesn't reflect in the file.


回答1:


This is currently an experimental feature. It is hidden behind flags since it could be unstable and break things. If you'd like to try it now then do the following:

  1. Go to chrome://flags/#enable-devtools-experiments in your omnibar
  2. Enable the flag for Experimental DevTools Features
  3. Restart the browser
  4. Open DevTools and go to the Settings then a new Experiments tab on the left is available
  5. In the experiments tab, turn on the Live SASS option
  6. Restart DevTools

You should now have changes in the Elements panel persist into your Sass as long as it is properly source-mapped.

Paul Irish covered this feature (among others) in his portion of the I/O 2016 talk about Accelerating Your Workflow.




回答2:


I don't believe what you want is possible. You might want to look at options like LiveReload for this behaviour. You could change the code in IDE, compile, and livereload will detect your changes to the compiled .css file on the filesystem and reload it in your browser.



来源:https://stackoverflow.com/questions/46360983/i-want-to-edit-my-sass-file-from-chrome-dev-tool-from-element-tab-is-that-possi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!