Skip to content

use add_style instead of _get_style for drawer components#5734

Merged
adhami3310 merged 2 commits into
mainfrom
use-add_style-instead-of-_get_style-for-drawer-components
Aug 25, 2025
Merged

use add_style instead of _get_style for drawer components#5734
adhami3310 merged 2 commits into
mainfrom
use-add_style-instead-of-_get_style-for-drawer-components

Conversation

@adhami3310

Copy link
Copy Markdown
Member

fixes #5729

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Edit Code Review Bot Settings | Greptile

Comment thread reflex/components/radix/primitives/drawer.py Outdated
@codspeed-hq

codspeed-hq Bot commented Aug 25, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #5734 will not alter performance

Comparing use-add_style-instead-of-_get_style-for-drawer-components (f25f6ea) with main (fe9551d)

Summary

✅ 8 untouched benchmarks

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@adhami3310 adhami3310 merged commit 44d39cb into main Aug 25, 2025
40 of 41 checks passed
@adhami3310 adhami3310 deleted the use-add_style-instead-of-_get_style-for-drawer-components branch August 25, 2025 18:21
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 this pull request may close these issues.

kebap-case

2 participants