Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Moved validation styling to component scope. #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions paper-checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@
}

/* invalid state */
#checkbox.invalid:not(.checked) {
:host([invalid]) #checkbox:not(.checked) {
border-color: var(--paper-checkbox-error-color, var(--error-color));
}
</style>

<div id="checkboxContainer">
<div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]">
<div id="checkbox" class$="[[_computeCheckboxClass(checked)]]">
<div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div>
</div>
</div>
Expand Down Expand Up @@ -285,15 +285,8 @@
}
},

_computeCheckboxClass: function(checked, invalid) {
var className = '';
if (checked) {
className += 'checked ';
}
if (invalid) {
className += 'invalid';
}
return className;
_computeCheckboxClass: function(checked) {
return checked ? 'checked' : '';
},

_computeCheckmarkClass: function(checked) {
Expand Down