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

Two tiny tweaks: legends in flow, animated details #1264

Merged
merged 4 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions common-theme/assets/styles/03-elements/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fieldset {
border-color: var(--theme-color--block);
box-shadow: var(--theme-box-shadow--slim);
border-radius: var(--theme-border-radius);
display: grid;
}

main input:not([type="radio"]):not([type="checkbox"]) {
Expand All @@ -34,6 +35,9 @@ main input:not([type="radio"]):not([type="checkbox"]) {

legend {
font: var(--theme-type-size--4) var(--theme-font--display);
// float legend in a fieldset of display grid to artificially recreate a box
float: left;
padding: var(--theme-spacing--1) 0;
}
label,
input::placeholder {
Expand Down
30 changes: 20 additions & 10 deletions common-theme/assets/styles/03-elements/misc-phrasing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,34 @@ code:not([class]) {
}

// details could show up in github flavoured markdown so we put a basic style on here
details {
list-style: none;
}
summary {
margin-bottom: var(--theme-spacing--1);
cursor: pointer;
list-style: none;
}
summary > * {
display: inline-block;
margin: 0;
}
details {
summary::marker {
color: var(--theme-color--accent);
font-size: var(--theme-type-size--3);
transition: all 0.5s cubic-bezier(0.4, 2.08, 0.55, 0.44);
}
&:hover summary::marker {
color: var(--theme-color--pop);
font-size: calc(2px + var(--theme-type-size--3));
}

details > summary::before {
content: "▶";
display: inline-block;
color: var(--theme-color--accent);
font-size: var(--theme-type-size--4);
transition: transform 0.5s cubic-bezier(0.4, 2.08, 0.55, 0.44);
margin: 0 var(--theme-spacing--1) 0 0;
}
details:hover summary::before {
color: var(--theme-color--pop);
transform: rotate(5deg) scale(1.1);
}

details[open] > summary::before {
transform: rotate(90deg);
}
hr {
border: 0;
Expand Down
Loading