use add_style instead of _get_style for drawer components#5734
use add_style instead of _get_style for drawer components#5734adhami3310 merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR addresses issue #5729 by refactoring drawer components to use the standard add_style() method instead of custom _get_style() implementations. The change affects three drawer components: DrawerOverlay, DrawerTitle, and DrawerDescription in the Radix primitives.
The original implementation used custom _get_style() methods that returned CSS properties in kebab-case format (font-size, font-weight, letter-spacing), which caused Emotion React warnings in the browser console. Emotion React expects camelCase property names when CSS is defined in JavaScript objects. By switching to the standard add_style() method, these components now align with the established Reflex component styling pattern used throughout the codebase.
The add_style() method is the standard way Reflex components define their default styles, and it properly integrates with the framework's styling system. This change makes the drawer components consistent with other Radix theme components that already use this pattern. The pyi_hashes.json file was updated to reflect the type signature changes in the corresponding .pyi file.
Confidence score: 2/5
- This PR has a critical bug that will cause visual rendering issues in production
- Score lowered due to a typo in CSS property name ('line-weight' instead of 'line-height') and potential breaking change in style override functionality
- Pay close attention to DrawerTitle component and test style customization behavior thoroughly
2 files reviewed, 1 comment
CodSpeed Performance ReportMerging #5734 will not alter performanceComparing Summary
|
fixes #5729