mirror of
https://github.com/immich-app/immich.git
synced 2025-01-12 15:32:36 +02:00
refactor(web): add tailwind plugin for repeating grid cols (#11748)
This commit is contained in:
parent
276101ee82
commit
b014162088
@ -32,7 +32,7 @@ export default [
|
|||||||
'**/svelte.config.js',
|
'**/svelte.config.js',
|
||||||
'eslint.config.mjs',
|
'eslint.config.mjs',
|
||||||
'postcss.config.cjs',
|
'postcss.config.cjs',
|
||||||
'tailwind.config.cjs',
|
'tailwind.config.js',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
...compat.extends(
|
...compat.extends(
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
{#if !isCollapsed}
|
{#if !isCollapsed}
|
||||||
<div class="grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-y-4" transition:slide={{ duration: 300 }}>
|
<div class="grid grid-auto-fill-56 gap-y-4" transition:slide={{ duration: 300 }}>
|
||||||
{#each albums as album, index (album.id)}
|
{#each albums as album, index (album.id)}
|
||||||
<a
|
<a
|
||||||
data-sveltekit-preload-data="hover"
|
data-sveltekit-preload-data="hover"
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
<div id="camera-selection">
|
<div id="camera-selection">
|
||||||
<p class="immich-form-label">{$t('camera').toUpperCase()}</p>
|
<p class="immich-form-label">{$t('camera').toUpperCase()}</p>
|
||||||
|
|
||||||
<div class="grid grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-5 mt-1">
|
<div class="grid grid-auto-fit-40 gap-5 mt-1">
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<Combobox
|
<Combobox
|
||||||
label={$t('make')}
|
label={$t('make')}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
export let filters: SearchDateFilter;
|
export let filters: SearchDateFilter;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="date-range-selection" class="grid grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-5">
|
<div id="date-range-selection" class="grid grid-auto-fit-40 gap-5">
|
||||||
<label class="immich-form-label" for="start-date">
|
<label class="immich-form-label" for="start-date">
|
||||||
<span>{$t('start_date').toUpperCase()}</span>
|
<span>{$t('start_date').toUpperCase()}</span>
|
||||||
<DateInput
|
<DateInput
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
<div id="location-selection">
|
<div id="location-selection">
|
||||||
<p class="immich-form-label">{$t('place').toUpperCase()}</p>
|
<p class="immich-form-label">{$t('place').toUpperCase()}</p>
|
||||||
|
|
||||||
<div class="grid grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-5 mt-1">
|
<div class="grid grid-auto-fit-40 gap-5 mt-1">
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<Combobox
|
<Combobox
|
||||||
label={$t('country')}
|
label={$t('country')}
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SingleGridRow
|
<SingleGridRow
|
||||||
class="grid grid-cols-[repeat(auto-fill,minmax(5rem,1fr))] -mx-1 gap-1 mt-2 overflow-y-auto immich-scrollbar"
|
class="grid grid-auto-fill-20 -mx-1 gap-1 mt-2 overflow-y-auto immich-scrollbar"
|
||||||
bind:itemCount={numberOfPeople}
|
bind:itemCount={numberOfPeople}
|
||||||
>
|
>
|
||||||
{#each peopleList as person (person.id)}
|
{#each peopleList as person (person.id)}
|
||||||
|
@ -53,10 +53,7 @@
|
|||||||
draggable="false">{$t('view_all')}</a
|
draggable="false">{$t('view_all')}</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<SingleGridRow
|
<SingleGridRow class="grid md:grid-auto-fill-28 grid-auto-fill-20 gap-x-4" let:itemCount>
|
||||||
class="grid md:grid-cols-[repeat(auto-fill,minmax(7rem,1fr))] grid-cols-[repeat(auto-fill,minmax(5rem,1fr))] gap-x-4"
|
|
||||||
let:itemCount
|
|
||||||
>
|
|
||||||
{#each people.slice(0, itemCount) as person (person.id)}
|
{#each people.slice(0, itemCount) as person (person.id)}
|
||||||
<a href="{AppRoute.PEOPLE}/{person.id}" class="text-center">
|
<a href="{AppRoute.PEOPLE}/{person.id}" class="text-center">
|
||||||
<ImageThumbnail circle shadow url={getPeopleThumbnailUrl(person)} altText={person.name} widthStyle="100%" />
|
<ImageThumbnail circle shadow url={getPeopleThumbnailUrl(person)} altText={person.name} widthStyle="100%" />
|
||||||
@ -77,10 +74,7 @@
|
|||||||
draggable="false">{$t('view_all')}</a
|
draggable="false">{$t('view_all')}</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<SingleGridRow
|
<SingleGridRow class="grid md:grid-auto-fill-36 grid-auto-fill-28 gap-x-4" let:itemCount>
|
||||||
class="grid md:grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] grid-cols-[repeat(auto-fill,minmax(7rem,1fr))] gap-x-4"
|
|
||||||
let:itemCount
|
|
||||||
>
|
|
||||||
{#each places.slice(0, itemCount) as item (item.data.id)}
|
{#each places.slice(0, itemCount) as item (item.data.id)}
|
||||||
<a class="relative" href="{AppRoute.SEARCH}?{getMetadataSearchQuery({ city: item.value })}" draggable="false">
|
<a class="relative" href="{AppRoute.SEARCH}?{getMetadataSearchQuery({ city: item.value })}" draggable="false">
|
||||||
<div class="flex justify-center overflow-hidden rounded-xl brightness-75 filter">
|
<div class="flex justify-center overflow-hidden rounded-xl brightness-75 filter">
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
import plugin from 'tailwindcss/plugin';
|
||||||
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
module.exports = {
|
export default {
|
||||||
content: ['./src/**/*.{html,js,svelte,ts}'],
|
content: ['./src/**/*.{html,js,svelte,ts}'],
|
||||||
darkMode: 'class',
|
darkMode: 'class',
|
||||||
theme: {
|
theme: {
|
||||||
@ -34,4 +36,19 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
plugins: [
|
||||||
|
plugin(({ matchUtilities, theme }) => {
|
||||||
|
matchUtilities(
|
||||||
|
{
|
||||||
|
'grid-auto-fit': (value) => ({
|
||||||
|
gridTemplateColumns: `repeat(auto-fit, minmax(min(${value}, 100%), 1fr))`,
|
||||||
|
}),
|
||||||
|
'grid-auto-fill': (value) => ({
|
||||||
|
gridTemplateColumns: `repeat(auto-fill, minmax(min(${value}, 100%), 1fr))`,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{ values: theme('width') },
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
],
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user