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

How to extend styles like styled-componets? #228

Closed
xh4528 opened this issue Jun 22, 2023 · 4 comments · Fixed by #229
Closed

How to extend styles like styled-componets? #228

xh4528 opened this issue Jun 22, 2023 · 4 comments · Fixed by #229

Comments

@xh4528
Copy link

xh4528 commented Jun 22, 2023

Styils is very convenient to use, but it seems that there is no function to extend styles in the documentation. How can I extend styles like styled-components?Looking forward to a reply.

https://styled-components.com/docs/basics#extending-styles

@xh4528
Copy link
Author

xh4528 commented Jun 22, 2023

in vue3 , i have tried to pass other style components to styled, and the page appears to be working properly. The console prompts for some warnings, but adding CSS will fail after switching themes.
(requires manual addition !important)

image

export const Menu = styled("div", (theme) => ({
  display: "flex",
  gap: "20px",
  position: "sticky",
  top: "0",
  color: theme?.color,
  backgroundColor: theme?.backgroundColor,
  transition: "linear .3s",
}));

export const NMenu = styled(Menu, (theme) => ({
  top: "100px",
}));

Jun-23-2023 00-20-36

@zoy-l
Copy link
Collaborator

zoy-l commented Jun 24, 2023

Hi, I will investigate.

@zoy-l
Copy link
Collaborator

zoy-l commented Jun 25, 2023

@xh4528 Already fixed in v1.1.6, if there are still problems, please feel free to reopen or create a new issue.🤞

@xh4528
Copy link
Author

xh4528 commented Jun 25, 2023

@zoy-l After updating v1.1.6, this issue has been resolved. Thank you for your help 👍

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

Successfully merging a pull request may close this issue.

2 participants