问题解决是瓜哥解决的,我帮忙写上博客
英文关键字:
Custom parent element’s style not applied to child
问题:移动端使用polymer时
子页面无法使用父类页面的样式
但是在我们的web网站中是可以的,
有一个思路是用我们的web端的网站页面在手机端浏览看是否能成功使用样式,但是web端的页面在手机浏览器无法打开
问题原因听我们前端大佬说是WebComponents.js的引入的区别,
所以对比区别这一个尝试失败了。(内部原因待更新)
情况如下
在里面的html中,我们是无法使用elements.html里面包含的样式的
样式包含文件elements.html
<link rel="stylesheet" type="text/css" href="css/base.css">
<link rel="stylesheet" type="text/css" href="css/layout.css">
<link rel="stylesheet" type="text/css" href="css/fonts.css">
<link rel="stylesheet" type="text/css" href="css/margin.css">
<link rel="stylesheet" type="text/css" href="css/padding.css">
<link rel="stylesheet" type="text/css" href="css/list.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
<link rel="stylesheet" type="text/css" href="../test.css">
对于这种情况:
目前我们希望的是import之后能够直接用我们import进来的css到全部页面中,但是目前是失败了
解决方式:
1、直接在每个css中引用其他公用的css。这样做达到了在每个页面import一个公用css的html的目的
缺点:听ui工程师说这样性能受影响,这个待考证————————————
2、找办法解决import。样式集到html中(待更新————————————————————–)