diff --git a/ui/js/component/formField/view.jsx b/ui/js/component/formField/view.jsx index 5e0321f0b..3ed79e654 100644 --- a/ui/js/component/formField/view.jsx +++ b/ui/js/component/formField/view.jsx @@ -174,19 +174,18 @@ class FormField extends React.PureComponent { {this.props.prefix ? {this.props.prefix} : ""} - {renderElementInsideLabel - ? - : element} + {element} + {renderElementInsideLabel && + } {formFieldFileSelectorTypes.includes(this.props.type) ?
- +
+
{claimIsMine &&
- +
} ); diff --git a/ui/scss/all.scss b/ui/scss/all.scss index 3b4dc401e..1a1c7b475 100644 --- a/ui/scss/all.scss +++ b/ui/scss/all.scss @@ -25,4 +25,5 @@ @import "component/_tabs.scss"; @import "component/_media.scss"; @import "component/_divider.scss"; +@import "component/_checkbox.scss"; @import "page/_show.scss"; diff --git a/ui/scss/component/_checkbox.scss b/ui/scss/component/_checkbox.scss new file mode 100644 index 000000000..0b2592bcb --- /dev/null +++ b/ui/scss/component/_checkbox.scss @@ -0,0 +1,71 @@ +*, *:before, *:after { + box-sizing: border-box; +} + +$md-checkbox-checked-color: var(--color-primary); +$md-checkbox-border-color: rgba(0, 0, 0, 0.54); + +$md-checkbox-size: 20px; +$md-checkbox-padding: 4px; + +$md-checkmark-width: 2px; +$md-checkmark-color: #fff; + +.form-field--checkbox { + position: relative; + + label { + cursor: pointer; + &:before, &:after { + content: ""; + position: absolute; + left:0; + top: 0; + } + + &:before { + // box + width: $md-checkbox-size; + height: $md-checkbox-size; + background: transparent; + border: 2px solid $md-checkbox-border-color; + border-radius: 2px; + cursor: pointer; + transition: background .3s; + } + + &:after { + // checkmark + } + } + + input[type="checkbox"] { + outline: 0; + visibility: hidden; + margin-right: 16px; + + &:checked { + + + label:before{ + background: $md-checkbox-checked-color; + border:none; + } + + label:after { + + $md-checkmark-size: $md-checkbox-size - 2*$md-checkbox-padding; + + transform: rotate(-45deg); + + top: ($md-checkbox-size / 2) - ($md-checkmark-size / 4) - $md-checkbox-size/10; + left: $md-checkbox-padding; + width: $md-checkmark-size; + height: $md-checkmark-size / 2; + + border: $md-checkmark-width solid $md-checkmark-color; + border-top-style: none; + border-right-style: none; + } + } + } + +}