Git Product home page Git Product logo

Comments (6)

rgossiaux avatar rgossiaux commented on July 23, 2024 2

Thanks.

The empty div tags come from the transitions--each <Transition> and <TransitionChild> component renders exactly one div. In the React/Vue versions you have the ability to do as={Fragment} to not render anything and have the transition classes applied to the child component, but that's impossible to do directly in Svelte and would need some kind of more elaborate workaround (like exposing a prop getter or maybe for transitions an action which you could apply). At that point I'm not sure the increase in complexity is worth it.

The main downside is just when converting Tailwind UI snippets, I think. In cases where they use as={Fragment} you might need to pull some of the CSS classes up to the <Transition> / <TransitionChild>. In your case, try adding a class= prop to the problematic transition and duplicating or replacing some of the classes there.

Looking at your snippet, if the problematic element is the <div class="relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-indigo-700">, you can just remove that div and move all of its classes to the parent <TransitionChild>.

from svelte-headlessui.

rgossiaux avatar rgossiaux commented on July 23, 2024

Can you share the relevant code?

from svelte-headlessui.

twobitunicorn avatar twobitunicorn commented on July 23, 2024

@rgossiaux Yes, working on it.

from svelte-headlessui.

twobitunicorn avatar twobitunicorn commented on July 23, 2024

https://pastebin.com/3A258fyz

from svelte-headlessui.

twobitunicorn avatar twobitunicorn commented on July 23, 2024

@rgossiaux This is a simplified version of a side bar from Tailwind UI. Make sure you are in response mode for a smaller screen sm: and you will see that the generated <div class = " ">. This sidebar should be full height of screen a fill out wider.

from svelte-headlessui.

twobitunicorn avatar twobitunicorn commented on July 23, 2024

@rgossiaux Cool, thanks! I had the feeling that was gonna be the case but I wanted to check in before I committed. Thanks again for your awesome work.

from svelte-headlessui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.