Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce CSS by removing :not() selectors if variation is disabled #3118

Open
wants to merge 43 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ce82c4d
feat(step): reduce css if variations are disabled
lubber-de Nov 9, 2024
ec65596
feat(step): reduce css if variations are disabled
lubber-de Nov 9, 2024
3b871b6
feat(form): reduce css if variations are disabled
lubber-de Nov 9, 2024
8a74fc8
feat(grid): reduce css if variations are disabled
lubber-de Nov 9, 2024
01b693a
feat(menu): reduce css if variations are disabled
lubber-de Nov 9, 2024
38eea6b
feat(table): reduce css if variations are disabled
lubber-de Nov 9, 2024
f9049b3
feat(button): reduce css if variations are disabled
lubber-de Nov 9, 2024
a7c4fe8
feat(container): reduce css if variations are disabled
lubber-de Nov 9, 2024
f99e7ba
feat(divider): reduce css if variations are disabled
lubber-de Nov 9, 2024
1e42821
feat(emoji): reduce css if variations are disabled
lubber-de Nov 9, 2024
751363e
feat(header): reduce css if variations are disabled
lubber-de Nov 9, 2024
e2a82a1
feat(icon): reduce css if variations are disabled
lubber-de Nov 9, 2024
56b9dcb
feat(input): reduce css if variations are disabled
lubber-de Nov 9, 2024
0ea4225
feat(label): reduce css if variations are disabled
lubber-de Nov 9, 2024
79fce53
feat(list): reduce css if variations are disabled
lubber-de Nov 9, 2024
2f5d84d
feat(loader): reduce css if variations are disabled
lubber-de Nov 9, 2024
e71f29c
feat(input): reduce css if variations are disabled
lubber-de Nov 9, 2024
639cc5a
feat(segment): reduce css if variations are disabled
lubber-de Nov 9, 2024
9318ec6
feat(card): reduce css if variations are disabled
lubber-de Nov 9, 2024
03feab3
feat(feed): reduce css if variations are disabled
lubber-de Nov 9, 2024
363479c
feat(item): reduce css if variations are disabled
lubber-de Nov 9, 2024
0ca40d3
feat(accordion): reduce css if variations are disabled
lubber-de Nov 9, 2024
1f9685f
feat(calendar): reduce css if variations are disabled
lubber-de Nov 9, 2024
835257b
feat(checkbox): reduce css if variations are disabled
lubber-de Nov 9, 2024
e6024bd
feat(dimmer): reduce css if variations are disabled
lubber-de Nov 9, 2024
cd99c57
feat(checkbox): reduce css if variations are disabled
lubber-de Nov 9, 2024
afa64fb
feat(dimmer): reduce css if variations are disabled
lubber-de Nov 10, 2024
2c00fae
feat(dropdown): reduce css if variations are disabled
lubber-de Nov 10, 2024
c85b106
feat(flyout): reduce css if variations are disabled
lubber-de Nov 10, 2024
fd984c0
feat(modal): reduce css if variations are disabled
lubber-de Nov 10, 2024
1a7e863
feat(modal): reduce css if variations are disabled
lubber-de Nov 10, 2024
b33054b
feat(nag): reduce css if variations are disabled
lubber-de Nov 10, 2024
8aa3767
feat(nag): reduce css if variations are disabled
lubber-de Nov 10, 2024
b2b7a8f
feat(popup): reduce css if variations are disabled
lubber-de Nov 10, 2024
7623a57
feat(dropdown): reduce css if variations are disabled
lubber-de Nov 10, 2024
c42e5b5
feat(progress): reduce css if variations are disabled
lubber-de Nov 10, 2024
f0d2f68
feat(slider): reduce css if variations are disabled
lubber-de Nov 10, 2024
cc9ac9b
feat(toast): reduce css if variations are disabled
lubber-de Nov 10, 2024
2504d76
feat(form): reduce css if variations are disabled
lubber-de Nov 10, 2024
cf23660
feat(header): reduce css if variations are disabled
lubber-de Nov 10, 2024
8975ef5
feat(checkbox): reduce css if variations are disabled
lubber-de Nov 10, 2024
249028f
feat(form): reduce css if variations are disabled
lubber-de Nov 10, 2024
23f53ee
feat(flyout,modal): reduce css if variations are disabled
lubber-de Nov 10, 2024
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
61 changes: 37 additions & 24 deletions src/definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@

@import (multiple) "../../theme.config";

@notInline: if(@variationFormInline, e(":not(.inline)"));
@notInverted: if(@variationFormInverted, e(":not(.inverted)"));
@notWide: if(@variationFormWide, e(":not(.wide)"));
@notGrouped: if(@variationFormGrouped, e(":not(.grouped)"));
@notRequired: if(@variationFormRequired, e(":not(.required)"));
@notUnstackable: if(@variationFormUnstackable, e(":not(.unstackable)"));

@notToggle: if(@variationCheckboxToggle, e(":not(.toggle)"));
@notSlider: if(@variationCheckboxSlider, e(":not(.slider)"));
@notCompact: if(@variationDropdownCompact, e(":not(.compact)"));
@notIcon: if(@variationInputIcon, e(":not(.icon)"));
@notCorner: if(@variationLabelCorner, e(":not(.corner)"));

