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

Inline hover is not working #132

Open
isahuja2 opened this issue Aug 10, 2024 · 1 comment
Open

Inline hover is not working #132

isahuja2 opened this issue Aug 10, 2024 · 1 comment

Comments

@isahuja2
Copy link

Hi, I've bootstrapped the application using this

The issue is that the inline hover is not working. Below are two examples: one is working, and the other is not. Could you please guide me on what I'm doing wrong?

Working:-

import React from 'react';
import styled from 'styled-components';
import tw from 'twin.macro';

// Styled component with Tailwind CSS and hover effect
const Sample = styled.button`
  ${tw`text-white font-bold py-3 px-6 rounded bg-blue-500`}

  &:hover {
    ${tw`bg-blue-700`}
  }
`;

const App: React.FC = () => {
  return <Sample>Hover Me</Sample>;
};

export default App;

Not Working:-

import React from 'react';
import tw from 'twin.macro';

const App: React.FC = () => {
  return (
    <button
      css={tw`text-white font-bold py-3 px-6 rounded bg-blue-500 hover:bg-blue-700`}
    >
      Hover Me
    </button>
  );
};

export default App;

Thank you
ISA

@isahuja2
Copy link
Author

@ben-rogerson - appreciate if you can look, thanks

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