Skip to content

Commit ff40038

Browse files
authored
fix(form): adjust margin for field groups on mobile view
A field inside fields groups had a wrong bottom margin to the next field (or its labels) on mobile view . The whole mobile view adjustment could be implemented much easier which, as a result, fixed the main issue automatically. It also fixes a rare situation when one wide field is used That said, this PR removes the !important from the fields width allowing for simpler override in media query because of higher specificity
1 parent b385330 commit ff40038

File tree

1 file changed

+20
-68
lines changed

1 file changed

+20
-68
lines changed

src/definitions/collections/form.less

Lines changed: 20 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -924,29 +924,12 @@
924924
@media only screen and (max-width : @largestMobileScreen) {
925925
.ui.form .fields {
926926
flex-wrap: wrap;
927+
margin-bottom: 0;
927928
}
928929

929-
.ui[class*="equal width"].form:not(.unstackable) .fields > .field,
930-
.ui.form:not(.unstackable) [class*="equal width"].fields:not(.unstackable) > .field,
931-
.ui.form:not(.unstackable) .two.fields:not(.unstackable) > .fields,
932-
.ui.form:not(.unstackable) .two.fields:not(.unstackable) > .field,
933-
.ui.form:not(.unstackable) .three.fields:not(.unstackable) > .fields,
934-
.ui.form:not(.unstackable) .three.fields:not(.unstackable) > .field,
935-
.ui.form:not(.unstackable) .four.fields:not(.unstackable) > .fields,
936-
.ui.form:not(.unstackable) .four.fields:not(.unstackable) > .field,
937-
.ui.form:not(.unstackable) .five.fields:not(.unstackable) > .fields,
938-
.ui.form:not(.unstackable) .five.fields:not(.unstackable) > .field,
939-
.ui.form:not(.unstackable) .six.fields:not(.unstackable) > .fields,
940-
.ui.form:not(.unstackable) .six.fields:not(.unstackable) > .field,
941-
.ui.form:not(.unstackable) .seven.fields:not(.unstackable) > .fields,
942-
.ui.form:not(.unstackable) .seven.fields:not(.unstackable) > .field,
943-
.ui.form:not(.unstackable) .eight.fields:not(.unstackable) > .fields,
944-
.ui.form:not(.unstackable) .eight.fields:not(.unstackable) > .field,
945-
.ui.form:not(.unstackable) .nine.fields:not(.unstackable) > .fields,
946-
.ui.form:not(.unstackable) .nine.fields:not(.unstackable) > .field,
947-
.ui.form:not(.unstackable) .ten.fields:not(.unstackable) > .fields,
948-
.ui.form:not(.unstackable) .ten.fields:not(.unstackable) > .field {
949-
width: @oneColumn !important;
930+
.ui.form:not(.unstackable) .fields:not(.unstackable) > .fields,
931+
.ui.form:not(.unstackable) .fields:not(.unstackable) > .field {
932+
width: @oneColumn;
950933
margin: 0 0 @rowDistance;
951934
}
952935
}
@@ -960,85 +943,54 @@
960943
}
961944

962945
.ui.form .one.wide.field {
963-
width: @oneWide !important;
946+
width: @oneWide;
964947
}
965948
.ui.form .two.wide.field {
966-
width: @twoWide !important;
949+
width: @twoWide;
967950
}
968951
.ui.form .three.wide.field {
969-
width: @threeWide !important;
952+
width: @threeWide;
970953
}
971954
.ui.form .four.wide.field {
972-
width: @fourWide !important;
955+
width: @fourWide;
973956
}
974957
.ui.form .five.wide.field {
975-
width: @fiveWide !important;
958+
width: @fiveWide;
976959
}
977960
.ui.form .six.wide.field {
978-
width: @sixWide !important;
961+
width: @sixWide;
979962
}
980963
.ui.form .seven.wide.field {
981-
width: @sevenWide !important;
964+
width: @sevenWide;
982965
}
983966
.ui.form .eight.wide.field {
984-
width: @eightWide !important;
967+
width: @eightWide;
985968
}
986969
.ui.form .nine.wide.field {
987-
width: @nineWide !important;
970+
width: @nineWide;
988971
}
989972
.ui.form .ten.wide.field {
990-
width: @tenWide !important;
973+
width: @tenWide;
991974
}
992975
.ui.form .eleven.wide.field {
993-
width: @elevenWide !important;
976+
width: @elevenWide;
994977
}
995978
.ui.form .twelve.wide.field {
996-
width: @twelveWide !important;
979+
width: @twelveWide;
997980
}
998981
.ui.form .thirteen.wide.field {
999-
width: @thirteenWide !important;
982+
width: @thirteenWide;
1000983
}
1001984
.ui.form .fourteen.wide.field {
1002-
width: @fourteenWide !important;
985+
width: @fourteenWide;
1003986
}
1004987
.ui.form .fifteen.wide.field {
1005-
width: @fifteenWide !important;
988+
width: @fifteenWide;
1006989
}
1007990
.ui.form .sixteen.wide.field {
1008-
width: @sixteenWide !important;
991+
width: @sixteenWide;
1009992
}
1010993

1011-
/* Swap to full width on mobile */
1012-
@media only screen and (max-width : @largestMobileScreen) {
1013-
.ui.form:not(.unstackable) .two.fields:not(.unstackable) > .fields,
1014-
.ui.form:not(.unstackable) .two.fields:not(.unstackable) > .field,
1015-
.ui.form:not(.unstackable) .three.fields:not(.unstackable) > .fields,
1016-
.ui.form:not(.unstackable) .three.fields:not(.unstackable) > .field,
1017-
.ui.form:not(.unstackable) .four.fields:not(.unstackable) > .fields,
1018-
.ui.form:not(.unstackable) .four.fields:not(.unstackable) > .field,
1019-
.ui.form:not(.unstackable) .five.fields:not(.unstackable) > .fields,
1020-
.ui.form:not(.unstackable) .five.fields:not(.unstackable) > .field,
1021-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .two.wide.field,
1022-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .three.wide.field,
1023-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .four.wide.field,
1024-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .five.wide.field,
1025-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .six.wide.field,
1026-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .seven.wide.field,
1027-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .eight.wide.field,
1028-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .nine.wide.field,
1029-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .ten.wide.field,
1030-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .eleven.wide.field,
1031-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .twelve.wide.field,
1032-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .thirteen.wide.field,
1033-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .fourteen.wide.field,
1034-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .fifteen.wide.field,
1035-
.ui.form:not(.unstackable) .fields:not(.unstackable) > .sixteen.wide.field {
1036-
width: @oneColumn !important;
1037-
}
1038-
.ui.form .fields {
1039-
margin-bottom: 0;
1040-
}
1041-
}
1042994

1043995
/*--------------------
1044996
Equal Width

0 commit comments

Comments
 (0)