简体   繁体   English

如何从WinJS build删除ui-light.css?

[英]How to remove ui-light.css from WinJS build?

WinJS or MobileFirst is injecting this piece of code on my index.html, the problem is ui-light.css is messing up with my .css even though it is the very first <link> on the <head> Is there a way to remove this .css injection? WinJS或MobileFirst会将这段代码注入到我的index.html中,问题是ui-light.css弄乱了我的.css,尽管它是<head>上的第一个<link>。有没有办法删除此.css注入? I'd rather avoid doing javascript to remove a code that was just injected by javascript. 我宁愿避免使用javascript删除刚刚由javascript注入的代码。

<script>
            var head = document.getElementsByTagName('head')[0]; 
            if (window.clientInformation.userAgent.indexOf("Windows Phone 8.1") > -1) {
                var fileref1 = document.createElement("script"); 
                var fileref2 = document.createElement("script"); 
                var link = document.createElement('link'); 
                fileref1.setAttribute("type", "text/javascript"); 
                fileref1.setAttribute("src", "//Microsoft.Phone.WinJS.2.1/js/base.js"); 
                fileref2.setAttribute("type", "text/javascript"); 
                fileref2.setAttribute("src", "//Microsoft.Phone.WinJS.2.1/js/ui.js");
                link.setAttribute("rel", "stylesheet"); 
                link.setAttribute("href", "//Microsoft.Phone.WinJS.2.1/css/ui-light.css"); 
                head.appendChild(fileref1); 
                head.appendChild(fileref2); 
                head.appendChild(link); 
             } else {       
                var fileref1 = document.createElement("script"); 
                var fileref2 = document.createElement("script"); 
                var link = document.createElement("link"); 
                fileref1.setAttribute("type", "text/javascript"); 
                fileref1.setAttribute("src", "//Microsoft.WinJS.2.0/js/base.js "); 
                fileref2.setAttribute("type", "text/javascript"); 
                fileref2.setAttribute("src", "//Microsoft.WinJS.2.0/js/ui.js"); 
                link.setAttribute("rel", "stylesheet"); 
                link.setAttribute("href", "//Microsoft.WinJS.2.0/css/ui-light.css"); 
                head.appendChild(fileref1);
                head.appendChild(fileref2);
                head.appendChild(link);
            }
        </script>

The latest version of winJS was 4.4. winJS的最新版本是4.4。 The ui-light/dark.css file was included in the WinJS library as a standalone css file. ui-light / dark.css文件作为独立的CSS文件包含在WinJS库中。 You can choose not to add it if it was messed up with your css. 如果您的CSS混乱了,您可以选择不添加它。 So, please try to update to winJS 4.4. 因此,请尝试更新到winJS 4.4。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM