Browse Source

Add `content-visibility-auto` Tailwind utility

master
buttercat1791 10 months ago
parent
commit
557f3c0dfb
  1. 2
      src/lib/components/PublicationSection.svelte
  2. 20
      tailwind.config.cjs

2
src/lib/components/PublicationSection.svelte

@ -105,7 +105,7 @@
</script> </script>
<!-- TODO: Correctly handle events that are the start of a content section. --> <!-- TODO: Correctly handle events that are the start of a content section. -->
<section bind:this={sectionRef} class='publication-leather'> <section bind:this={sectionRef} class='publication-leather content-visibility-auto'>
{#await Promise.all([leafTitle, leafContent, leafHierarchy, publicationType, divergingBranches])} {#await Promise.all([leafTitle, leafContent, leafHierarchy, publicationType, divergingBranches])}
<TextPlaceholder size='xxl' /> <TextPlaceholder size='xxl' />
{:then [leafTitle, leafContent, leafHierarchy, publicationType, divergingBranches]} {:then [leafTitle, leafContent, leafHierarchy, publicationType, divergingBranches]}

20
tailwind.config.cjs

@ -1,4 +1,5 @@
import flowbite from "flowbite/plugin"; import flowbite from "flowbite/plugin";
import plugin from "tailwindcss/plugin";
/** @type {import('tailwindcss').Config}*/ /** @type {import('tailwindcss').Config}*/
const config = { const config = {
@ -85,6 +86,25 @@ const config = {
plugins: [ plugins: [
flowbite(), flowbite(),
plugin(function({ addUtilities, matchUtilities }) {
addUtilities({
'.content-visibility-auto': {
'content-visibility': 'auto',
},
'.contain-size': {
contain: 'size',
},
});
matchUtilities({
'contain-intrinsic-w-*': value => ({
width: value,
}),
'contain-intrinsic-h-*': value => ({
height: value,
})
});
})
], ],
darkMode: 'class', darkMode: 'class',

Loading…
Cancel
Save