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

Ensure top heading action icon is to right when width allows #2076

Merged
merged 2 commits into from
Jan 27, 2025
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
11 changes: 11 additions & 0 deletions assets/css/content/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@
.content-inner .heading-with-actions.top-heading .icon-action {
font-size: 1.2rem;
}
/* When content is wide enough, ensure action icon is to the right of, not below, heading */
@container content (width > 600px) {
.content-inner .heading-with-actions.top-heading {
flex-wrap: nowrap;
gap: 32px;
align-items: flex-start;
.icon-action {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is invalid, as we are not using a preprocessor, so I want ahead and remove it, as it seems not necessary. Please double check.

Copy link
Contributor Author

@DavidOliver DavidOliver Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nested selectors are now supported in CSS.

Copy link
Contributor Author

@DavidOliver DavidOliver Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correcting my edited comment: the flex-start and padding-top is necessary for correct vertical alignment when the heading runs into two lines or more.

Copy link
Member

@josevalim josevalim Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, fantastic, I will add it back! The tooling is complaining, so we may need to either update it or move it to the top. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidOliver this seems to do the trick: b0a2412

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great - thanks!

padding-top: 1.7rem; /* vertically align with x-height of first line of heading */
}
}
}

.content-inner .top-heading {
padding-top: 1rem;
Expand Down
1 change: 1 addition & 0 deletions assets/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ body {
}

.content .content-inner {
container: content / inline-size;
max-width: var(--content-width);
min-height: 100%;
margin: 0 auto;
Expand Down