2015-12-15 71 views
2

我正在製作聚合物應用程序。有很多我喜歡,然後有一些我還沒完全理解的魔法。此時,我試圖弄清楚如何設計paper-input元素。我有這樣一個定義:聚合物 - 造型紙張輸入元素

<div class="horizontal layout"> 
    <iron-icon icon="schedule" style="padding:18px 12px 0px 0px;"></iron-icon> 
    <paper-input label="started at" readonly="true" value="[[ time ]]"></paper-input> 
</div> 

上述代碼生成一個紙張輸入元素。但是,我有兩個挑戰。首先,當用戶單擊文本字段的內容時,會出現下劃線。但是,我將它標記爲只讀,所以我不認爲該字段可能會得到重點。其次,我不想要任何形式的下劃線。即使場地沒有焦點。我從不想顯示下劃線。然而,當我檢查DOM時,我無法弄清楚如何設置它。

有沒有辦法去除下劃線和焦點?如果是這樣,怎麼樣?

回答

1

您所說的下劃線是paper-input的材料設計規範的一部分。如果你想刪除它,你將不得不玩弄以下mixin:

`--paper-input-container-underline` | Mixin applied to the underline | `{}` 
`--paper-input-container-underline-focus` | Mixin applied to the underline when the input is focused | `{}` 
`--paper-input-container-underline-disabled` | Mixin applied to the underline when the input is disabled | `{}`