Skip to content
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
23 changes: 13 additions & 10 deletions resources/css/components/fieldtypes/grid.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,26 @@
/* GRID FIELDTYPE / Assets fieldtype in a grid fieldtype
=================================================== */
/* Table UI mode */
.grid-table .grid-cell.assets-fieldtype:not(:has([data-asset-picker])) > *,
.grid-table .grid-cell.assets-fieldtype > [data-ui-input-group]:not(:has([data-asset-picker])),
/* Stacked UI mode */
.grid-stacked [data-asset-browser]:not(:has([data-asset-picker])) {
.grid-stacked [data-asset-browser]:not([data-asset-picker-visible]) {
/* Wrap a border around the container instead of dealing with complex nested table elements, because borders and border-radius don't work as expected with nested table elements */
@apply border-gray-300 dark:border-gray-700 border-1 rounded-lg;
/* Prevent the descended table elements from inheriting this, such as the img thumbnail and the delete button */
*:not(button, button *) {
@apply rounded-lg border-none;
}
}
/* Prevent the descended table elements from inheriting this, such as the img thumbnail and the delete button */
.grid-table .grid-cell.assets-fieldtype [data-asset-browser]:not([data-asset-picker-visible]),
:is(.grid-table .grid-cell.assets-fieldtype, .grid-stacked) [data-asset-browser]:not([data-asset-picker-visible]) *:not(button, button *) {
@apply rounded-lg border-none;
}
/* GRID FIELDTYPE / Assets fieldtype in a grid fieldtype / Row Compression
=================================================== */
/* When a grid field has at least 2 columns (so 3 including the menu control) change the presentation and compress the padding so it fits in with the other grid cells */
/* Table UI Mode */
.grid-table tr:has(> :nth-child(3)) .grid-cell.assets-fieldtype:not(:has([data-asset-picker])) > * {
@apply shadow-ui-sm;
td {
/* Table UI Mode: a cell is in a row with 3+ cells if it's 3rd or later from either end, or the middle of three. Fields in nested grids follow the outer row too */
.grid-table tr > :is(:nth-child(n+3), :nth-last-child(n+3), :nth-child(2):nth-last-child(2)) {
:is(.grid-cell.assets-fieldtype > [data-ui-input-group]):not(:has([data-asset-picker])) {
@apply shadow-ui-sm;
}
:is(.grid-cell.assets-fieldtype [data-asset-browser]):not([data-asset-picker-visible]) td {
padding: 0.3125rem;
}
Comment on lines 134 to 144

@jaygeorge jaygeorge Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Image

After this change

Image

Copy link
Copy Markdown
Contributor Author

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().

Copy link
Copy Markdown
Contributor

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 😄

}
Expand Down
104 changes: 51 additions & 53 deletions resources/css/core/utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -290,67 +290,65 @@

*/
@utility bg-architectural-lines {
&:not(:has(.page-tree-branch)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 :has(.page-tree-branch) guard was quietly hiding that behind the Pages tree. With #15681 the class doesn't leak any more, so the guard isn't needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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%;
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions resources/js/components/fieldtypes/assets/AssetsFieldtype.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<div data-asset-browser class="@container relative w-full bg-gray-50 dark:bg-transparent rounded-xl [.link-fieldtype_&]:bg-transparent">
<div
data-asset-browser
:data-asset-picker-visible="pickerVisible || null"
class="@container relative w-full bg-gray-50 dark:bg-transparent rounded-xl [.link-fieldtype_&]:bg-transparent"
>
<div
v-if="hasPendingDynamicFolder"
class="w-full rounded-md border border-dashed px-4 py-3 text-sm text-gray-700 dark:border-gray-300 dark:text-gray-200"
Expand Down Expand Up @@ -27,7 +31,7 @@
</div>

<div
v-if="!isReadOnly && showPicker"
v-if="pickerVisible"
data-asset-picker
class="not-[.link-fieldtype_&]:p-2 not-[.link-fieldtype_&]:border border-gray-300 dark:border-gray-700 dark:bg-gray-850 rounded-xl flex flex-wrap items-center gap-y-1 gap-x-3"
:class="{
Expand Down Expand Up @@ -428,6 +432,10 @@ export default {
return true;
},

pickerVisible() {
return !this.isReadOnly && this.showPicker;
},

showSetAlt() {
return this.config.show_set_alt && !this.isReadOnly;
},
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/ui/Context/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="
grid grid-cols-[auto_1fr] p-1.5
bg-white border-gray-200 dark:bg-gray-900 dark:border-black rounded-b-xl shadow-ui-xs
group-has-data-ui-context-footer:border-b
[&:has(~[data-ui-context-footer])]:border-b
[&_[data-ui-radio-item]]:ps-3 [&_[data-ui-radio-item]]:py-0.5
overflow-hidden z-10
"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/ui/Dropdown/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="
grid grid-cols-[auto_1fr] p-1.5
bg-white border-gray-200 dark:bg-gray-850 dark:border-black rounded-b-xl shadow-ui-xs
group-has-data-ui-dropdown-footer:border-b
[&:has(~[data-ui-dropdown-footer])]:border-b
[&_[data-ui-radio-item]]:ps-3 [&_[data-ui-radio-item]]:py-0.5
overflow-hidden z-10
"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/ui/Publish/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const fieldtypeComponentEvents = computed(() => ({
>
<Field
v-show="shouldRenderField"
:class="[`${config.type}-fieldtype`, { 'opacity-0 pointer-events-none': shouldHideFieldVisually }]"
:class="[`${config.type}-fieldtype`, { 'opacity-0 pointer-events-none': shouldHideFieldVisually, 'publish-field-hidden': !shouldRenderField }]"
:inert="shouldHideFieldVisually"
:id="fieldId"
:dir="direction"
Expand Down
5 changes: 3 additions & 2 deletions resources/js/components/ui/Publish/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ watch(tabWrapper, (el) => {
}
});

watch(visibleMainTabs, () => {
// Only watch what the tab bar shows; deep-watching the tabs would traverse the whole blueprint.
watch(() => visibleMainTabs.value.map((tab) => `${tab.handle}:${tab.display}`).join('|'), () => {
nextTick(checkOverflow);
}, { deep: true });
});

onUnmounted(() => {
overflowTracker.disconnect();
Expand Down
Loading