Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CD-554] default styles for field_group details/summary elements #483

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions libraries/cd-form/cd-form.css
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,40 @@ form .form-type-checkbox > .cd-form__description {
form .fieldset-wrapper > .form-type-checkbox + .form-type-checkbox {
margin-top: 1rem;
}

/**
* Enhancements to widgets from field_group module
*/

form .field-group-details {
margin-block-start: 1rem;
padding-inline: 1rem;
border-radius: 5px;
background: var(--brand-grey);
}

form .field-group-details[open] {
padding-block: 1rem;
}

/* <summary> needs to cancel padding on <details> when open */
form .field-group-details[open] summary {
margin-block-start: -1rem;
}

/* normalize.css removes built-in browser affordance for <summary> so we are
resetting its display */
form .field-group-details summary {
display: list-item;
cursor: pointer;
border-radius: 5px;
margin-inline: -1rem; /* cancel padding on <details> */
padding-block: .25rem;
padding-inline: 1rem;
font-weight: 700;
}

form .field-group-details summary:focus-visible {
outline: 3px solid var(--cd-black);
}

Loading