semantic-forms 5.1.12 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,12 +14,14 @@ form.semanticForms, form.semanticForms.light, table.semanticForms {
14
14
  --semanticFormsButtonGradientDark: #c0c0c0;
15
15
  --semanticFormsInvalid: #f00;
16
16
  --semanticFormsInvalidBorder: 1px solid var(--semanticFormsInvalid);
17
+ --semanticFormsWarn: #ffdd00;
18
+ --semanticFormsWarnBorder: 1px solid var(--semanticFormsWarn);
17
19
  --semanticFormsInputHeight: 38px;
18
20
  --semanticFormsInputFontSize: 16px;
19
21
  --semanticFormsInputTopMargin: 15px;
20
22
  --semanticFormsInputMinWidth: 250px;
21
23
  --semanticFormsBorderRadius: 10px;
22
- --semanticFormsNestedFieldsetBgColor: rgba(0, 0, 0, .05);
24
+ --semanticFormsNestedFieldsetBgColor: oklch(from var(--semanticFormsFormSubBgColor) 0.3 c h / 0.05);
23
25
  --semanticFormsNestedFieldsetBorder: 1px rgba(0, 0, 0, .2) solid;
24
26
  --semanticFormsNestedInputBgColor: #fff;
25
27
  --semanticFormsBorder: 1px var(--semanticFormsBorderColor) solid;
@@ -45,7 +47,7 @@ form.semanticForms, form.semanticForms.light, table.semanticForms {
45
47
  --semanticFormsClearButtonColor: #fff;
46
48
  --semanticFormsButtonGradientLight: #6f6f6f;
47
49
  --semanticFormsButtonGradientDark: #373737;
48
- --semanticFormsNestedFieldsetBgColor: rgba(255, 255, 255, .05);
50
+ --semanticFormsNestedFieldsetBgColor: oklch(from var(--semanticFormsFormSubBgColor) 0.9 c h / 0.05);
49
51
  --semanticFormsNestedFieldsetBorder: 1px rgba(255, 255, 255, .1) solid;
50
52
  --semanticFormsNestedInputBgColor: rgba(255, 255, 255, .15);
51
53
  --semanticFormsBorder: none;
@@ -96,7 +98,8 @@ table.semanticForms.light {
96
98
  container-type: inline-size;
97
99
  container-name: semanticForm;
98
100
 
99
- @supports (interpolate-size: allow-keywords) { // https://caniuse.com/wf-interpolate-size
101
+ // https://caniuse.com/wf-interpolate-size
102
+ @supports (interpolate-size: allow-keywords) {
100
103
  interpolate-size: allow-keywords;
101
104
  }
102
105
 
@@ -205,8 +208,8 @@ table.semanticForms.light {
205
208
  input[type=checkbox],
206
209
  input[type=radio] {
207
210
  // 30% larger based on parent font size
208
- width: 1.4em;
209
- height: 1.4em;
211
+ width: 18px;
212
+ height: 18px;
210
213
  margin: 3px 0;
211
214
  cursor: pointer;
212
215
 
@@ -401,6 +404,18 @@ table.semanticForms.light {
401
404
  }
402
405
  }
403
406
 
407
+ &.warn {
408
+ border: var(--semanticFormsWarnBorder) !important;
409
+
410
+ ~ label:nth-of-type(2) {
411
+ color: var(--semanticFormsWarn) !important;
412
+ }
413
+
414
+ ~ [data-invalid-text] {
415
+ font-size: small;
416
+ display: flex;
417
+ }
418
+ }
404
419
  }
405
420
  // #endregion
406
421
 
@@ -451,7 +466,7 @@ table.semanticForms.light {
451
466
  details {
452
467
  box-sizing: border-box; // ensure sizings match across browsers
453
468
  position: relative;
454
- background-color: var(--semanticFormsNestedFieldsetBgColor); // TODO: check if this is right
469
+ background-color: var(--semanticFormsNestedFieldsetBgColor);
455
470
  border: var(--semanticFormsNestedFieldsetBorder);
456
471
  border-radius: var(--semanticFormsBorderRadius);
457
472
  display: flex;
@@ -601,7 +616,8 @@ table.semanticForms.light {
601
616
  }
602
617
 
603
618
  button:not(.clear, .show),
604
- input[type="submit"]:not(.clear, .show) {
619
+ input[type="submit"]:not(.clear, .show),
620
+ input[type="button"]:not(.clear, .show) {
605
621
  grid-row: 1 / 2;
606
622
  grid-column: 2 / 3;
607
623
  width: 100%;
@@ -615,8 +631,8 @@ table.semanticForms.light {
615
631
  display: inline-block;
616
632
  }
617
633
 
618
- // TODO: handle help text as well (will need to be grid-columns: 0 2 or whatever it is)
619
- label:nth-of-type(2) {
634
+ label:nth-of-type(2),
635
+ label:not(.floatLabelFormAnimatedLabel) {
620
636
  grid-row: 2 / 3;
621
637
  grid-column: 1 / -1;
622
638
  }
@@ -663,6 +679,29 @@ table.semanticForms.light {
663
679
  gap: 5px;
664
680
  }
665
681
  }
682
+
683
+ // focus-key styles
684
+ &:has(span.focus-key) {
685
+ // make room for focus key span
686
+ label:first-of-type {
687
+ width: calc(100% - 95px) !important;
688
+ }
689
+
690
+ span.focus-key {
691
+ display: block;
692
+
693
+ kbd {
694
+ font-family: sans-serif;
695
+ }
696
+ }
697
+
698
+ &:has(input:focus, select:focus, textarea:focus),
699
+ &:not(:has(input:placeholder-shown, textarea:placeholder-shown)) {
700
+ span.focus-key {
701
+ display: none;
702
+ }
703
+ }
704
+ }
666
705
  }
667
706
  }
668
707
 
@@ -862,6 +901,23 @@ table.semanticForms.light {
862
901
  }
863
902
  }
864
903
  }
904
+
905
+ .focus-key {
906
+ color: var(--semanticFormsPlaceholderColor);
907
+ position: absolute;
908
+ top: calc(var(--semanticFormsInputTopMargin) + 11px);
909
+ right: 20px;
910
+
911
+ kbd {
912
+ line-height: 1;
913
+ }
914
+ }
915
+
916
+ &:has(input[type="number"]) {
917
+ .focus-key {
918
+ right: 45px;
919
+ }
920
+ }
865
921
  }
866
922
 
867
923
  // top level label for checkbox and radio groups
@@ -939,84 +995,92 @@ table.semanticForms.light {
939
995
  // #endregion
940
996
  }
941
997
 
942
- &.semanticFormsActive {
943
- // #region colspan classes
944
- div {
945
- &[class^='colspan-'] {
946
- max-width: 100%;
947
- }
948
-
949
- &.colspan-full {
950
- grid-column: 1 / -1;
951
- }
952
-
953
- &.colspan-5 {
954
- grid-column: span 5;
955
- }
956
-
957
- &.colspan-4 {
958
- grid-column: span 4;
959
- }
998
+ // #region colspan classes
999
+ div {
1000
+ &[class^='colspan-'] {
1001
+ max-width: 100%;
1002
+ }
960
1003
 
961
- &.colspan-3 {
962
- grid-column: span 3;
963
- }
1004
+ &.colspan-full {
1005
+ grid-column: 1 / -1;
1006
+ }
964
1007
 
965
- &.colspan-2 {
966
- grid-column: span 2;
967
- }
1008
+ &.colspan-5 {
1009
+ grid-column: span 5;
1010
+ }
968
1011
 
969
- &.colspan-1 {
970
- grid-column: span 1;
971
- }
1012
+ &.colspan-4 {
1013
+ grid-column: span 4;
972
1014
  }
973
1015
 
974
- fieldset[class^='colspan-'] dl,
975
- dl[class^='colspan-'] {
976
- div {
977
- max-width: 100%;
978
- }
1016
+ &.colspan-3 {
1017
+ grid-column: span 3;
979
1018
  }
980
1019
 
981
- fieldset.colspan-full dl,
982
- dl.colspan-full {
983
- grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
1020
+ &.colspan-2 {
1021
+ grid-column: span 2;
984
1022
  }
985
1023
 
986
- fieldset.colspan-5 dl,
987
- dl.colspan-5 {
988
- grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr));
1024
+ &.colspan-1 {
1025
+ grid-column: span 1;
989
1026
  }
1027
+ }
990
1028
 
991
- fieldset.colspan-4 dl,
992
- dl.colspan-4 {
993
- grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr));
1029
+ fieldset[class^='colspan-'] dl,
1030
+ dl[class^='colspan-'] {
1031
+ div {
1032
+ max-width: 100%;
994
1033
  }
1034
+ }
995
1035
 
1036
+ fieldset.colspan-full dl,
1037
+ dl.colspan-full {
1038
+ grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
1039
+ }
996
1040
 
997
- fieldset.colspan-3 dl,
998
- dl.colspan-3 {
999
- grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr));
1000
- }
1041
+ fieldset.colspan-5 dl,
1042
+ dl.colspan-5 {
1043
+ grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr));
1044
+ }
1001
1045
 
1002
- fieldset.colspan-2 dl,
1003
- dl.colspan-2 {
1004
- grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr));
1005
- }
1046
+ fieldset.colspan-4 dl,
1047
+ dl.colspan-4 {
1048
+ grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr));
1049
+ }
1006
1050
 
