tailwindlabs / tailwindui-issues

A place to report bugs discovered in Tailwind UI.
236 stars 4 forks source link

Unnecessary duplication in navbar #1473

Closed ianmackenzie closed 1 year ago

ianmackenzie commented 1 year ago

What component (if applicable)

Describe the bug It seems like there's some unnecessary duplication in the HTML; in

<div class="flex flex-shrink-0 items-center">
  <img class="block h-8 w-auto lg:hidden" src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600" alt="Your Company">
  <img class="hidden h-8 w-auto lg:block" src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600" alt="Your Company">
</div>

it looks to me like the two <img> elements are identical except that one is visible up to lg size and then the other is visible at lg size and above...which is functionally identical to just having a single <img> element visible at all screen sizes.

To Reproduce Steps to reproduce the behavior:

  1. Use the provided HTML code and see that there are duplicate elements :sweat_smile:

Expected behavior

HTML similar to

<div class="flex flex-shrink-0 items-center">
  <img class="block h-8 w-auto" src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600" alt="Your Company">
</div>

instead.

bradlc commented 1 year ago

Hey @ianmackenzie, thanks for reporting this. You're totally right, and we have now tidied this up 👍

ianmackenzie commented 1 year ago

Quick work, thanks @bradlc! Glad I could help, Tailwind UI is great :slightly_smiling_face: