PolymerElements / paper-input

A Material Design text field
https://www.webcomponents.org/element/PolymerElements/paper-input
130 stars 162 forks source link

Cannot style paper-input-container's input correctly #621

Closed kevinpschaaf closed 6 years ago

kevinpschaaf commented 6 years ago

Description

The docs for paper-input-container indicate:

You can style the nested <input> however you want; if you want it to look like a Material Design input, you can style it with the --paper-input-container-shared-input-style mixin.

However, due to limitations in the @apply shim, the --paper-input-container-shared-input-style is not available to be applied from outside the element; as such, styling the input as described in the docs does not work:

<custom-style>
  <style>
    input {
      @apply --paper-input-container-shared-input-style;
    }
  </style>
</custom-style>

<paper-input-container>
  <iron-input slot="input">
    <input>
  </iron-input>
</paper-input-container>

Expected outcome

The input looks like a paper-input

Actual outcome

The input is unstyled

Live Demo

http://jsbin.com/loketi/edit?html,output

Steps to reproduce

  1. Open jsBin
  2. Note input is ugly
  3. Uncomment custom style with outer definition of --paper-input-container-shared-input-style and note input is nice

Browsers Affected

All