Skip to content

Commit 6bc6d79

Browse files
committed
Fixes header and footer in modal when form is direct child of the article, and if the form would be between the header and footer tags.
Modals with the size classes on the dialog were not sizing correctly when form was a child of the modal, and this has been corrected.
1 parent 389e319 commit 6bc6d79

6 files changed

Lines changed: 35 additions & 28 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ There are 4 ways to get started with pico.css:
7777
Alternatively, you can use [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@yohns/picocss) to link pico.css.
7878

7979
```html
80-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].6/css/pico.min.css" />
80+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].7/css/pico.min.css" />
8181
```
8282

8383
### Install with NPM
@@ -135,7 +135,7 @@ Use the default `.classless` version if you need centered viewports:
135135
```html
136136
<link
137137
rel="stylesheet"
138-
href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].6/css/pico.classless.min.css"
138+
href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].7/css/pico.classless.min.css"
139139
/>
140140
```
141141

@@ -144,7 +144,7 @@ Or use the `.fluid.classless` version if you need a fluid container:
144144
```html
145145
<link
146146
rel="stylesheet"
147-
href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].6/css/pico.fluid.classless.min.css"
147+
href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].7/css/pico.fluid.classless.min.css"
148148
/>
149149
```
150150

@@ -159,7 +159,7 @@ Then just write pure HTML, and it should look great:
159159
<meta name="color-scheme" content="light dark" />
160160
<link
161161
rel="stylesheet"
162-
href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].6/css/pico.classless.min.css"
162+
href="https://cdn.jsdelivr.net/npm/@yohns/[email protected].7/css/pico.classless.min.css"
163163
/>
164164
<title>Hello, world!</title>
165165
</head>

docs/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@
224224
<main class="col-12 col-md-9 col-lg-10">
225225
<article>
226226
<header>
227-
<h2>Yohns PicoCSS Fork v2.2.6</h2>
228-
<p class="mb-0">Not in npm yet, but will be soon.</p>
227+
<h2>Yohns PicoCSS Fork v2.2.7</h2>
229228
</header>
230229
<p>I've merged some open pull requests from the <a href="https://github.com/picocss/pico">original Pico</a>
231230
repository, and then added a few more enhancements that I either needed for a project (timeline) or wanted
@@ -1080,6 +1079,8 @@ <h2><code> -md- </code> Breakpoints</h2>
10801079
<header>
10811080
<h2>Modal</h2>
10821081
</header>
1082+
<p><code>&lt;form&gt;</code> tags can be between the <code>&lt;header&gt;</code> and <code>&lt;footer&gt;</code>, or wrap around the <code>&lt;header&gt;</code> and <code>&lt;footer&gt;</code> tags within the modal.</p>
1083+
<hr>
10831084
<div class="grid">
10841085
<button class="contrast" data-target="modal-example" onclick="toggleModal(event)">
10851086
Launch Demo Modal
@@ -1093,7 +1094,7 @@ <h2>Modal</h2>
10931094

10941095
<header>
10951096
<h2>Modal Sizes</h2>
1096-
<h6>Having different modal sizes does require a class.</h6>
1097+
<h6 class="fw-n">Having different modal sizes does require a class.</h6>
10971098
</header>
10981099
<p>The main thing will be to add one of the following classes to the <code>&lt;dialog&gt;</code> tag:</p>
10991100
<ul>
@@ -1116,7 +1117,7 @@ <h6>Having different modal sizes does require a class.</h6>
11161117
<article id="popover">
11171118
<header>
11181119
<h2>Popovers</h2>
1119-
<p>Popovers will replace the notifications below.</p>
1120+
<h6 class="fw-n">Popovers will replace the notifications below.</h6>
11201121
</header>
11211122

11221123
<button class="action" popovertarget="popover-example1">Backdrop Close</button>
@@ -1639,7 +1640,7 @@ <h3>Modal with a Form!</h3>
16391640
function changeTheme(newTheme) {
16401641
const linkElement = document.getElementById('theme-color-ss');
16411642
if (linkElement) {
1642-
linkElement.setAttribute('href', 'https://cdn.jsdelivr.net/gh/Yohn/[email protected].6/css/pico.' + newTheme + '.min.css');
1643+
linkElement.setAttribute('href', 'https://cdn.jsdelivr.net/gh/Yohn/[email protected].7/css/pico.' + newTheme + '.min.css');
16431644
}
16441645
}
16451646

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yohns/picocss",
3-
"version": "2.2.6",
3+
"version": "2.2.7",
44
"description": "Minimal CSS Framework for semantic HTML, updated with enhanced capabilities.",
55
"authors": [
66
{

scss/components/_card.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* Card (<article>, role="article")
77
*/
88

9-
#{$parent-selector} article:not(:has(> form)),
10-
#{$parent-selector} [role="article"]:not(:has(> form)),
9+
#{$parent-selector} article:not(:has(> form:first-child)),
10+
#{$parent-selector} [role="article"]:not(:has(> form:first-child)),
1111
#{$parent-selector} article > form,
1212
#{$parent-selector} [role="article"] > form {
1313
margin-bottom: var(#{$css-var-prefix}block-spacing-vertical);

scss/components/_modal.scss

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@
1111
#{$css-var-prefix}scrollbar-width: 0px;
1212
}
1313

14+
#{$parent-selector} dialog:not(.modal-fs, .modal-xlg, .modal-lg, .modal-md, .modal-sm) {
15+
> article:not(:has(> form:first-child)),
16+
> article > form:first-child {
17+
width: 100%;
18+
19+
@if map.get($breakpoints, "sm") {
20+
@media (min-width: map.get(map.get($breakpoints, "sm"), "breakpoint")) {
21+
max-width: map.get(map.get($breakpoints, "sm"), "viewport");
22+
}
23+
}
24+
25+
@if map.get($breakpoints, "md") {
26+
@media (min-width: map.get(map.get($breakpoints, "md"), "breakpoint")) {
27+
max-width: map.get(map.get($breakpoints, "md"), "viewport");
28+
}
29+
}
30+
}
31+
}
32+
1433
#{$parent-selector} dialog {
1534
display: grid;
1635
z-index: 999;
@@ -37,26 +56,13 @@
3756
}
3857

3958
// Content
40-
> article:not(:has(> form)),
41-
> article > form {
59+
> article:not(:has(> form:first-child)),
60+
> article > form:first-child {
4261
$close-selector: if(
4362
$enable-classes,
4463
".close, :is(a, button)[rel=prev]",
4564
":is(a, button)[rel=prev]"
4665
);
47-
width: 100%;
48-
49-
@if map.get($breakpoints, "sm") {
50-
@media (min-width: map.get(map.get($breakpoints, "sm"), "breakpoint")) {
51-
max-width: map.get(map.get($breakpoints, "sm"), "viewport");
52-
}
53-
}
54-
55-
@if map.get($breakpoints, "md") {
56-
@media (min-width: map.get(map.get($breakpoints, "md"), "breakpoint")) {
57-
max-width: map.get(map.get($breakpoints, "md"), "viewport");
58-
}
59-
}
6066

6167
> header {
6268
> * {

scss/helpers/_copyright.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/*!
2-
* Pico CSS ✨ v2.2.6 (https://github.com/Yohn/PicoCSS)
2+
* Pico CSS ✨ v2.2.7 (https://github.com/Yohn/PicoCSS)
33
* Copyright 2019-2025 - Licensed under MIT
44
*/

0 commit comments

Comments
 (0)