-
-
Notifications
You must be signed in to change notification settings - Fork 840
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
fixed #3318 Figma: Refactor CSS files in src/components/OrganizationCard #3384
fixed #3318 Figma: Refactor CSS files in src/components/OrganizationCard #3384
Conversation
WalkthroughThis pull request focuses on refactoring CSS files for the OrganizationCard component by removing the local CSS module and migrating its styles to the global Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3384 +/- ##
=====================================================
+ Coverage 7.93% 89.69% +81.76%
=====================================================
Files 312 335 +23
Lines 8129 8638 +509
Branches 1815 1921 +106
=====================================================
+ Hits 645 7748 +7103
+ Misses 7417 631 -6786
- Partials 67 259 +192
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/components/OrganizationCard/OrganizationCard.module.css
(0 hunks)src/components/OrganizationCard/OrganizationCard.tsx
(1 hunks)src/style/app.module.css
(1 hunks)
💤 Files with no reviewable changes (1)
- src/components/OrganizationCard/OrganizationCard.module.css
✅ Files skipped from review due to trivial changes (1)
- src/components/OrganizationCard/OrganizationCard.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test Application
🔇 Additional comments (3)
src/style/app.module.css (3)
Line range hint
1-150
: Well-organized CSS variables with clear documentation!The CSS variables are logically grouped, well-documented, and follow a consistent naming convention. The methodology section provides clear guidelines for contributors.
Line range hint
6500-7000
: Well-implemented responsive design with proper breakpoints!The media queries are well-organized, use consistent breakpoint variables, and include appropriate fallbacks for cross-browser compatibility.
Line range hint
4000-4500
: Good accessibility implementation with proper focus states and ARIA support!The styles properly handle keyboard navigation, focus states, and ARIA attributes, ensuring good accessibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/style/app.module.css (3)
7254-7261
: Improve responsiveness and background blending for.alignimg
.Consider these improvements:
- Use relative units for better responsiveness
- Add background properties for the blend mode to take effect
.alignimg { border-radius: 50%; + background-color: var(--white-color); background-blend-mode: darken; - height: 65px; - width: 65px; + height: clamp(50px, 4vw, 65px); + width: clamp(50px, 4vw, 65px); + object-fit: cover; }
7262-7269
: Fix redundant hover state and selector syntax.The hover state is redundant and the selector has an extra space.
.box { color: var(--light-orange); } -.box :hover { - color: var(--light-orange); -}
Line range hint
7296-7301
: Improve responsiveness and remove !important flag.Consider these improvements:
- Use max-width or percentage for better responsiveness
- Remove !important flag and handle specificity properly
.deco { border: 1px solid var(--grey-border); - width: 65vw; + width: 100%; + max-width: 800px; - height: 0px !important; + height: 0; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/style/app.module.css
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test Application
🔇 Additional comments (4)
src/style/app.module.css (4)
7270-7276
: LGTM!The flexbox implementation is clean and follows consistent naming.
7277-7281
: LGTM!The padding implementation is clean and straightforward.
7289-7295
: 🛠️ Refactor suggestionAdd font-size units and use color variables.
The font-size is missing units and the color should use CSS variables for consistency.
.second_box > h5 { text-decoration: none; - font-size: 10; + font-size: 10px; font-weight: 100; - color: #969696; + color: var(--gray-white); }Likely invalid or redundant comment.
7282-7288
: 🛠️ Refactor suggestionAdd font-size units and use color variables.
The font-size is missing units and the color should use CSS variables for consistency.
.second_box > h4 { - font-size: 10; + font-size: 10px; font-weight: bold; text-decoration: none; - color: black; + color: var(--black-color); }Likely invalid or redundant comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/style/app.module.css (1)
Line range hint
1420-1450
: Use defined breakpoint variables in media queries.For better maintainability, use the breakpoint variables defined in
:root
:-@media (max-width: 1420px) { +@media (max-width: var(--breakpoint-desktop)) { .orgCard { width: 100%; } } -@media (max-width: 550px) { +@media (max-width: var(--breakpoint-mobile)) { .orgCard { width: 100%; } /* ... rest of the styles ... */ }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/style/app.module.css
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test Application
🔇 Additional comments (4)
src/style/app.module.css (4)
7293-7298
: LGTM! Good use of CSS variables and max-width constraint.The
.deco
class properly uses CSS variables for border color and includes a max-width constraint for better layout control.
Line range hint
47-156
: Well-organized CSS variables with clear categorization.The CSS variables are properly organized into logical categories (Neutral Colors, Blue Shades, etc.) which supports the PR's goal of improved maintainability. The comprehensive set of variables will help maintain consistent styling across components.
Line range hint
1-40
: Excellent CSS methodology documentation.The comprehensive documentation with clear guidelines for contributors, naming conventions, and examples aligns perfectly with the PR's goal of improving maintainability. This will help maintain consistency as the codebase grows.
7255-7262
: Consider accessibility impact of background-blend-mode.The
background-blend-mode: darken
property may affect color contrast ratios and accessibility. Ensure the blending doesn't reduce contrast below WCAG guidelines.Run this script to check if background-blend-mode is used elsewhere in the codebase:
✅ Verification successful
Background blend mode usage is accessibility-safe
The
background-blend-mode: darken
is applied only to images with white backgrounds and doesn't affect text contrast or readability. This is a consistent pattern in the codebase for styling profile images.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for background-blend-mode usage rg "background-blend-mode" --type cssLength of output: 256
Script:
#!/bin/bash # Get context around background-blend-mode usage echo "=== app.module.css ===" rg -B 3 -A 3 "background-blend-mode" src/style/app.module.css echo -e "\n=== OrganizationCardStart.module.css ===" rg -B 3 -A 3 "background-blend-mode" src/components/OrganizationCardStart/OrganizationCardStart.module.css echo -e "\n=== app.css ===" rg -B 3 -A 3 "background-blend-mode" src/assets/css/app.cssLength of output: 935
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- See comments.
- Please attach a video
src/style/app.module.css
Outdated
|
||
.alignimg { | ||
border-radius: 50%; | ||
background-color: var(--white-color); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use variable names that describe the function of the color and not the color itself. This will help with adding a Dark Mode feature.
- For example
--search-button-bg
is much better than--light-blue
src/style/app.module.css
Outdated
} | ||
|
||
.box { | ||
color: var(--light-orange); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use variable names that describe the function of the color and not the color itself. This will help with adding a Dark Mode feature.
- For example
--search-button-bg
is much better than--light-blue
src/style/app.module.css
Outdated
font-size: 10px; | ||
font-weight: bold; | ||
text-decoration: none; | ||
color: black; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use variable names that describe the function of the color and not the color itself. This will help with adding a Dark Mode feature.
- For example
--search-button-bg
is much better than--light-blue
src/style/app.module.css
Outdated
text-decoration: none; | ||
font-size: 10px; | ||
font-weight: 100; | ||
color: var(--gray-white); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use variable names that describe the function of the color and not the color itself. This will help with adding a Dark Mode feature.
- For example
--search-button-bg
is much better than--light-blue
src/style/app.module.css
Outdated
} | ||
|
||
.deco { | ||
border: 1px solid var(--grey-border); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use variable names that describe the function of the color and not the color itself. This will help with adding a Dark Mode feature.
- For example
--search-button-bg
is much better than--light-blue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (2)
src/style/app.module.css (2)
Line range hint
44-87
: Improve color variable system for better maintainability and dark mode support.While some variables have been renamed to be more semantic (e.g.,
--text-primary-color
), many still use color names instead of their functional purpose. This makes dark mode implementation difficult.Reorganize color variables using semantic names that describe their function:
- --grey-light: #eaebef; - --grey-dark: #707070; + --surface-secondary: #eaebef; + --text-muted: #707070; - --blue-primary: #0056b3; - --blue-subtle: #7c9beb; + --brand-primary: #0056b3; + --brand-secondary: #7c9beb; - --light-blue-color: #286fe0; - --dimp-white: #b5b5b5; + --action-primary: #286fe0; + --border-muted: #b5b5b5; - --text-highlight-color:#febc59; + --text-emphasis: #febc59;Group related colors together and add comments explaining their usage:
:root { /* Brand Colors */ --brand-primary: #0056b3; --brand-secondary: #7c9beb; /* Text Colors */ --text-primary: #000000; --text-secondary: #808080; --text-emphasis: #febc59; /* Surface Colors */ --surface-primary: #ffffff; --surface-secondary: #eaebef; /* Action Colors */ --action-primary: #286fe0; --action-hover: #1e4e8c; /* Border Colors */ --border-primary: #e8e5e5; --border-muted: #b5b5b5; }This will make it easier to:
- Implement dark mode by swapping color values
- Maintain consistent UI colors
- Understand the purpose of each color variable
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. Run Prettier with --write to fix formatting issues.
Line range hint
1-43
: Improve CSS organization and documentation for better maintainability.While consolidating styles into a global file is good, the current organization can be improved:
- Enhance the documentation header:
/** * Global Styles for Talawa Admin * * This file contains all global styles and CSS custom properties. * It is organized into the following sections: * * 1. Custom Properties * - Brand Colors * - Text Colors * - Surface Colors * - Spacing * - Typography * - Breakpoints * * 2. Base Styles * 3. Layout * 4. Components * 5. Utilities * 6. Media Queries */
- Add a spacing scale using CSS custom properties:
:root { /* Spacing Scale */ --space-xs: 0.25rem; /* 4px */ --space-sm: 0.5rem; /* 8px */ --space-md: 1rem; /* 16px */ --space-lg: 1.5rem; /* 24px */ --space-xl: 2rem; /* 32px */ }
- Centralize breakpoints and media queries:
:root { /* Breakpoints */ --breakpoint-sm: 576px; --breakpoint-md: 768px; --breakpoint-lg: 992px; --breakpoint-xl: 1200px; } /* Use at end of file */ @media (max-width: var(--breakpoint-sm)) { /* Small screen styles */ } @media (max-width: var(--breakpoint-md)) { /* Medium screen styles */ }
- Group related styles using comments:
/* Layout ========================================================================== */ /* Components ========================================================================== */ /* Utilities ========================================================================== */This organization will:
- Make the codebase more maintainable
- Reduce duplication
- Make it easier to find and modify styles
- Provide better documentation for developers
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. Run Prettier with --write to fix formatting issues.
🧹 Nitpick comments (1)
src/style/app.module.css (1)
Line range hint
1-7313
: Fix code formatting issues.The pipeline reports Prettier formatting issues. Run Prettier with the --write flag to automatically fix formatting:
prettier --write src/style/app.module.css🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. Run Prettier with --write to fix formatting issues.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/style/app.module.css
(73 hunks)
🧰 Additional context used
🪛 GitHub Actions: PR Workflow
src/style/app.module.css
[warning] Code style issues found. Run Prettier with --write to fix formatting issues.
.alignimg { | ||
border-radius: 50%; | ||
background-color: var(--icon-bg-color); | ||
background-blend-mode: darken; | ||
height: clamp(50px, 4vw, 65px); | ||
width: clamp(50px, 4vw, 65px); | ||
object-fit: cover; | ||
} | ||
|
||
.box { | ||
color: var(--text-highlight-color); | ||
} | ||
.first_box { | ||
display: flex; | ||
flex-direction: row; | ||
padding-bottom: 10px; | ||
padding-top: 10px; | ||
} | ||
|
||
.second_box { | ||
padding-left: 20px; | ||
padding-top: 10px; | ||
} | ||
|
||
.second_box > h4 { | ||
font-size: 10px; | ||
font-weight: bold; | ||
text-decoration: none; | ||
color: var(--text-primary-color); | ||
} | ||
|
||
.second_box > h5 { | ||
text-decoration: none; | ||
font-size: 10px; | ||
font-weight: 100; | ||
color: var(--text-secondary-color); | ||
} | ||
|
||
.deco { | ||
border: 1px solid var(--border-color); | ||
width: 100%; | ||
max-width: 800px; | ||
height: 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Improve OrganizationCard styles for better maintainability and accessibility.
The migrated styles have several areas for improvement:
- Use semantic class names that reflect component purpose:
-.box {
+.organizationHighlight {
color: var(--text-highlight-color);
}
-.first_box {
+.organizationHeader {
display: flex;
flex-direction: row;
padding: 10px 0;
}
-.second_box {
+.organizationDetails {
padding-left: 20px;
padding-top: 10px;
}
- Replace fixed font sizes with relative units for better accessibility:
-.second_box > h4 {
- font-size: 10px;
+.organizationDetails > h4 {
+ font-size: 0.875rem;
font-weight: bold;
}
-.second_box > h5 {
- font-size: 10px;
+.organizationDetails > h5 {
+ font-size: 0.875rem;
font-weight: 100;
}
- Add responsive design considerations:
@media (max-width: 768px) {
.organizationHeader {
flex-direction: column;
}
.organizationDetails {
padding-left: 0;
padding-top: 15px;
}
}
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. Run Prettier with --write to fix formatting issues.
this is not yet completed . |
i kept a new pr #3406 |
Thanks for submitting your PR, but we must close it.
Please resubmit when you are ready. |
What kind of change does this PR introduce?
UI/UX improvement, refactoring of CSS for better accessibility and maintainability.
Issue Number:
Fixes #3318
Snapshots/Videos:
If relevant, did you update the documentation?
N/A - This PR does not introduce new functionality requiring updates to Talawa-Docs.
Summary
This PR addresses the issue by:
src/style/app.module.css
.Does this PR introduce a breaking change?
No, this PR does not introduce breaking changes. It only refactors styles and updates UI components for consistency and accessibility.
Checklist
UI/UX Improvements
src/style/app.module.css
.src/style/app.module.css
.--search-button-bg
instead of--light-blue
).CodeRabbit AI Review
Test Coverage
Additional Information
src/style/app.module.css
, removing redundancy and improving maintainability.Have you read the contributing guide?
Yes
Summary by CodeRabbit