Skip to content

Commit dd7abfc

Browse files
authored
Merge pull request #842 from amatsuda/checkbox_appearance
Force native checkbox appearance for SimpleForm boolean inputs against Bootstrap 5 style
2 parents eec0e85 + 02d6826 commit dd7abfc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/assets/stylesheets/modules/forms.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,23 @@ input.boolean {
6868
margin: 4px;
6969
}
7070

71+
/* Force native checkbox appearance for SimpleForm boolean inputs */
72+
/* Bootstrap 5 hides checkboxes with appearance:none, position:absolute, etc. */
73+
input[type="checkbox"].boolean {
74+
-webkit-appearance: checkbox !important;
75+
-moz-appearance: checkbox !important;
76+
appearance: checkbox !important;
77+
position: static !important;
78+
width: auto !important;
79+
height: auto !important;
80+
margin-right: 0.5em !important;
81+
margin-top: 0 !important;
82+
opacity: 1 !important;
83+
pointer-events: auto !important;
84+
clip: auto !important;
85+
vertical-align: middle;
86+
}
87+
7188
.inline-form {
7289
display: flex;
7390
gap: 10px;

0 commit comments

Comments
 (0)