replace hardcoded colors with centralized theme-aware styling#2096
Open
harshitha0539 wants to merge 2 commits into
Open
replace hardcoded colors with centralized theme-aware styling#2096harshitha0539 wants to merge 2 commits into
harshitha0539 wants to merge 2 commits into
Conversation
Contributor
|
Thank you @, for creating the PR and contributing to our UltimateHealth project 💗. |
Author
|
hi @SB2318 i solved the issues plz approve and merge this pr |
Contributor
Automated Review FeedbackProvide actionable comments grouped by severity: Important
Suggestions
|
Author
|
Hii @SB2318 plz check the pr and merge it |
2 similar comments
Author
|
Hii @SB2318 plz check the pr and merge it |
Author
|
Hii @SB2318 plz check the pr and merge it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2035
📌 Summary
This Pull Request refactors reusable UI components by replacing hardcoded color values with centralized theme variables. The primary objective is to ensure consistent Light and Dark Mode support throughout the application while improving maintainability, accessibility, and scalability of the styling system.
Previously, several shared components relied on fixed hexadecimal color values, which prevented them from adapting correctly when the application's theme changed. This update removes those static color definitions and integrates the existing theme system so that components automatically respond to theme changes without affecting their functionality or layout.
✨ Changes Implemented
Removed hardcoded hexadecimal color values from reusable UI components.
Replaced static color definitions with centralized theme color variables.
Updated background, text, border, and other UI colors to use theme-aware styling.
Refactored affected components to dynamically adapt to Light and Dark Mode.
Improved text readability by ensuring proper foreground and background contrast.
Preserved the existing UI design and component behavior.
Improved code readability and maintainability by eliminating inline color values wherever applicable.
🔧 Implementation Details
During this implementation, the following improvements were made:
Replaced hardcoded color values such as:
#FFFFFF
#000000
#F5F5F5
#EFEFEF
#333333
#666666
#CCCCCC
Updated components to use centralized theme color tokens, including:
colors.background
colors.surface
colors.text
colors.border
colors.primary
colors.secondary
colors.error
Refactored styles to derive colors from the application's theme instead of static values.
Ensured components automatically update whenever the active application theme changes.
Reviewed reusable UI components for consistent styling and better maintainability.
📂 Components Updated
The following reusable UI elements were reviewed and updated where applicable:
Badge Components
Shared UI Components
Common Cards
List Items
Status Chips
Empty State Components
Reusable Buttons (where required)
Other shared widgets using hardcoded colors
✅ Benefits
Full compatibility with both Light and Dark themes.
Consistent visual appearance across reusable components.
Improved accessibility through better color contrast.
Cleaner, more maintainable, and scalable styling.
Simplified future theme customization.
Reduced reliance on hardcoded styling values.
Better overall user experience.
🧪 Testing
The following checks were performed after implementing the changes:
✅ Verified all updated components in Light Mode.
✅ Verified all updated components in Dark Mode.
✅ Confirmed that theme switching updates colors correctly.
✅ Ensured no UI regressions or layout changes.
✅ Verified that component functionality remains unchanged.
✅ Checked text readability and contrast across supported themes.
📋 Checklist
Replaced hardcoded color values with centralized theme variables.
Maintained existing UI and functionality.
Verified Light and Dark Mode compatibility.
Improved accessibility and visual consistency.
Tested updated components before submitting.Closes #2035
📌 Summary
This Pull Request refactors reusable UI components by replacing hardcoded color values with centralized theme variables. The primary objective is to ensure consistent Light and Dark Mode support throughout the application while improving maintainability, accessibility, and scalability of the styling system.
Previously, several shared components relied on fixed hexadecimal color values, which prevented them from adapting correctly when the application's theme changed. This update removes those static color definitions and integrates the existing theme system so that components automatically respond to theme changes without affecting their functionality or layout.
✨ Changes Implemented
Removed hardcoded hexadecimal color values from reusable UI components.
Replaced static color definitions with centralized theme color variables.
Updated background, text, border, and other UI colors to use theme-aware styling.
Refactored affected components to dynamically adapt to Light and Dark Mode.
Improved text readability by ensuring proper foreground and background contrast.
Preserved the existing UI design and component behavior.
Improved code readability and maintainability by eliminating inline color values wherever applicable.
🔧 Implementation Details
During this implementation, the following improvements were made:
Replaced hardcoded color values such as:
#FFFFFF
#000000
#F5F5F5
#EFEFEF
#333333
#666666
#CCCCCC
Updated components to use centralized theme color tokens, including:
colors.background
colors.surface
colors.text
colors.border
colors.primary
colors.secondary
colors.error
Refactored styles to derive colors from the application's theme instead of static values.
Ensured components automatically update whenever the active application theme changes.
Reviewed reusable UI components for consistent styling and better maintainability.
📂 Components Updated
The following reusable UI elements were reviewed and updated where applicable:
Badge Components
Shared UI Components
Common Cards
List Items
Status Chips
Empty State Components
Reusable Buttons (where required)
Other shared widgets using hardcoded colors
✅ Benefits
Full compatibility with both Light and Dark themes.
Consistent visual appearance across reusable components.
Improved accessibility through better color contrast.
Cleaner, more maintainable, and scalable styling.
Simplified future theme customization.
Reduced reliance on hardcoded styling values.
Better overall user experience.
🧪 Testing
The following checks were performed after implementing the changes:
✅ Verified all updated components in Light Mode.
✅ Verified all updated components in Dark Mode.
✅ Confirmed that theme switching updates colors correctly.
✅ Ensured no UI regressions or layout changes.
✅ Verified that component functionality remains unchanged.
✅ Checked text readability and contrast across supported themes.
📋 Checklist
Replaced hardcoded color values with centralized theme variables.
Maintained existing UI and functionality.
Verified Light and Dark Mode compatibility.
Improved accessibility and visual consistency.
Tested updated components before submitting.