2017-10-19 75 views
1

我已将聚合物项目升级到2.0版本。之后,一些css类从div中丢失。聚合物2.0自定义样式属性不能在dom模块下工作

有一个从我-home.html做为至铁柔性的layout.html链接

<link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html"> 

而且在我-home.html的页有一些风格类似如下:

<dom-module id="my-home"> 
<template> 
<style is="custom-style"> 
.flex-vertical { 
    @apply --layout-vertical; 
    height: 100vh; 
} 

.flexchild-vertical { 
    @apply --layout-flex; 
    @apply --layout-horizontal; 
} 
</style> 
</template> 
</dom-module> 

这些样式从铁柔性的layout.html调用

--layout-vertical 
--layout-flex 
--layout-horizontal 

但它没有加载到我的输出。下面是从我的浏览器的截图:

旧版本:

enter image description here

升级版:

enter image description here

我想这个问题可能是因为存在生成一个#shadow-root

我可以更改样式链接/ html链接或任何其他在我的代码?

回答