Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroicons look mangled when Javascript is disabled #24

Open
JoshElias opened this issue Jan 8, 2023 · 0 comments
Open

Heroicons look mangled when Javascript is disabled #24

JoshElias opened this issue Jan 8, 2023 · 0 comments

Comments

@JoshElias
Copy link

I started receiving this issue on first load when loading my app with SSR in a dev environment. It was weird because when the hot reload server would detect a change and reload, the icons would fix themselves. Eventually I was able to reproduce it by disabling Javascript altogether. Seems to only exist when using the Heroicons library.

image

import { HiOutlineHome, HiOutlineBriefcase, HiOutlineFolder, HiOutlineNewspaper, HiOutlineChat, HiOutlineFire } from "solid-icons/hi";
const options = [
    {
        icon: <HiOutlineHome size={24} />,
    },
    {
        icon: <HiOutlineBriefcase size={24}/>,
    },
    {
        icon: <HiOutlineFolder size={24}/>,
    },
    {
        icon: <HiOutlineFire size={24}/>,
    },
    {
        icon: <HiOutlineNewspaper size={24}/>,
    },
]

function NavOption(props) {
    return (   
        <A href="#">
            {props.icon}
        </A>                   
    )
}

export default function NavBar() {
    return (      
        <nav class="mt-8 flex-1 space-y-1 px-2" aria-label="Sidebar">
              <For each={options}>
                      {(option) => 
                            <NavOption icon={option.icon} />
                       }
               </For>
         </nav>
         ...
     )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant