Skip to content

Commit dbd9c5a

Browse files
committed
Cards keep style with form tag wrapped around header and footer in article
1 parent 3cfdc97 commit dbd9c5a

File tree

259 files changed

+28930
-7818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+28930
-7818
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ Thumbs.db
3232
.pico
3333
package-lock.json
3434
/docs/orig
35-
/scss/components/_offcanvas.scss
35+
/scss/components/_offcanvas.scss
36+
docs/js/DialogManager.js
37+
docs/modal.html

css/pico.amber.css

Lines changed: 193 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,82 +2921,202 @@ details[open] > summary::after {
29212921
/**
29222922
* Card (<article>, role="article")
29232923
*/
2924-
article,
2925-
[role=article] {
2924+
article:not(:has(> form)),
2925+
[role=article]:not(:has(> form)),
2926+
article > form,
2927+
[role=article] > form {
29262928
margin-bottom: var(--pico-block-spacing-vertical);
29272929
padding: var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);
29282930
border-radius: var(--pico-border-radius);
29292931
background: var(--pico-card-background-color);
29302932
box-shadow: var(--pico-card-box-shadow);
29312933
}
2932-
article > header,
2933-
article > footer,
2934-
[role=article] > header,
2935-
[role=article] > footer {
2934+
article:not(:has(> form)) > header,
2935+
article:not(:has(> form)) > footer,
2936+
[role=article]:not(:has(> form)) > header,
2937+
[role=article]:not(:has(> form)) > footer,
2938+
article > form > header,
2939+
article > form > footer,
2940+
[role=article] > form > header,
2941+
[role=article] > form > footer {
29362942
margin-right: calc(var(--pico-block-spacing-horizontal) * -1);
29372943
margin-left: calc(var(--pico-block-spacing-horizontal) * -1);
29382944
padding: calc(var(--pico-block-spacing-vertical) * 0.66) var(--pico-block-spacing-horizontal);
29392945
background-color: var(--pico-card-sectioning-background-color);
29402946
}
2941-
article > header,
2942-
[role=article] > header {
2947+
article:not(:has(> form)) > header,
2948+
[role=article]:not(:has(> form)) > header,
2949+
article > form > header,
2950+
[role=article] > form > header {
29432951
margin-top: calc(var(--pico-block-spacing-vertical) * -1);
29442952
margin-bottom: var(--pico-block-spacing-vertical);
29452953
border-bottom: var(--pico-border-width) solid var(--pico-card-border-color);
29462954
border-top-right-radius: var(--pico-border-radius);
29472955
border-top-left-radius: var(--pico-border-radius);
29482956
}
2949-
article > header > h1,
2950-
article > header > h2,
2951-
article > header > h3,
2952-
article > header > h4,
2953-
article > header > h5,
2954-
article > header > h6,
2955-
[role=article] > header > h1,
2956-
[role=article] > header > h2,
2957-
[role=article] > header > h3,
2958-
[role=article] > header > h4,
2959-
[role=article] > header > h5,
2960-
[role=article] > header > h6 {
2957+
article:not(:has(> form)) > header > h1,
2958+
article:not(:has(> form)) > header > h2,
2959+
article:not(:has(> form)) > header > h3,
2960+
article:not(:has(> form)) > header > h4,
2961+
article:not(:has(> form)) > header > h5,
2962+
article:not(:has(> form)) > header > h6,
2963+
[role=article]:not(:has(> form)) > header > h1,
2964+
[role=article]:not(:has(> form)) > header > h2,
2965+
[role=article]:not(:has(> form)) > header > h3,
2966+
[role=article]:not(:has(> form)) > header > h4,
2967+
[role=article]:not(:has(> form)) > header > h5,
2968+
[role=article]:not(:has(> form)) > header > h6,
2969+
article > form > header > h1,
2970+
article > form > header > h2,
2971+
article > form > header > h3,
2972+
article > form > header > h4,
2973+
article > form > header > h5,
2974+
article > form > header > h6,
2975+
[role=article] > form > header > h1,
2976+
[role=article] > form > header > h2,
2977+
[role=article] > form > header > h3,
2978+
[role=article] > form > header > h4,
2979+
[role=article] > form > header > h5,
2980+
[role=article] > form > header > h6 {
29612981
margin-bottom: 0;
29622982
}
2963-
article > footer,
2964-
[role=article] > footer {
2983+
article:not(:has(> form)) > header > hgroup > h1,
2984+
article:not(:has(> form)) > header > hgroup > h2,
2985+
article:not(:has(> form)) > header > hgroup > h3,
2986+
article:not(:has(> form)) > header > hgroup > h4,
2987+
article:not(:has(> form)) > header > hgroup > h5,
2988+
article:not(:has(> form)) > header > hgroup > h6,
2989+
[role=article]:not(:has(> form)) > header > hgroup > h1,
2990+
[role=article]:not(:has(> form)) > header > hgroup > h2,
2991+
[role=article]:not(:has(> form)) > header > hgroup > h3,
2992+
[role=article]:not(:has(> form)) > header > hgroup > h4,
2993+
[role=article]:not(:has(> form)) > header > hgroup > h5,
2994+
[role=article]:not(:has(> form)) > header > hgroup > h6,
2995+
article > form > header > hgroup > h1,
2996+
article > form > header > hgroup > h2,
2997+
article > form > header > hgroup > h3,
2998+
article > form > header > hgroup > h4,
2999+
article > form > header > hgroup > h5,
3000+
article > form > header > hgroup > h6,
3001+
[role=article] > form > header > hgroup > h1,
3002+
[role=article] > form > header > hgroup > h2,
3003+
[role=article] > form > header > hgroup > h3,
3004+
[role=article] > form > header > hgroup > h4,
3005+
[role=article] > form > header > hgroup > h5,
3006+
[role=article] > form > header > hgroup > h6 {
3007+
margin-bottom: 0;
3008+
}
3009+
article:not(:has(> form)) > footer,
3010+
[role=article]:not(:has(> form)) > footer,
3011+
article > form > footer,
3012+
[role=article] > form > footer {
29653013
margin-top: var(--pico-block-spacing-vertical);
29663014
margin-bottom: calc(var(--pico-block-spacing-vertical) * -1);
29673015
border-top: var(--pico-border-width) solid var(--pico-card-border-color);
29683016
border-bottom-right-radius: var(--pico-border-radius);
29693017
border-bottom-left-radius: var(--pico-border-radius);
29703018
}
2971-
article > footer [type=submit],
2972-
article > footer [type=reset],
2973-
article > footer [type=button],
2974-
article > footer [role=group],
2975-
[role=article] > footer [type=submit],
2976-
[role=article] > footer [type=reset],
2977-
[role=article] > footer [type=button],
2978-
[role=article] > footer [role=group] {
3019+
article:not(:has(> form)) > footer [type=submit],
3020+
article:not(:has(> form)) > footer [type=reset],
3021+
article:not(:has(> form)) > footer [type=button],
3022+
article:not(:has(> form)) > footer [role=group],
3023+
article:not(:has(> form)) > footer p,
3024+
article:not(:has(> form)) > footer nav,
3025+
article:not(:has(> form)) > footer ul,
3026+
article:not(:has(> form)) > footer ol,
3027+
[role=article]:not(:has(> form)) > footer [type=submit],
3028+
[role=article]:not(:has(> form)) > footer [type=reset],
3029+
[role=article]:not(:has(> form)) > footer [type=button],
3030+
[role=article]:not(:has(> form)) > footer [role=group],
3031+
[role=article]:not(:has(> form)) > footer p,
3032+
[role=article]:not(:has(> form)) > footer nav,
3033+
[role=article]:not(:has(> form)) > footer ul,
3034+
[role=article]:not(:has(> form)) > footer ol,
3035+
article > form > footer [type=submit],
3036+
article > form > footer [type=reset],
3037+
article > form > footer [type=button],
3038+
article > form > footer [role=group],
3039+
article > form > footer p,
3040+
article > form > footer nav,
3041+
article > form > footer ul,
3042+
article > form > footer ol,
3043+
[role=article] > form > footer [type=submit],
3044+
[role=article] > form > footer [type=reset],
3045+
[role=article] > form > footer [type=button],
3046+
[role=article] > form > footer [role=group],
3047+
[role=article] > form > footer p,
3048+
[role=article] > form > footer nav,
3049+
[role=article] > form > footer ul,
3050+
[role=article] > form > footer ol {
29793051
margin-bottom: 0px;
29803052
/* Also remove if next input after button is a hidden input */
29813053
}
2982-
article > footer [type=submit]:last-child,
2983-
article > footer [type=reset]:last-child,
2984-
article > footer [type=button]:last-child,
2985-
article > footer [role=group]:last-child,
2986-
[role=article] > footer [type=submit]:last-child,
2987-
[role=article] > footer [type=reset]:last-child,
2988-
[role=article] > footer [type=button]:last-child,
2989-
[role=article] > footer [role=group]:last-child {
3054+
article:not(:has(> form)) > footer [type=submit]:last-child,
3055+
article:not(:has(> form)) > footer [type=reset]:last-child,
3056+
article:not(:has(> form)) > footer [type=button]:last-child,
3057+
article:not(:has(> form)) > footer [role=group]:last-child,
3058+
article:not(:has(> form)) > footer p:last-child,
3059+
article:not(:has(> form)) > footer nav:last-child,
3060+
article:not(:has(> form)) > footer ul:last-child,
3061+
article:not(:has(> form)) > footer ol:last-child,
3062+
[role=article]:not(:has(> form)) > footer [type=submit]:last-child,
3063+
[role=article]:not(:has(> form)) > footer [type=reset]:last-child,
3064+
[role=article]:not(:has(> form)) > footer [type=button]:last-child,
3065+
[role=article]:not(:has(> form)) > footer [role=group]:last-child,
3066+
[role=article]:not(:has(> form)) > footer p:last-child,
3067+
[role=article]:not(:has(> form)) > footer nav:last-child,
3068+
[role=article]:not(:has(> form)) > footer ul:last-child,
3069+
[role=article]:not(:has(> form)) > footer ol:last-child,
3070+
article > form > footer [type=submit]:last-child,
3071+
article > form > footer [type=reset]:last-child,
3072+
article > form > footer [type=button]:last-child,
3073+
article > form > footer [role=group]:last-child,
3074+
article > form > footer p:last-child,
3075+
article > form > footer nav:last-child,
3076+
article > form > footer ul:last-child,
3077+
article > form > footer ol:last-child,
3078+
[role=article] > form > footer [type=submit]:last-child,
3079+
[role=article] > form > footer [type=reset]:last-child,
3080+
[role=article] > form > footer [type=button]:last-child,
3081+
[role=article] > form > footer [role=group]:last-child,
3082+
[role=article] > form > footer p:last-child,
3083+
[role=article] > form > footer nav:last-child,
3084+
[role=article] > form > footer ul:last-child,
3085+
[role=article] > form > footer ol:last-child {
29903086
margin-bottom: 0px;
29913087
}
2992-
article > footer [type=submit]:has(+ [type=hidden]),
2993-
article > footer [type=reset]:has(+ [type=hidden]),
2994-
article > footer [type=button]:has(+ [type=hidden]),
2995-
article > footer [role=group]:has(+ [type=hidden]),
2996-
[role=article] > footer [type=submit]:has(+ [type=hidden]),
2997-
[role=article] > footer [type=reset]:has(+ [type=hidden]),
2998-
[role=article] > footer [type=button]:has(+ [type=hidden]),
2999-
[role=article] > footer [role=group]:has(+ [type=hidden]) {
3088+
article:not(:has(> form)) > footer [type=submit]:has(+ [type=hidden]),
3089+
article:not(:has(> form)) > footer [type=reset]:has(+ [type=hidden]),
3090+
article:not(:has(> form)) > footer [type=button]:has(+ [type=hidden]),
3091+
article:not(:has(> form)) > footer [role=group]:has(+ [type=hidden]),
3092+
article:not(:has(> form)) > footer p:has(+ [type=hidden]),
3093+
article:not(:has(> form)) > footer nav:has(+ [type=hidden]),
3094+
article:not(:has(> form)) > footer ul:has(+ [type=hidden]),
3095+
article:not(:has(> form)) > footer ol:has(+ [type=hidden]),
3096+
[role=article]:not(:has(> form)) > footer [type=submit]:has(+ [type=hidden]),
3097+
[role=article]:not(:has(> form)) > footer [type=reset]:has(+ [type=hidden]),
3098+
[role=article]:not(:has(> form)) > footer [type=button]:has(+ [type=hidden]),
3099+
[role=article]:not(:has(> form)) > footer [role=group]:has(+ [type=hidden]),
3100+
[role=article]:not(:has(> form)) > footer p:has(+ [type=hidden]),
3101+
[role=article]:not(:has(> form)) > footer nav:has(+ [type=hidden]),
3102+
[role=article]:not(:has(> form)) > footer ul:has(+ [type=hidden]),
3103+
[role=article]:not(:has(> form)) > footer ol:has(+ [type=hidden]),
3104+
article > form > footer [type=submit]:has(+ [type=hidden]),
3105+
article > form > footer [type=reset]:has(+ [type=hidden]),
3106+
article > form > footer [type=button]:has(+ [type=hidden]),
3107+
article > form > footer [role=group]:has(+ [type=hidden]),
3108+
article > form > footer p:has(+ [type=hidden]),
3109+
article > form > footer nav:has(+ [type=hidden]),
3110+
article > form > footer ul:has(+ [type=hidden]),
3111+
article > form > footer ol:has(+ [type=hidden]),
3112+
[role=article] > form > footer [type=submit]:has(+ [type=hidden]),
3113+
[role=article] > form > footer [type=reset]:has(+ [type=hidden]),
3114+
[role=article] > form > footer [type=button]:has(+ [type=hidden]),
3115+
[role=article] > form > footer [role=group]:has(+ [type=hidden]),
3116+
[role=article] > form > footer p:has(+ [type=hidden]),
3117+
[role=article] > form > footer nav:has(+ [type=hidden]),
3118+
[role=article] > form > footer ul:has(+ [type=hidden]),
3119+
[role=article] > form > footer ol:has(+ [type=hidden]) {
30003120
margin-bottom: 0px;
30013121
}
30023122

@@ -3422,40 +3542,53 @@ dialog {
34223542
transform: scale(1);
34233543
transition: transform var(--pico-transition);
34243544
}
3425-
dialog > article {
3545+
dialog > article:not(:has(> form)),
3546+
dialog > article > form {
34263547
width: 100%;
34273548
}
34283549
@media (min-width: 576px) {
3429-
dialog > article {
3550+
dialog > article:not(:has(> form)),
3551+
dialog > article > form {
34303552
max-width: 510px;
34313553
}
34323554
}
34333555
@media (min-width: 768px) {
3434-
dialog > article {
3556+
dialog > article:not(:has(> form)),
3557+
dialog > article > form {
34353558
max-width: 700px;
34363559
}
34373560
}
3438-
dialog > article > header > * {
3561+
dialog > article:not(:has(> form)) > header > *,
3562+
dialog > article > form > header > * {
34393563
margin-bottom: 0;
34403564
}
3441-
dialog > article > header .close, dialog > article > header :is(a, button)[rel=prev] {
3565+
dialog > article:not(:has(> form)) > header .close, dialog > article:not(:has(> form)) > header :is(a, button)[rel=prev],
3566+
dialog > article > form > header .close,
3567+
dialog > article > form > header :is(a, button)[rel=prev] {
34423568
margin: 0;
34433569
margin-left: var(--pico-spacing);
34443570
padding: 0;
34453571
float: right;
34463572
}
3447-
dialog > article > footer {
3573+
dialog > article:not(:has(> form)) > footer,
3574+
dialog > article > form > footer {
34483575
text-align: right;
34493576
}
3450-
dialog > article > footer button,
3451-
dialog > article > footer [role=button] {
3577+
dialog > article:not(:has(> form)) > footer button,
3578+
dialog > article:not(:has(> form)) > footer [role=button],
3579+
dialog > article > form > footer button,
3580+
dialog > article > form > footer [role=button] {
34523581
margin-bottom: 0;
34533582
}
3454-
dialog > article > footer button:not(:first-of-type),
3455-
dialog > article > footer [role=button]:not(:first-of-type) {
3583+
dialog > article:not(:has(> form)) > footer button:not(:first-of-type),
3584+
dialog > article:not(:has(> form)) > footer [role=button]:not(:first-of-type),
3585+
dialog > article > form > footer button:not(:first-of-type),
3586+
dialog > article > form > footer [role=button]:not(:first-of-type) {
34563587
margin-left: calc(var(--pico-spacing) * 0.5);
34573588
}
3458-
dialog > article .close, dialog > article :is(a, button)[rel=prev] {
3589+
dialog > article:not(:has(> form)) .close, dialog > article:not(:has(> form)) :is(a, button)[rel=prev],
3590+
dialog > article > form .close,
3591+
dialog > article > form :is(a, button)[rel=prev] {
34593592
display: block;
34603593
width: 1rem;
34613594
height: 1rem;
@@ -3471,7 +3604,9 @@ dialog > article .close, dialog > article :is(a, button)[rel=prev] {
34713604
opacity: 0.5;
34723605
transition: opacity var(--pico-transition);
34733606
}
3474-
dialog > article .close:is([aria-current]:not([aria-current=false]), :hover, :active, :focus), dialog > article :is(a, button)[rel=prev]:is([aria-current]:not([aria-current=false]), :hover, :active, :focus) {
3607+
dialog > article:not(:has(> form)) .close:is([aria-current]:not([aria-current=false]), :hover, :active, :focus), dialog > article:not(:has(> form)) :is(a, button)[rel=prev]:is([aria-current]:not([aria-current=false]), :hover, :active, :focus),
3608+
dialog > article > form .close:is([aria-current]:not([aria-current=false]), :hover, :active, :focus),
3609+
dialog > article > form :is(a, button)[rel=prev]:is([aria-current]:not([aria-current=false]), :hover, :active, :focus) {
34753610
opacity: 1;
34763611
}
34773612
dialog:not([open]), dialog[open=false] {

css/pico.amber.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)