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

Investigate if CSS specificity is correct when using opinionated layers #57

Closed
Zn4rK opened this issue Oct 17, 2024 · 1 comment
Closed

Comments

@Zn4rK
Copy link
Contributor

Zn4rK commented Oct 17, 2024

Remix adds their own "critical css". Vite does the same. Almost. This is to avoid FOUC:
remix-run/remix#8070 (reply in thread)

One solution to this problem could be to use "opinionated layers" in dev mode for Remix (and potentially Vite).

The relevant function that figures out specificity, that could be incorrect, if the same CSS block is added twice:

export const getPropertyPriority = (property: string) => longhands.includes(property) ? 2 : 1;

Note: The root cause is that the same CSS block is added twice.

@Zn4rK
Copy link
Contributor Author

Zn4rK commented Oct 19, 2024

The CSS specificity is correct. There was however another bug due to how Remix inlines criticalCss. But a fix for that is on the way.

@Zn4rK Zn4rK closed this as completed Oct 19, 2024
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