/*******************************
Elements
*******************************/
Expand Down Expand Up @@ -69,7 +82,7 @@
font-weight: @labelFontWeight;
text-transform: @labelTextTransform;
}
.ui.form:not(.inverted) .field > label:not(.button) {
.ui.form@{notInverted} .field > label:not(.button) {
color: @labelColor;
}

Expand Down Expand Up @@ -183,16 +196,16 @@
Checkbox margin
--------------------- */

.ui.form .fields:not(.grouped):not(.inline) .field:not(:only-child) label + .ui.ui.checkbox {
.ui.form .fields@{notGrouped}@{notInline} .field:not(:only-child) label + .ui.ui.checkbox {
margin-top: @checkboxLabelFieldTopMargin;
}
.ui.form .fields:not(.grouped):not(.inline) .field:not(:only-child) .ui.checkbox {
.ui.form .fields@{notGrouped}@{notInline} .field:not(:only-child) .ui.checkbox {
margin-top: @inputLineHeight + @checkboxFieldTopMargin;
}
.ui.form .fields:not(.grouped):not(.inline) .field:not(:only-child) .ui.toggle.checkbox {
.ui.form .fields@{notGrouped}@{notInline} .field:not(:only-child) .ui.toggle.checkbox {
margin-top: @inputLineHeight + @checkboxToggleFieldTopMargin;
}
.ui.form .fields:not(.grouped):not(.inline) .field:not(:only-child) .ui.slider.checkbox {
.ui.form .fields@{notGrouped}@{notInline} .field:not(:only-child) .ui.slider.checkbox {
margin-top: @inputLineHeight + @checkboxSliderFieldTopMargin;
}
.ui.ui.form .field .fields .field:not(:only-child) .ui.checkbox {
Expand All @@ -210,7 +223,7 @@
Transparent
--------------------- */

.ui.form .field .transparent.input:not(.icon) input,
.ui.form .field .transparent.input@{notIcon} input,
.ui.form .field input.transparent,
.ui.form .field textarea.transparent {
padding: @transparentPadding;
Expand Down Expand Up @@ -254,7 +267,7 @@
--------------------- */

/* Block */
.ui.form .field > .selection.dropdown:not(.compact) {
.ui.form .field > .selection.dropdown@{notCompact} {
min-width: auto;
width: 100%;
}
Expand Down Expand Up @@ -287,8 +300,8 @@

& when (@variationFormInline) {
/* Inline */
.ui.form .inline.fields .field:not(.wide) .ui.input,
.ui.form .inline.field:not(.wide) .ui.input {
.ui.form .inline.fields .field@{notWide} .ui.input,
.ui.form .inline.field@{notWide} .ui.input {
width: auto;
vertical-align: middle;
}
Expand Down Expand Up @@ -528,9 +541,9 @@
}

.ui.ui.form .fields.@{state} .field label,
.ui.ui.form .fields.@{state} .field .ui.label:not(.corner),
.ui.ui.form .fields.@{state} .field .ui.label@{notCorner},
.ui.ui.form .field.@{state} label,
.ui.ui.form .field.@{state} .ui.label:not(.corner),
.ui.ui.form .field.@{state} .ui.label@{notCorner},
.ui.ui.form .fields.@{state} .field .input,
.ui.ui.form .field.@{state} .input {
color: @c;
Expand Down Expand Up @@ -720,12 +733,12 @@
/*--------------------
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@{notToggle}@{notSlider} label,
.ui.form .field.@{state} .checkbox@{notToggle}@{notSlider} 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@{notToggle}@{notSlider} label::before,
.ui.form .field.@{state} .checkbox@{notToggle}@{notSlider} label::before {
background: @bg;
border-color: @bdc;
}
Expand Down Expand Up @@ -820,19 +833,19 @@
Required Field
--------------------- */

.ui.form .required.fields:not(.grouped):not(.inline) > .field > label::after,
.ui.form .required.fields@{notGrouped}@{notInline} > .field > label::after,
.ui.form .required.fields.inline > label::after,
.ui.form .required.fields.grouped > label::after,
.ui.form .required.field > label::after,
.ui.form .required.fields:not(.grouped):not(.inline) > .field > .checkbox::after,
.ui.form .required.fields@{notGrouped}@{notInline} > .field > .checkbox::after,
.ui.form .required.field > .checkbox::after,
.ui.form label.required::after {
margin: @requiredMargin;
content: @requiredContent;
color: @requiredColor;
}

.ui.form .required.fields:not(.grouped):not(.inline) > .field > label::after,
.ui.form .required.fields@{notGrouped}@{notInline} > .field > label::after,
.ui.form .required.fields.inline > label::after,
.ui.form .required.fields.grouped > label::after,
.ui.form .required.field > label::after,
Expand All @@ -841,21 +854,21 @@
vertical-align: top;
}

.ui.form .required.fields:not(.grouped):not(.inline) > .field > .checkbox::after,
.ui.form .required.fields@{notGrouped}@{notInline} > .field > .checkbox::after,
.ui.form .required.field > .checkbox::after {
position: absolute;
top: 0;
left: 100%;
}
}

.ui.ui.ui.ui.form .fields:not(.required) > label:empty::after,
.ui.ui.ui.ui.form .fields:not(.grouped):not(.inline) > .field:not(.required) > label:empty::after {
.ui.ui.ui.ui.form .fields@{notRequired} > label:empty::after,
.ui.ui.ui.ui.form .fields@{notGrouped}@{notInline} > .field@{notRequired} > label:empty::after {
content: " ";
display: inline-block;
}

.ui.ui.ui.ui.form .inline.fields .field:not(.required) > label:empty {
.ui.ui.ui.ui.form .inline.fields .field@{notRequired} > label:empty {
display: none;
}

Expand Down Expand Up @@ -1012,8 +1025,8 @@
margin-bottom: 0;
}

.ui.form:not(.unstackable) .fields:not(.unstackable) > .fields,
.ui.form:not(.unstackable) .fields:not(.unstackable) > .field {
.ui.form@{notUnstackable} .fields@{notUnstackable} > .fields,
.ui.form@{notUnstackable} .fields@{notUnstackable} > .field {
width: @oneColumn;
margin: 0 0 @rowDistance;
}
Expand Down
Loading