Skip to content

Commit

Permalink
refactor(ui5-checkbox): improve styling (#199)
Browse files Browse the repository at this point in the history
- fixes some tiny visual bugs
- removes CheckBox.qunit.js
- removes browser specific CSS
  • Loading branch information
MapTo0 committed Mar 20, 2019
1 parent 2608100 commit 6887985
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 442 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/CheckBox.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{{#if ctr._label.text}}
<ui5-label
class="sapWCLabelInCheckBox"
class="ui5-checkbox-label"
?wrap="{{ctr._label.wrap}}"
>{{ctr._label.text}}</ui5-label>
{{/if}}
Expand Down
26 changes: 13 additions & 13 deletions packages/main/src/CheckBoxTemplateContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ class CheckBoxTemplateContext {
}

static getMainClasses(state) {
const hoverable = !state.disabled && !state.readOnly && isDesktop();

return {
sapMCb: true,
sapMCbHasLabel: !!state.text,
sapMCbBgDis: state.disabled,
sapMCbRo: state.readOnly,
sapMCbErr: state.valueState === "Error",
sapMCbWarn: state.valueState === "Warning",
sapMCbWrapped: state.wrap,
"ui5-checkbox-wrapper": true,
"ui5-checkbox-with-label": !!state.text,
"ui5-checkbox--disabled": state.disabled,
"ui5-checkbox--readonly": state.readOnly,
"ui5-checkbox--error": state.valueState === "Error",
"ui5-checkbox--warning": state.valueState === "Warning",
"ui5-checkbox--wrap": state.wrap,
"ui5-checkbox--hoverable": hoverable,
};
}

static getInnerClasses(state) {
const hoverable = !state.disabled && !state.readOnly && isDesktop();

return {
sapMCbBg: true,
sapMCbHoverable: hoverable,
sapMCbMark: true,
sapMCbMarkChecked: !!state.checked,
"ui5-checkbox-inner": true,
"ui5-checkbox-inner-mark": true,
"ui5-checkbox-inner--checked": !!state.checked,
};
}
}
Expand Down
Loading

0 comments on commit 6887985

Please sign in to comment.