File tree Expand file tree Collapse file tree 3 files changed +37
-9
lines changed
css/components/fieldtypes
js/components/fieldtypes/assets Expand file tree Collapse file tree 3 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 1- /* ==========================================================================
2- Grid Fieldtype
3- ========================================================================== */
1+ /* GRID FIELDTYPE
2+ =================================================== */
43@layer ui {
54 .grid-table {
65 @apply bg-white dark:bg-gray-900 relative w-full rounded-lg border shadow-ui-sm outline-hidden dark:border-gray-700 dark:text-dark-150 text-start;
10099 .grid-item-header {
101100 @apply flex cursor-move items-center justify-between border-b bg-gray-200 px-4 py-2 text-sm outline-hidden;
102101 }
102+ }
103+
104+ /* GRID FIELDTYPE / Assets fieldtype in a grid fieldtype
105+ =================================================== */
106+ /* Table UI mode */
107+ .grid-table .grid-cell .assets-fieldtype : not (: has ([data-asset-picker ])) > * ,
108+ /* Stacked UI mode */
109+ .grid-stacked [data-asset-browser ]: not (: has ([data-asset-picker ])) {
110+ /* 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 */
111+ @apply border-gray-300 dark:border-gray-700 border-1 rounded-lg;
112+ /* Prevent the descended table elements from inheriting this, such as the img thumbnail and the delete button */
113+ * : not (button , button * ) {
114+ @apply rounded-lg border-none;
115+ }
116+ }
117+ /* GRID FIELDTYPE / Assets fieldtype in a grid fieldtype / Row Compression
118+ =================================================== */
119+ /* 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 */
120+ /* Table UI Mode */
121+ .grid-table tr : has (> : nth-child (3 )) .grid-cell .assets-fieldtype : not (: has ([data-asset-picker ])) > * {
122+ @apply shadow-ui-sm;
123+ td {
124+ padding : 0.3125rem ;
125+ }
126+ }
127+ /* Stacked UI mode */
128+ .grid-stacked : not (: has ([data-asset-picker ])) .publish-fields : has (> : nth-child (3 )) .assets-fieldtype td {
129+ padding : 0.3125rem ;
103130}
Original file line number Diff line number Diff line change 11<template >
22 <!-- Safari doesn't support `position: relative` on `<tr>` elements, but these two properties can be used as an alternative. Source: https://mtsknn.fi/blog/relative-tr-in-safari/ transform: translate(0); clip-path: inset(0); -->
3- <tr class =" relative cursor-grab bg-white hover:bg-gray-50 dark:bg-gray-900 dark:hover:bg-gray-900 border-b dark:border-dark-500 last:border-b-0" style =" transform : translate (0 ); clip-path : inset (0 );" >
3+ <tr class =" group relative cursor-grab bg-white hover:bg-gray-50 dark:bg-gray-900 dark:hover:bg-gray-900 border-b dark:border-dark-500 last:border-b-0" style =" transform : translate (0 ); clip-path : inset (0 );" >
44 <td class =" flex gap-2 sm:gap-3 h-full items-center p-3" >
55 <div
66 v-if =" canShowSvg"
3131 {{ asset.basename }}
3232 </button >
3333 </td >
34- <td class =" absolute top-0 right-0 flex items-center bg-gradient-to-r to-20% from-transparent to-white dark:to-gray-900 p-3 ps-[2rem] align-middle text-end" >
34+ <td class =" absolute top-0 right-0 flex items-center bg-gradient-to-r to-20% from-transparent to-white dark:to-gray-900 p-3 ps-[2rem] align-middle text-end group-hover:to-gray-50 dark:group-hover:to-gray-900 " >
3535 <ui-badge
3636 v-if =" showSetAlt && needsAlt"
3737 as =" button"
Original file line number Diff line number Diff line change 11<template >
2- <div class =" @container relative w-full bg-gray-50 dark:bg-transparent rounded-xl" >
2+ <div data-asset-browser class =" @container relative w-full bg-gray-50 dark:bg-transparent rounded-xl" >
33 <div
44 v-if =" hasPendingDynamicFolder"
55 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"
2828
2929 <div
3030 v-if =" !isReadOnly && showPicker"
31+ data-asset-picker
3132 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-col @2xs:flex-row items-center gap-2 sm:gap-3 gap-y-3"
3233 :class =" {
3334 'rounded-b-none': expanded,
124125
125126 <div class =" relative overflow-hidden rounded-xl border border-gray-300 dark:border-gray-700 not-[.link-fieldtype_& ]:border-t-0! not-[.link-fieldtype_& ]:rounded-t-none" v-if =" displayMode === 'list'" >
126127 <table class =" table-fixed w-full" >
127- <thead >
128+ <thead class = " sr-only " >
128129 <tr >
129- <th class = " sr-only " >Asset</th >
130- <th class = " sr-only " >Actions</th >
130+ <th >Asset</th >
131+ <th >Actions</th >
131132 </tr >
132133 </thead >
133134 <sortable-list
You can’t perform that action at this time.
0 commit comments