//@ sourceURL equivalent for CSS

隐身守侯 提交于 2021-01-29 03:11:44

问题


In Firebug, //@ sourceURL can be used in a Javascript eval. We can use this technique to concatenate multiple Javascript files into a single file, and still have them show up as separate files in devtools/Firebug, like so:

eval("... foo.js contents ...\n//@ sourceURL=foo.js");
eval("... bar.js contents ...\n//@ sourceURL=bar.js");

Is there a similar technique for CSS files?


回答1:


In CSS the correct API is to use:

/*# sourceURL=<url> */



回答2:


In the absence of a better idea, it might also be possible to use Sass sourcemaps to achieve something like this. It seems like a hack, but perhaps it's a start.

Thanks to Andy Matthews for the pointer.



来源:https://stackoverflow.com/questions/15262506/sourceurl-equivalent-for-css

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