|
16 | 16 | <paper-input label="Your Name"></paper-input>
|
17 | 17 | <paper-input multiline label="Enter multiple lines here"></paper-input>
|
18 | 18 |
|
| 19 | +Theming |
| 20 | +-------- |
| 21 | +
|
| 22 | +Set `CoreStyle.g.paperInput.focusedColor` and `CoreStyle.g.paperInput.invalidColor` to theme |
| 23 | +the focused and invalid states. |
| 24 | +
|
19 | 25 | @group Paper Elements
|
20 | 26 | @element paper-input
|
21 | 27 | @extends core-input
|
22 | 28 | @homepage github.io
|
23 | 29 | -->
|
24 | 30 | <link href="../polymer/polymer.html" rel="import">
|
25 | 31 | <link href="../core-input/core-input.html" rel="import">
|
| 32 | +<link href="../core-style/core-style.html" rel="import"> |
| 33 | + |
| 34 | +<core-style id="paper-input"> |
| 35 | + |
| 36 | +#label.focused, |
| 37 | +#floatedLabel.focused { |
| 38 | + color: {{g.paperInput.focusedColor}}; |
| 39 | +} |
| 40 | + |
| 41 | +#underlineHighlight.focused, |
| 42 | +#caretInner { |
| 43 | + background-color: {{g.paperInput.focusedColor}}; |
| 44 | +} |
| 45 | + |
| 46 | +#error, |
| 47 | +:host(.invalid) #label.focused, |
| 48 | +:host(.invalid) #floatedLabel.focused { |
| 49 | + color: {{g.paperInput.invalidColor}}; |
| 50 | +} |
| 51 | +:host(.invalid) #underlineHighlight.focused, |
| 52 | +:host(.invalid) #caretInner { |
| 53 | + background-color: {{g.paperInput.invalidColor}}; |
| 54 | +} |
| 55 | + |
| 56 | +</core-style> |
26 | 57 |
|
27 | 58 | <polymer-element name="paper-input" extends="core-input" attributes="label floatingLabel maxRows error" on-down="{{downAction}}" on-up="{{upAction}}">
|
28 | 59 |
|
29 | 60 | <template>
|
30 | 61 |
|
31 | 62 | <link href="paper-input.css" rel="stylesheet">
|
32 | 63 |
|
| 64 | + <core-style ref="paper-input"></core-style> |
| 65 | + |
33 | 66 | <div id="floatedLabel" class="hidden" hidden?="{{!floatingLabel}}"><span id="floatedLabelSpan">{{label}}</span></div>
|
34 | 67 |
|
35 | 68 | <div id="container" on-transitionend="{{transitionEndAction}}" on-webkitTransitionEnd="{{transitionEndAction}}">
|
|
71 | 104 |
|
72 | 105 | <script>
|
73 | 106 |
|
| 107 | + (function() { |
| 108 | + |
| 109 | + var paperInput = CoreStyle.g.paperInput = CoreStyle.g.paperInput || {}; |
| 110 | + paperInput.focusedColor = '#4059a9'; |
| 111 | + paperInput.invalidColor = '#d34336'; |
| 112 | + |
74 | 113 | Polymer('paper-input', {
|
75 | 114 |
|
76 | 115 | /**
|
|
336 | 375 |
|
337 | 376 | });
|
338 | 377 |
|
| 378 | + }()); |
| 379 | + |
339 | 380 | </script>
|
340 | 381 |
|
341 | 382 | </polymer-element>
|
0 commit comments