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

v0.9.1 generates wrong css? #58

Open
ModyQyW opened this issue Aug 18, 2023 · 6 comments
Open

v0.9.1 generates wrong css? #58

ModyQyW opened this issue Aug 18, 2023 · 6 comments
Labels
bug Something isn't working PR Welcome Welcome anyone solve this issue

Comments

@Dunqing
Copy link
Member

Dunqing commented Aug 18, 2023

I think it's a bug, the output should contain all used theme configuration

@Dunqing Dunqing added bug Something isn't working PR Welcome Welcome anyone solve this issue labels Aug 18, 2023
@ModyQyW
Copy link
Author

ModyQyW commented Aug 18, 2023

After I add the support and want to send a PR, I found out that Variables do not work inside media queries and container queries. ... 😅 What a life waste...

image

@Dunqing
Copy link
Member

Dunqing commented Aug 18, 2023

Ah, Now you can send a PR to avoid breakpoints apply css variables

@ModyQyW
Copy link
Author

ModyQyW commented Aug 18, 2023

I can think of 3 possibilities.

  1. generates
@media (min-width: 0px){
.xs\:text-xl{font-size:1.25rem;line-height:1.75rem;}
}

instead of

@media (min-width: var(--un-preset-theme-breakpoints-xs)){
.xs\:text-xl{font-size:1.25rem;line-height:1.75rem;}
}

However, this is unexpected if I want different breakpoints for different themes. Another possible way is custom media query which is not launched for now and can not be used here.

  1. ignore generations and let users override in their config files.

  2. accept the generation for :root and ignore others' generations. I think this one is fine and prefer this one for now.

Which one do you prefer? If I am wrong, please correct me. Thanks! 🙏

@ModyQyW
Copy link
Author

ModyQyW commented Aug 18, 2023

I find a new resolution in my case.

https://github.com/ModyQyW/unocss-preset-element-plus/blob/main/src/index.ts#L7-L38

If someone is interested in it, please carry on. Thanks! 🙏

@Dunqing
Copy link
Member

Dunqing commented Aug 18, 2023

Looks like good, you can go ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR Welcome Welcome anyone solve this issue
Projects
None yet
Development

No branches or pull requests

2 participants