Skip to content

Commit

Permalink
fix(checkbox): remove old v1 checkbox box code
Browse files Browse the repository at this point in the history
This PR delete the old code for v1 checkboxes that isn't even documented anymore.

Since target 2.9 is a breaking change, I think that we can delete it before the 3.0 release safely.
  • Loading branch information
prudho committed Aug 10, 2021
1 parent 3eadf38 commit a254f59
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 159 deletions.
14 changes: 3 additions & 11 deletions src/definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -671,22 +671,16 @@
Checkbox State
---------------------*/
.ui.form .fields.@{state} .field .checkbox:not(.toggle):not(.slider) label,
.ui.form .field.@{state} .checkbox:not(.toggle):not(.slider) label,
.ui.form .fields.@{state} .field .checkbox:not(.toggle):not(.slider) .box,
.ui.form .field.@{state} .checkbox:not(.toggle):not(.slider) .box {
.ui.form .field.@{state} .checkbox:not(.toggle):not(.slider) label {
color: @c;
}
.ui.form .fields.@{state} .field .checkbox:not(.toggle):not(.slider) label:before,
.ui.form .field.@{state} .checkbox:not(.toggle):not(.slider) label:before,
.ui.form .fields.@{state} .field .checkbox:not(.toggle):not(.slider) .box:before,
.ui.form .field.@{state} .checkbox:not(.toggle):not(.slider) .box:before {
.ui.form .field.@{state} .checkbox:not(.toggle):not(.slider) label:before {
background: @bg;
border-color: @bdc;
}
.ui.form .fields.@{state} .field .checkbox label:after,
.ui.form .field.@{state} .checkbox label:after,
.ui.form .fields.@{state} .field .checkbox .box:after,
.ui.form .field.@{state} .checkbox .box:after {
.ui.form .field.@{state} .checkbox label:after {
color: @c;
}

Expand Down Expand Up @@ -813,9 +807,7 @@
.ui.inverted.form label,
.ui.form .inverted.segment label,
.ui.form .inverted.segment .ui.checkbox label,
.ui.form .inverted.segment .ui.checkbox .box,
.ui.inverted.form .ui.checkbox label,
.ui.inverted.form .ui.checkbox .box,
.ui.inverted.form .inline.fields > label,
.ui.inverted.form .inline.fields .field > label,
.ui.inverted.form .inline.fields .field > p,
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ $.fn.checkbox.settings = {

selector : {
checkbox : '.ui.checkbox',
label : 'label, .box',
label : 'label',
input : 'input[type="checkbox"], input[type="radio"]',
link : 'a[href]'
}
Expand Down
146 changes: 0 additions & 146 deletions src/definitions/modules/checkbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,126 +55,6 @@
}


& when (@variationCheckboxBox) {
/*--------------
Box
---------------*/

/* .box selector is deprecated and will be removed in v3 */
.ui.checkbox .box {
&:extend(.ui.checkbox label all);
}
.ui.checkbox + .box {
&:extend(.ui.checkbox + label all);
}
.ui.checkbox input:focus ~ .box {
&:extend(.ui.checkbox input:focus ~ label all);
}
.ui.checkbox input:checked ~ .box {
&:extend(.ui.checkbox input:checked ~ label all);
}
& when (@variationCheckboxIndeterminate) {
.ui.checkbox input:not([type=radio]):indeterminate ~ .box {
&:extend(.ui.checkbox input:not([type=radio]):indeterminate ~ label all);
}
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ .box {
&:extend(.ui.checkbox input:not([type=radio]):indeterminate:focus ~ label all);
}
}
.ui.checkbox input:checked:focus ~ .box {
&:extend(.ui.checkbox input:checked:focus ~ label all);
}
& when (@variationCheckboxDisabled) {
.ui.disabled.checkbox .box {
&:extend(.ui.disabled.checkbox label all);
}

.ui.checkbox input[disabled] ~ .box {
&:extend(.ui.checkbox input[disabled] ~ label all);
}
}
& when (@variationCheckboxRadio) {
.ui.radio.checkbox .box {
&:extend(.ui.radio.checkbox label all);
}
.ui.radio.checkbox input:focus ~ .box {
&:extend(.ui.radio.checkbox input:focus ~ label all);
}
.ui.radio.checkbox input:indeterminate ~ .box {
&:extend(.ui.radio.checkbox input:indeterminate ~ label all);
}
.ui.radio.checkbox input:checked ~ .box {
&:extend(.ui.radio.checkbox input:checked ~ label all);
}
.ui.radio.checkbox input:focus:checked ~ .box {
&:extend(.ui.radio.checkbox input:focus:checked ~ label all);
}
}
& when (@variationCheckboxSlider) {
.ui.slider.checkbox .box {
&:extend(.ui.slider.checkbox label all);
}
.ui.slider.checkbox input:focus ~ .box {
&:extend(.ui.slider.checkbox input:focus ~ label all);
}
.ui.slider.checkbox input:checked ~ .box {
&:extend(.ui.slider.checkbox input:checked ~ label all);
}
.ui.slider.checkbox input:focus:checked ~ .box {
&:extend(.ui.slider.checkbox input:focus:checked ~ label all);
}
}
& when (@variationCheckboxToggle) {
.ui.toggle.checkbox .box {
&:extend(.ui.toggle.checkbox label all);
}
.ui.toggle.checkbox input ~ .box {
&:extend(.ui.toggle.checkbox input ~ label all);
}
.ui.toggle.checkbox input:focus ~ .box {
&:extend(.ui.toggle.checkbox input:focus ~ label all);
}
.ui.toggle.checkbox input:checked ~ .box {
&:extend(.ui.toggle.checkbox input:checked ~ label all);
}
.ui.toggle.checkbox input:focus:checked ~ .box {
&:extend(.ui.toggle.checkbox input:focus:checked ~ label all);
}
}
& when (@variationCheckboxFitted) {
.ui.fitted.checkbox .box {
&:extend(.ui.fitted.checkbox label all);
}
}
& when (@variationCheckboxInverted) {
.ui.inverted.checkbox .box {
&:extend(.ui.inverted.checkbox label all);
}
& when (@variationCheckboxSlider) {
.ui.inverted.slider.checkbox .box {
&:extend(.ui.inverted.slider.checkbox label all);
}
.ui.inverted.slider.checkbox input:checked ~ .box {
&:extend(.ui.inverted.slider.checkbox input:checked ~ label all);
}
.ui.inverted.slider.checkbox input:focus:checked ~ .box {
&:extend(.ui.inverted.slider.checkbox input:focus:checked ~ label all);
}
}
& when (@variationCheckboxToggle) {
.ui.inverted.toggle.checkbox .box {
&:extend(.ui.inverted.toggle.checkbox label all);
}
.ui.inverted.toggle.checkbox input:checked ~ .box {
&:extend(.ui.inverted.toggle.checkbox input:checked ~ label all);
}
.ui.inverted.toggle.checkbox input:focus:checked ~ .box {
&:extend(.ui.inverted.toggle.checkbox input:focus:checked ~ label all);
}
}
}
}

.ui.checkbox label {
cursor: auto;
position: relative;
Expand Down Expand Up @@ -833,32 +713,6 @@ each(@variationCheckboxSizes, {
}
}
}
& when (@@raw > 1) and (@variationCheckboxBox) {
.ui.@{value}.form .checkbox,
.ui.@{value}.checkbox {
&:not(.slider):not(.toggle):not(.radio) {
&
.box:after,
.box:before {
transform: scale(@@raw);
transform-origin:left;
}
}
&.radio when (@variationCheckboxRadio) {
&
.box:before {
transform: scale(@@raw);
transform-origin:left;
}
&
.box:after {
transform:scale(@@circleScale);
transform-origin:left;
left: @@circleLeft;
}
}
}
}
})

.loadUIOverrides();
1 change: 0 additions & 1 deletion src/themes/default/globals/variation.variables
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@
@variationCalendarDisabled: true;

/* Checkbox */
@variationCheckboxBox: false; //.box (instead of label) is an ancient fragment of sui v1 and not even documented in v2.x anymore
@variationCheckboxDisabled: true;
@variationCheckboxReadonly: true;
@variationCheckboxInverted: true;
Expand Down

0 comments on commit a254f59

Please sign in to comment.