semantic-forms 5.3.3 → 5.3.4

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 5.3.4
2
+
3
+ - Reverted a change to single radio and checkbox inputs.
4
+ - Added sample forms to the demo page.
5
+
1
6
  ## 5.3.3
2
7
 
3
8
  - Fixed a bug where radio and checkbox inputs would be moved to the end of the parent `<dl>`.
@@ -1352,9 +1352,6 @@ form.semanticForms:not(.semanticFormsActive) dd input[type=button]:not(.clear, .
1352
1352
  min-width: 150px;
1353
1353
  max-width: max-content;
1354
1354
  }
1355
- .semanticForms dl div:not(:has(ul, ol)):has(dd input[type=radio]:only-of-type, dd input[type=checkbox]:only-of-type) {
1356
- padding-top: 22px;
1357
- }
1358
1355
  .semanticForms dl div:has(dd > button:only-child, dd > input[type=button]:only-child, dd > input[type=submit]:only-child, dd > input[type=reset]:only-child) dt label {
1359
1356
  display: none;
1360
1357
  }
@@ -1456,6 +1453,11 @@ form.semanticForms:not(.semanticFormsActive) dd input[type=button]:not(.clear, .
1456
1453
  gap: 10px;
1457
1454
  list-style-type: none;
1458
1455
  }
1456
+ .semanticForms menu:has(li > input, li > label, li > button, li > select, li > textarea) li,
1457
+ .semanticForms ul:has(li > input, li > label, li > button, li > select, li > textarea) li {
1458
+ display: flex;
1459
+ align-items: center;
1460
+ }
1459
1461
  .semanticForms div:has(.align-start) {
1460
1462
  display: flex;
1461
1463
  justify-content: start;
@@ -76,6 +76,7 @@
76
76
  <li><a href="#low-flow-p_tag_elements">P tag elements</a></li>
77
77
  </ul>
78
78
  </li>
79
+ <li><a href="#sample_forms">Sample forms</a></li>
79
80
  <li><a href="#non_form_related_elements">Non-form related HTML elements</a></li>
80
81
  </ul>
81
82
  </details>
@@ -2326,6 +2327,71 @@
2326
2327
  </fieldset>
2327
2328
  </form>
2328
2329
 
2330
+ <hr>
2331
+
2332
+ <h2 id="sample_forms">Sample forms</h2>
2333
+
2334
+ <section style="display: flex; flex-wrap: wrap; gap: 20px;">
2335
+ <article id="form1" style="width: 370px;">
2336
+ <form action="/somewhere" method="post" class="semanticForms">
2337
+ <fieldset>
2338
+ <legend>One column form</legend>
2339
+
2340
+ <dl>
2341
+ <div>
2342
+ <dt><label for="form1-name">Name</label></dt>
2343
+ <dd><input type="text" name="form1-name" id="form1-name"></dd>
2344
+ </div>
2345
+
2346
+ <div>
2347
+ <dt><label for="form1-email">Email</label></dt>
2348
+ <dd><input type="text" name="form1-email" id="form1-email"></dd>
2349
+ </div>
2350
+
2351
+ <div>
2352
+ <dt><label for="form1-agree">I agree to the Terms and Conditions</label></dt>
2353
+ <dd><input type="checkbox" name="form1-agree" id="form1-agree"></dd>
2354
+ </div>
2355
+
2356
+ <div>
2357
+ <dt><label for="form1-receive-emails">I want to sign up for the weekly newsletter</label></dt>
2358
+ <dd><input type="checkbox" name="form1-receive-emails" id="form1-receive-emails"></dd>
2359
+ </div>
2360
+ </dl>
2361
+ <menu>
2362
+ <li><button type="submit">Sign up</button></li>
2363
+ </menu>
2364
+ </fieldset>
2365
+ </form>
2366
+ </article>
2367
+
2368
+ <article id="form2" style="width: 550px;">
2369
+ <form action="/somewhere" method="post" class="semanticForms">
2370
+ <fieldset>
2371
+ <legend>Two column form</legend>
2372
+
2373
+ <dl class="colspan-2">
2374
+ <div>
2375
+ <dt><label for="form2-username">Username</label></dt>
2376
+ <dd><input type="text" name="form2-username" id="form2-username"></dd>
2377
+ </div>
2378
+
2379
+ <div>
2380
+ <dt><label for="form2-password">Password</label></dt>
2381
+ <dd><input type="password" name="form2-password" id="form2-password"></dd>
2382
+ </div>
2383
+ </dl>
2384
+ <menu>
2385
+ <li><button type="submit">Sign in</button></li>
2386
+ <li><a href="/somewhere">Forgot password?</a></li>
2387
+ </menu>
2388
+ </fieldset>
2389
+ </form>
2390
+ </article>
2391
+ </section>
2392
+
2393
+ <hr>
2394
+
2329
2395
  <h2 id="non_form_related_elements">Non-form related HTML elements</h2>
2330
2396
  <form action="/somewhere" method="post" class="semanticForms">
2331
2397
  <p>This is some regular HTML that should not be affected by any semantic forms styles</p>
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "url": "https://github.com/rooseveltframework/semantic-forms/graphs/contributors"
9
9
  }
10
10
  ],
11
- "version": "5.3.3",
11
+ "version": "5.3.4",
12
12
  "files": [
13
13
  "dist",
14
14
  "semanticForms.scss",
@@ -145,11 +145,6 @@
145
145
  }
146
146
  }
147
147
 
148
- &:not(:has(ul, ol)):has(dd input[type=radio]:only-of-type, dd input[type=checkbox]:only-of-type) {
149
- // place in line with other inputs w/ labels
150
- padding-top: 22px;
151
- }
152
-
153
148
  // hide labels for singular buttons
154
149
  &:has(dd > button:only-child, dd > input[type=button]:only-child, dd > input[type=submit]:only-child, dd > input[type=reset]:only-child) {
155
150
  dt label {
@@ -289,6 +284,11 @@
289
284
  flex-wrap: wrap;
290
285
  gap: 10px;
291
286
  list-style-type: none;
287
+
288
+ li {
289
+ display: flex;
290
+ align-items: center;
291
+ }
292
292
  }
293
293
 
294
294
  div:has(.align-start) {