Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Wrapping styled components causes styling issues #405

Open
@garthtee

Description

@garthtee

Describe the bug (including copyable syntax)
Wrapping styled components is causing style issues. If I remove the theme wrapper the stling returns to the expected

Expected styles (see the CustomerNameWidth const is blue)
image

Screenshot
Unexpected styles (see the CustomerNameWidth const is yellow)
image

To Reproduce

const theme = (Component) => {
  const ThemedComponent = (props) => <Component {...props} theme="dark" />;

  return ThemedComponent;
};

const getTableHeaderColor = ({theme}: any): string => theme === "dark" ? "gray" : "white";

const TableHeader = theme(styled.div`
  width: 100%;
  background-color: ${getTableHeaderColor};
  display: flex;
  padding: 10px 50px;
  margin-bottom: 10px;
`);

const CustomerNameWidth = styled.div`
  flex-basis: 90%;
`;

Build environment (please complete the following information):

  • OS: MacOS Monterey 12.6.3
  • VSCode Version: 1.76.2
  • Extension Version 1.7.5

Extensions
styled-components.vscode-styled-components

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions