Repository navigation
[6.x] Speed up the control panel on large entries #15679
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,8 @@ | |
| =================================================== */ | ||
| /* Here we extend Tailwind's classes to add additional functionality where we're sure it won't break anything. */ | ||
|
|
||
| /* If all the next siblings are hidden (by a Vue conditional), remove the bottom border. For example, /cp/seo-pro/site-defaults/edit#json-ld */ | ||
| .divide-y > *:not(:has(~ :not([style*="display: none"]))) { | ||
| /* If all the next siblings are hidden publish fields, remove the bottom border. For example, /cp/seo-pro/site-defaults/edit#json-ld */ | ||
| .divide-y > *:not(:has(~ :not(.publish-field-hidden))) { | ||
| border-block-end: none; | ||
| } | ||
|
|
||
|
|
@@ -88,7 +88,7 @@ | |
| } | ||
| /* =Jay. Exceptions */ | ||
| /* e.g. for a fieldset, we don't want to trim the text when we have a label like on a collections field, Link Item button */ | ||
| .form-group :has(> &) & { | ||
| .form-group * > & { | ||
| text-box: unset; | ||
| } | ||
| } | ||
|
|
@@ -290,67 +290,65 @@ | |
|
|
||
| */ | ||
| @utility bg-architectural-lines { | ||
| &:not(:has(.page-tree-branch)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one's fine to drop, now that #15681 is in. The navigation page wasn't removing the class when you left, so after visiting an empty nav the lines would show up on other pages. The
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Rebased onto 6.x so #15681 is included :) |
||
| &::before { | ||
| &::before { | ||
| content: ''; | ||
| pointer-events: none; | ||
| position: absolute; | ||
| inset: 0; | ||
| background-image: url('../../svg/architectural-lines.svg'); | ||
| background-size: 100%; | ||
| /* Reduce the chances of the background circles overlapping the button */ | ||
| @media (width < 1300px) { | ||
| background-position-y: 130%; | ||
| } | ||
| } | ||
| .dark &::before { | ||
| filter: invert(100%); | ||
| /* The negative margin is to compensate for the lack of a "raised panel" in dark mode */ | ||
| @apply -mt-2; | ||
| } | ||
| /* Central horizontal line */ | ||
| [data-ui-panel] { | ||
| > * { | ||
| position: relative; | ||
| z-index: var(--z-index-above); | ||
| } | ||
|
|
||
| &::after { | ||
| --height: 1px; | ||
| --line-color: hsl(0deg 0% 95%); | ||
| content: ''; | ||
| pointer-events: none; | ||
| position: absolute; | ||
| inset: 0; | ||
| background-image: url('../../svg/architectural-lines.svg'); | ||
| background-size: 100%; | ||
| /* Reduce the chances of the background circles overlapping the button */ | ||
| @media (width < 1300px) { | ||
| background-position-y: 130%; | ||
| } | ||
| height: var(--height); | ||
| /* Bust out of the container to create a full-width horizontal line, ref https://www.smashingmagazine.com/2024/01/css-border-image-property/#full-width-backgrounds */ | ||
| border-image: conic-gradient(var(--line-color) 0 0) fill 0//0 100vw; | ||
| top: calc(50% - var(--height)); | ||
| } | ||
| .dark &::before { | ||
| filter: invert(100%); | ||
| /* The negative margin is to compensate for the lack of a "raised panel" in dark mode */ | ||
| @apply -mt-2; | ||
| .dark &::after { | ||
| --line-color: hsl(240deg 2.56% 15%); | ||
| } | ||
| /* Central horizontal line */ | ||
| [data-ui-panel] { | ||
| > * { | ||
| position: relative; | ||
| z-index: var(--z-index-above); | ||
| } | ||
|
|
||
| &::after { | ||
| --height: 1px; | ||
| --line-color: hsl(0deg 0% 95%); | ||
| } | ||
| footer { | ||
| button:only-child { | ||
| position: relative; | ||
| &::before, &::after { | ||
| content: ''; | ||
| pointer-events: none; | ||
| position: absolute; | ||
| inset: 0; | ||
| height: var(--height); | ||
| /* Bust out of the container to create a full-width horizontal line, ref https://www.smashingmagazine.com/2024/01/css-border-image-property/#full-width-backgrounds */ | ||
| border-image: conic-gradient(var(--line-color) 0 0) fill 0//0 100vw; | ||
| top: calc(50% - var(--height)); | ||
| border: 1px solid black; | ||
| opacity: 0.06; | ||
| width: 60%; | ||
| aspect-ratio: 1; | ||
| left: 50%; | ||
| top: 50%; | ||
| transform: translate(-50%, -50%); | ||
| border-radius: 50%; | ||
| } | ||
| .dark &::after { | ||
| --line-color: hsl(240deg 2.56% 15%); | ||
| } | ||
| } | ||
| footer { | ||
| button:only-child { | ||
| position: relative; | ||
| &::before, &::after { | ||
| content: ''; | ||
| pointer-events: none; | ||
| position: absolute; | ||
| inset: 0; | ||
| border: 1px solid black; | ||
| opacity: 0.06; | ||
| width: 60%; | ||
| aspect-ratio: 1; | ||
| left: 50%; | ||
| top: 50%; | ||
| transform: translate(-50%, -50%); | ||
| border-radius: 50%; | ||
| } | ||
| &::before { | ||
| width: 45%; | ||
| } | ||
| &::before { | ||
| width: 45%; | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has a knock on effect, which you can see in these screenshots, so let's leave this one.
V6
After this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :D I tried to fix this in 0149199c0 so nested grids get the compact styling again (should now match your V6 screenshot :D) but still without the :has().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, nice work getting the selector maths to line up with v6! 🙌
I'm not sure the grid changes are buying us much speed, though. v6's
:has()rules here only look inside a single row or cell, so they're fairly cheap to re-check, and the new version still keeps a:has([data-asset-picker])anyway. I suspect the big wins came from the page-wide ones (.form-group :has(> &),group-has-*, the architectural lines, the[style*="display: none"]one) and the Tabs deep watch, which are brilliant finds.Unless you saw a noticeable difference from this one on your end, I'd be tempted to leave it out of this PR to keep things simple 😄