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

Styles are not correctly applied to SVG in button #1494

Closed
cameralibre opened this issue Feb 16, 2023 · 2 comments
Closed

Styles are not correctly applied to SVG in button #1494

cameralibre opened this issue Feb 16, 2023 · 2 comments

Comments

@cameralibre
Copy link

I was just about to start the 'Getting Started' tutorial, and I almost got nerd-sniped into fixing something on your website... lucky for me I don't understand Tailwind at all so I may have saved some time, but all you get is this lousy bug report :)

Problem

When viewing Getting Started in Firefox, the buttons are huge - both the buttons and their child SVG elements are filling 100% of their parent's width. (Tested on Mac & Linux)
When viewing the same page in Chromium, the buttons are the expected size but the SVG arrows are not visible, they have a size of 0×0. (Tested only on Linux)

Fix

Put this... somewhere..? 🤷‍♂️️ to apply it to the SVG elements

margin-left: 1rem;
width: 1.625rem;

Screenshots

screenshot of SVG icons in firefox, showing both the problem and the fix

Firefox: the first button has the fix applied, the second shows the oversized SVGs as currently visible on the site

screenshot of SVG icons in chromium, showing both the problem and the fix

Chromium: the first button has the fix applied, the second and third shows the missing SVGs as currently visible on the site
@jamespohalloran
Copy link
Contributor

Thanks for the report! Looks like the arrows have since been removed from the buttons:
Screen Shot 2023-04-12 at 4 00 15 PM

@cameralibre
Copy link
Author

great, thanks @jamespohalloran! the SVG is still in the markup so you should consider removing it or adding an aria-hidden so it doesn't confuse people using screen readers

<a 
  class="transition duration-150 ease-out rounded-full flex items-center font-tuner whitespace-nowrap leading-snug focus:outline-none focus:shadow-outline hover:-translate-y-px active:translate-y-px hover:-translate-x-px active:translate-x-px leading-tight hover:shadow active:shadow-none text-orange-600 hover:text-orange-500 border border-seafoam-150 bg-gradient-to-br from-seafoam-50 to-seafoam-150 px-6 pt-[12px] pb-[10px] text-base font-medium " 
  href="/docs/introduction/using-starter/">
  Get Started 
  <svg 
    stroke="currentColor" 
    fill="currentColor" 
    stroke-width="0" 
    viewBox="0 0 448 512" 
    xmlns="http://www.w3.org/2000/svg">
    <path d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path>
  </svg>
</a>

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

2 participants