聚合物1.0如何集中对齐纸卡标题? [英] polymer 1.0 how to central justify the paper-card heading?
本文介绍了聚合物1.0如何集中对齐纸卡标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试以此来证明纸卡标题的合理性:
I am trying this to central justify the paper card heading:
paper-card [heading]{
@apply(--center-justified);
}
,但似乎无济于事.友善建议
but it does not seem to help. kindly suggest
推荐答案
heading
不是attribute
,因此您不能这样写.
heading
is not an attribute
so you cannot write like that.
您基本上需要在阴影dom内设置.title-text
元素的样式,因此请改用它-
You basically need to style the .title-text
element inside the shadow dom, so use this instead -
paper-card::shadow #shadow .header .title-text {
display: flex;
justify-content: center;
}
或使用聚合物 iron-flex-layout
-
paper-card::shadow #shadow .header .title-text {
@apply(--layout-vertical);
@apply(--layout-center);
}
更新
感谢@sfeast指出来.由于shadow
选择器将被弃用,因此需要将上述样式应用于 mixins -
Update
Thanks to @sfeast for pointing it out. Since shadow
selectors will be deprecated, the above styles need to be applied to the mixins like this -
paper-card {
--paper-card-header: {
@apply(--layout-vertical);
@apply(--layout-center);
};
}
这篇关于聚合物1.0如何集中对齐纸卡标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文