2017-10-19 111 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鏈接或任何其他在我的代碼?

回答