diff --git a/resources/css/components/fieldtypes/grid.css b/resources/css/components/fieldtypes/grid.css index fc97b5d6e01..01e232c0b33 100644 --- a/resources/css/components/fieldtypes/grid.css +++ b/resources/css/components/fieldtypes/grid.css @@ -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; } } diff --git a/resources/css/core/utilities.css b/resources/css/core/utilities.css index 32b16a96f2d..a8b175638e0 100644 --- a/resources/css/core/utilities.css +++ b/resources/css/core/utilities.css @@ -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)) { - &::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%; } } } diff --git a/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue b/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue index d3cd9a300e5..c07eb1f1ccc 100644 --- a/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue +++ b/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue @@ -1,5 +1,9 @@