1007
- fieldset.colspan-1 dl,
1008
- dl.colspan-1 {
1009
- grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr));
1010
- }
1011
- // #endregion
1012
1051
 
1013
- // #region container queries
1014
- // The container is the <fieldset> element
1015
- @container semanticForm (width > 2250px) {
1016
- &.lowFlow fieldset dl,
1017
- &.lowFlow dl {
1018
- grid-template-columns: repeat(6, minmax(var(--semanticFormsInputMinWidth), 1fr));
1052
+ fieldset.colspan-3 dl,
1053
+ dl.colspan-3 {
1054
+ grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr));
1055
+ }
1056
+
1057
+ fieldset.colspan-2 dl,
1058
+ dl.colspan-2 {
1059
+ grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr));
1060
+ }
1061
+
1062
+ fieldset.colspan-1 dl,
1063
+ dl.colspan-1 {
1064
+ grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr));
1065
+ }
1066
+ // #endregion
1067
+
1068
+ // #region container queries
1069
+ // The container is the <fieldset> element
1070
+ @container semanticForm (width > 2250px) {
1071
+ fieldset dl,
1072
+ dl {
1073
+ grid-template-columns: repeat(6, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1074
+
1075
+ div {
1076
+ max-width: 100% !important;
1077
+ }
1078
+ }
1019
1079
 
1080
+ &.lowFlow,
1081
+ &:not(.semanticFormsActive) {
1082
+ & fieldset dl,
1083
+ & dl {
1020
1084
  & dt:nth-of-type(6n + 1),
1021
1085
  & dd:nth-of-type(6n + 1) {
1022
1086
  grid-column: 1;
@@ -1048,12 +1112,23 @@ table.semanticForms.light {
1048
1112
  }
1049
1113
  }
1050
1114
  }
1115
+ }
1051
1116
 
1052
- @container semanticForm (width < 2250px) {
1053
- &.lowFlow fieldset dl,
1054
- &.lowFlow dl {
1055
- grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr));
1117
+ // max 5 columns
1118
+ @container semanticForm (width < 2250px) {
1119
+ fieldset dl,
1120
+ dl {
1121
+ grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1056
1122
 
1123
+ div {
1124
+ max-width: 100% !important;
1125
+ }
1126
+ }
1127
+
1128
+ &.lowFlow,
1129
+ &:not(.semanticFormsActive) {
1130
+ & fieldset dl,
1131
+ & dl {
1057
1132
  & dt:nth-of-type(5n + 1),
1058
1133
  & dd:nth-of-type(5n + 1) {
1059
1134
  grid-column: 1;
@@ -1080,23 +1155,26 @@ table.semanticForms.light {
1080
1155
  }
1081
1156
  }
1082
1157
  }
1158
+ }
1083
1159
 
1084
- @container semanticForm (width < 1300px) {
1085
- fieldset.colspan-5 dl,
1086
- dl.colspan-5 {
1087
- grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1088
- }
1089
-
1090
- div.colspan-5 {
1091
- grid-column: span 4 !important;
1092
- }
1160
+ @container semanticForm (width < 1400px) {
1161
+ fieldset dl,
1162
+ dl,
1163
+ fieldset.colspan-5 dl,
1164
+ dl.colspan-5 {
1165
+ grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1166
+ }
1093
1167
 
1094
- &.lowFlow fieldset dl,
1095
- &.lowFlow dl,
1096
- &.lowFlow fieldset.colspan-5 dl,
1097
- &.lowFlow dl.colspan-5 {
1098
- grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr));
1168
+ div.colspan-5 {
1169
+ grid-column: span 4 !important;
1170
+ }
1099
1171
 
1172
+ &.lowFlow,
1173
+ &:not(.semanticFormsActive) {
1174
+ & fieldset dl,
1175
+ & fieldset.colspan-5 dl,
1176
+ & dl,
1177
+ & dl.colspan-5 {
1100
1178
  & dt:nth-of-type(4n + 1),
1101
1179
  & dd:nth-of-type(4n + 1) {
1102
1180
  grid-column: 1;
@@ -1118,27 +1196,32 @@ table.semanticForms.light {
1118
1196
  }
1119
1197
  }
1120
1198
  }
1199
+ }
1121
1200
 
1122
- @container semanticForm (width < 1050px) {
1123
- fieldset.colspan-4 dl,
1124
- fieldset.colspan-5 dl,
1125
- dl.colspan-4,
1126
- dl.colspan-5 {
1127
- grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1128
- }
1201
+ // max 3 columns
1202
+ @container semanticForm (width < 1120px) {
1203
+ fieldset dl,
1204
+ fieldset.colspan-4 dl,
1205
+ fieldset.colspan-5 dl,
1206
+ dl,
1207
+ dl.colspan-4,
1208
+ dl.colspan-5 {
1209
+ grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1210
+ }
1129
1211
 
1130
- div.colspan-4, div.colspan-5 {
1131
- grid-column: span 3 !important;
1132
- }
1133
1212
 
1134
- &.lowFlow fieldset dl,
1135
- &.lowFlow dl,
1136
- &.lowFlow fieldset.colspan-4 dl,
1137
- &.lowFlow dl.colspan-4,
1138
- &.lowFlow fieldset.colspan-5 dl,
1139
- &.lowFlow dl.colspan-5 {
1140
- grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr));
1213
+ div.colspan-4, div.colspan-5 {
1214
+ grid-column: span 3 !important;
1215
+ }
1141
1216
 
1217
+ &.lowFlow,
1218
+ &:not(.semanticFormsActive) {
1219
+ & fieldset dl,
1220
+ & fieldset.colspan-4 dl,
1221
+ & fieldset.colspan-5 dl,
1222
+ & dl,
1223
+ & dl.colspan-4,
1224
+ & dl.colspan-5 {
1142
1225
  & dt:nth-of-type(3n + 1),
1143
1226
  & dd:nth-of-type(3n + 1) {
1144
1227
  grid-column: 1;
@@ -1155,33 +1238,41 @@ table.semanticForms.light {
1155
1238
  }
1156
1239
  }
1157
1240
  }
1241
+ }
1158
1242
 
1159
- @container semanticForm (width < 800px) {
1160
- fieldset.colspan-3 dl,
1161
- fieldset.colspan-4 dl,
1162
- fieldset.colspan-5 dl,
1163
- dl.colspan-3,
1164
- dl.colspan-4,
1165
- dl.colspan-5 {
1166
- grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1167
- }
1243
+ // max 2 columns
1244
+ @container semanticForm (width < 850px) {
1245
+ fieldset dl,
1246
+ fieldset.colspan-3 dl,
1247
+ fieldset.colspan-4 dl,
1248
+ fieldset.colspan-5 dl,
1249
+ dl,
1250
+ dl.colspan-3,
1251
+ dl.colspan-4,
1252
+ dl.colspan-5 {
1253
+ grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1254
+ }
1168
1255
 
1169
- div.colspan-3,
1170
- div.colspan-4,
1171
- div.colspan-5 {
1172
- grid-column: span 2 !important;
1173
- }
1256
+ div {
1257
+ max-width: 100% !important;
1258
+ }
1174
1259
 
1175
- &.lowFlow fieldset dl,
1176
- &.lowFlow dl,
1177
- &.lowFlow fieldset.colspan-3 dl,
1178
- &.lowFlow dl.colspan-3,
1179
- &.lowFlow fieldset.colspan-4 dl,
1180
- &.lowFlow dl.colspan-4,
1181
- &.lowFlow fieldset.colspan-5 dl,
1182
- &.lowFlow dl.colspan-5 {
1183
- grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr));
1260
+ div.colspan-3,
1261
+ div.colspan-4,
1262
+ div.colspan-5 {
1263
+ grid-column: span 2 !important;
1264
+ }
1184
1265
 
1266
+ &.lowFlow,
1267
+ &:not(.semanticFormsActive) {
1268
+ & fieldset dl,
1269
+ & fieldset.colspan-3 dl,
1270
+ & fieldset.colspan-4 dl,
1271
+ & fieldset.colspan-5 dl,
1272
+ & dl,
1273
+ & dl.colspan-3,
1274
+ & dl.colspan-4,
1275
+ & dl.colspan-5 {
1185
1276
  & dt:nth-of-type(2n + 1),
1186
1277
  & dd:nth-of-type(2n + 1) {
1187
1278
  grid-column: 1;
@@ -1193,109 +1284,217 @@ table.semanticForms.light {
1193
1284
  }
1194
1285
  }
1195
1286
  }
1287
+ }
1196
1288
 
1197
- @container semanticForm (width < 550px) {
1198
- fieldset.colspan-2 dl,
1199
- fieldset.colspan-3 dl,
1200
- fieldset.colspan-4 dl,
1201
- fieldset.colspan-5 dl,
1202
- dl.colspan-2,
1203
- dl.colspan-3,
1204
- dl.colspan-4,
1205
- dl.colspan-5,
1206
- dl {
1207
- grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1208
- }
1289
+ // max 1 column
1290
+ @container semanticForm (width < 615px) {
1291
+ fieldset dl,
1292
+ fieldset.colspan-2 dl,
1293
+ fieldset.colspan-3 dl,
1294
+ fieldset.colspan-4 dl,
1295
+ fieldset.colspan-5 dl,
1296
+ dl,
1297
+ dl.colspan-2,
1298
+ dl.colspan-3,
1299
+ dl.colspan-4,
1300
+ dl.colspan-5,
1301
+ dl {
1302
+ grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
1303
+ }
1209
1304
 
1210
- div.colspan-2, div.colspan-3, div.colspan-4, div.colspan-5 {
1211
- grid-column: span 1 !important;
1212
- }
1305
+ div {
1306
+ max-width: 100% !important;
1307
+ }
1213
1308
 
1214
- &.lowFlow fieldset dl,
1215
- &.lowFlow dl,
1216
- &.lowFlow fieldset.colspan-2 dl,
1217
- &.lowFlow dl.colspan-2,
1218
- &.lowFlow fieldset.colspan-3 dl,
1219
- &.lowFlow dl.colspan-3,
1220
- &.lowFlow fieldset.colspan-4 dl,
1221
- &.lowFlow dl.colspan-4,
1222
- &.lowFlow fieldset.colspan-5 dl,
1223
- &.lowFlow dl.colspan-5 {
1224
- grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr));
1309
+ div.colspan-2, div.colspan-3, div.colspan-4, div.colspan-5 {
1310
+ grid-column: span 1 !important;
1311
+ }
1225
1312
 
1313
+ &.lowFlow,
1314
+ &:not(.semanticFormsActive) {
1315
+ & fieldset dl,
1316
+ & fieldset.colspan-2 dl,
1317
+ & fieldset.colspan-3 dl,
1318
+ & fieldset.colspan-4 dl,
1319
+ & fieldset.colspan-5 dl,
1320
+ & dl,
1321
+ & dl.colspan-2,
1322
+ & dl.colspan-3,
1323
+ & dl.colspan-4,
1324
+ & dl.colspan-5 {
1226
1325
  & dt:nth-of-type(n + 1),
1227
1326
  & dd:nth-of-type(n + 1) {
1228
1327
  grid-column: 1;
1229
1328
  }
1230
1329
  }
1231
1330
  }
1232
- // #endregion
1331
+ }
1332
+ // #endregion
1233
1333
 
1234
- // #region low flow form
1235
- &.lowFlow {
1236
- gap: 5px;
1334
+ // #region low flow form
1335
+ &.lowFlow,
1336
+ &:not(.semanticFormsActive) {
1337
+ gap: 10px;
1237
1338
 
1238
- dl {
1239
- grid-auto-flow: dense;
1339
+ dl {
1340
+ grid-auto-flow: dense;
1341
+ gap: 0 10px;
1342
+ margin-bottom: 0px;
1343
+ }
1344
+
1345
+ // 1, 4, 7, ...
1346
+ & > dt:nth-of-type(2n + 1),
1347
+ & > dd:nth-of-type(2n + 1) {
1348
+ grid-column: 1;
1349
+ }
1350
+
1351
+ // 2, 5, 8, ...
1352
+ & > dt:nth-of-type(2n + 2),
1353
+ & > dd:nth-of-type(2n + 2) {
1354
+ grid-column: 2;
1355
+ }
1356
+
1357
+ dt {
1358
+ min-width: var(--semanticFormsInputMinWidth) !important; /* this matches the max-width of js-enabled inputs */
1359
+
1360
+ label {
1361
+ position: absolute;
1362
+ display: block;
1363
+ height: 11px;
1364
+ transform: scale(0.7);
1365
+ transform-origin: left center;
1366
+ padding-left: 29px;
1367
+ margin-top: -1px;
1240
1368
  }
1241
1369
 
1242
- // 1, 4, 7, ...
1243
- & > dt:nth-of-type(2n + 1),
1244
- & > dd:nth-of-type(2n + 1) {
1245
- grid-column: 1;
1370
+ // add required asterisk
1371
+ &:has(+ dd input:required) {
1372
+ label::after {
1373
+ content: ' *';
1374
+ color: red;
1375
+ }
1246
1376
  }
1377
+ }
1247
1378
 
1248
- // 2, 5, 8, ...
1249
- & > dt:nth-of-type(2n + 2),
1250
- & > dd:nth-of-type(2n + 2) {
1251
- grid-column: 2;
1379
+ // checkbox/radio groups
1380
+ dt {
1381
+ &:has(+ dd.checkboxes),
1382
+ &:has(+ dd.radios) {
1383
+ label {
1384
+ padding-left: 15px;
1385
+ }
1252
1386
  }
1387
+ }
1253
1388
 
1254
- dt {
1255
- min-width: var(--semanticFormsInputMinWidth) !important; /* this matches the max-width of js-enabled inputs */
1389
+ // single checkbox label
1390
+ dt {
1391
+ &:not(:has(+ dd ul)){
1392
+ &:has(+ dd input[type=checkbox]) {
1393
+ label {
1394
+ transform: scale(1);
1395
+ margin-top: 4px;
1396
+ margin-left: 8px;
1397
+ }
1398
+ }
1256
1399
 
1257
- // add required asterisk
1258
- &:has(+ dd input:required) {
1259
- label::after {
1260
- content: ' *';
1261
- color: red;
1400
+ &:has(+ dd input[type=radio]) {
1401
+ label {
1402
+ transform: scale(1);
1403
+ margin-top: 2px;
1404
+ margin-left: 8px;
1262
1405
  }
1263
1406
  }
1264
1407
  }
1408
+ }
1409
+
1265
1410
 
1411
+ dd {
1412
+ // margin-bottom: 10px;
1413
+ margin-top: var(--semanticFormsInputTopMargin);
1414
+ margin-bottom: 10px;
1415
+ min-width: var(--semanticFormsInputMinWidth) !important; /* this matches the max-width of js-enabled inputs */
1266
1416
 
1267
- dd {
1268
- margin-bottom: 10px;
1269
- min-width: var(--semanticFormsInputMinWidth) !important; /* this matches the max-width of js-enabled inputs */
1417
+ // checkbox/radio groups
1418
+ &.checkboxes,
1419
+ &.radios {
1420
+ margin-top: 0;
1270
1421
 
1271
- // nudge single checkboxes to match checkbox groups
1272
- &:not(.checkboxes) {
1273
- input[type=checkbox] {
1274
- margin-left: 10px;
1422
+ ul {
1423
+ input[type=radio] {
1424
+ margin-top: 3px;
1275
1425
  }
1276
- }
1277
1426
 
1278
- // remove "x" padding
1279
- input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio], [type=range]),
1280
- select,
1281
- textarea {
1282
- padding-right: 6px;
1427
+ label {
1428
+ padding-top: 7px;
1429
+ padding-left: 0;
1430
+ font-size: var(--semanticFormsFontSize);
1431
+ }
1283
1432
  }
1284
1433
 
1285
- // subtext
1286
- label {
1287
- margin-top: -5px;
1434
+ // additional text
1435
+ ul + label {
1436
+ margin-top: 0;
1288
1437
  font-size: small;
1289
- color: var(--semanticFormsPlaceholderColor);
1290
1438
  }
1291
1439
  }
1292
- }
1293
1440
 
1294
- .checkboxes ul,
1295
- .radios ul {
1296
- margin-top: var(--semanticFormsInputTopMargin);
1441
+ // single checkbox/radio
1442
+ &:not(:has(ul)){
1443
+ &:has(input[type=checkbox], input[type=radio]) {
1444
+ margin-top: 0;
1445
+ padding-left: 10px;
1446
+
1447
+ input[type=checkbox] {
1448
+ margin-left: 1px;
1449
+ margin-top: 2px;
1450
+ }
1451
+
1452
+ input[type=radio] {
1453
+ margin-left: 1px;
1454
+ margin-top: 1px;
1455
+ }
1456
+
1457
+ // additional info text
1458
+ label {
1459
+ font-size: small;
1460
+ margin-top: -1px;
1461
+ padding-left: 11px;
1462
+ }
1463
+
1464
+ input[type=radio] + label {
1465
+ margin-top: -4px;
1466
+ }
1467
+ }
1468
+ }
1469
+
1470
+ // remove "x" padding
1471
+ input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio], [type=range]),
1472
+ select,
1473
+ textarea {
1474
+ padding-right: 6px;
1475
+ }
1476
+
1477
+ // subtext
1478
+ label {
1479
+ padding-left: 10px;
1480
+ margin-top: -5px;
1481
+ font-size: small;
1482
+ color: var(--semanticFormsPlaceholderColor);
1483
+ }
1484
+
1485
+ // inline buttons
1486
+ button:not(.clear, .show),
1487
+ input[type="submit"]:not(.clear, .show),
1488
+ input[type="button"]:not(.clear, .show) {
1489
+ margin-top: 0 !important;
1490
+ }
1297
1491
  }
1298
1492
  }
1493
+
1494
+ .checkboxes ul,
1495
+ .radios ul {
1496
+ margin-top: var(--semanticFormsInputTopMargin);
1497
+ }
1299
1498
  // #endregion
1300
1499
  }
1301
1500