-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add ESLint rule for slow CSS properties that may impact GPU rendering #5425
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Co-authored-by: JonnyBurger <[email protected]>
@copilot String keys like "box-shadow" should indeed also trigger the warning |
…w-css-property rule Co-authored-by: JonnyBurger <[email protected]>
@copilot Nice, please also detect these properties applied via Tailwind classes |
…-property rule Co-authored-by: JonnyBurger <[email protected]>
Added Tailwind CSS class detection! The rule now detects slow CSS properties in both React style objects and Tailwind classes including shadow-, blur-, brightness-, contrast-, drop-shadow-, grayscale, hue-rotate-, invert, saturate-*, and sepia classes. (c631da5) |
This PR adds a new ESLint rule
@remotion/slow-css-property
that warns developers when they use CSS properties that may slow down rendering on machines without a GPU.What it does
The rule detects usage of the following CSS properties in React style objects:
boxShadow
- Box shadow effectstextShadow
- Text shadow effectsfilter
- CSS filter effects (blur, brightness, etc.)When any of these properties are used, the rule displays a warning:
Examples
❌ Invalid (triggers warning):
✅ Valid (no warning):
Implementation Details
src/rules/slow-css-property.ts
src/tests/slow-css-property.test.ts
The rule is automatically included when using
@remotion/eslint-plugin
with the recommended configuration.Fixes #5424.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.