-
-
Notifications
You must be signed in to change notification settings - Fork 707
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
refactor-CSS files in src/screens/LoginPage (fixes #2509) #2656
refactor-CSS files in src/screens/LoginPage (fixes #2509) #2656
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe pull request involves the deletion of the Changes
Assessment against linked issues
Possibly related issues
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (15)
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
|
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
🧹 Outside diff range and nitpick comments (2)
src/style/app.module.css (2)
603-637
: LGTM! Consider adding CSS custom properties for better maintainability.The login page layout styles are well-structured and follow modern CSS practices. The use of flexbox for centering and alignment is appropriate.
Consider extracting commonly used values into CSS custom properties:
+:root { + --login-background-height: 100vh; + --logo-object-fit: contain; +} .login_background { - min-height: 100vh; + min-height: var(--login-background-height); } .communityLogo { - object-fit: contain; + object-fit: var(--logo-object-fit); }
Line range hint
753-861
: Consider optimizing media queries for better maintainability.The responsive design implementation is comprehensive but contains some duplicate properties across breakpoints. Consider using a mobile-first approach and consolidating shared styles.
Example of consolidating media queries:
+/* Base styles (mobile) */ +.row .right_portion { + padding: 1rem 1rem 0 1rem; +} +/* Tablet and up */ +@media (min-width: 768px) { + .row .right_portion { + padding: 1rem 2.5rem; + } +} -@media (max-width: 577px) { - .row .right_portion { - padding: 1rem 1rem 0 1rem; - } -}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/screens/LoginPage/LoginPage.module.css
(0 hunks)src/screens/LoginPage/LoginPage.tsx
(1 hunks)src/style/app.module.css
(3 hunks)
💤 Files with no reviewable changes (1)
- src/screens/LoginPage/LoginPage.module.css
🔇 Additional comments (3)
src/screens/LoginPage/LoginPage.tsx (3)
33-33
: LGTM! CSS module import change aligns with refactoring goal.
The import path change correctly reflects the migration of styles to the global app.module.css file.
Line range hint 603-603
: LGTM! Style references are consistently updated.
The migration of style references to the new CSS module is complete and consistent throughout the component.
Also applies to: 677-677, 690-690, 700-700, 711-711, 716-716, 722-722
Line range hint 44-44
: LGTM! Component logic remains intact during CSS refactoring.
The changes are properly scoped to CSS refactoring without affecting the component's logic or functionality.
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
🧹 Outside diff range and nitpick comments (2)
src/style/app.module.css (2)
652-657
: Consider using fixed positioning for language selector.The absolute positioning of the language change button might cause overlap issues with content in smaller viewports. Consider using
position: fixed
for consistent positioning across all screen sizes..row .right_portion .langChangeBtn { margin: 0; - position: absolute; + position: fixed; top: 1rem; left: 1rem; z-index: 1000; }
Line range hint
762-870
: Use CSS variables for breakpoint values.Define breakpoint values as CSS variables to maintain consistency and make updates easier across the codebase.
:root { + /* Breakpoints */ + --breakpoint-xs: 577px; + --breakpoint-sm: 769px; + --breakpoint-md: 992px; + --breakpoint-lg: 1020px; + --breakpoint-xl: 1120px; } -@media (max-width: 1120px) { +@media (max-width: var(--breakpoint-xl)) { /* ... */ } -@media (max-width: 992px) { +@media (max-width: var(--breakpoint-md)) { /* ... */ } -@media (max-width: 769px) { +@media (max-width: var(--breakpoint-sm)) { /* ... */ } -@media (max-width: 577px) { +@media (max-width: var(--breakpoint-xs)) { /* ... */ }
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 and nitpick comments (3)
src/style/app.module.css (3)
647-656
: Consider adding a max-height to prevent excessive scrolling.The
.right_portion
class usesmin-height: 100vh
which could lead to unnecessary scrolling on larger screens. Consider using a max-height constraint for better user experience..row .right_portion { min-height: 100vh; + max-height: 100vh; position: relative; overflow-y: scroll; display: flex; flex-direction: column; justify-content: center; padding: 1rem 2.5rem; background: var(--bs-white); }
684-691
: Add fallback styles for browsers that don't support animations.While the animations enhance the user experience, ensure graceful degradation for browsers that don't support them.
.row .right_portion .talawa_logo { + opacity: 1; height: 5rem; width: 5rem; display: block; margin: 1.5rem auto 1rem; -webkit-animation: zoomIn 0.3s ease-in-out; animation: zoomIn 0.3s ease-in-out; }
Also applies to: 926-978
865-889
: Use relative units for better responsive design.The media query for small screens uses fixed pixel values for padding and margins. Consider using relative units for better scaling.
@media (max-width: 577px) { .row .right_portion { - padding: 1rem 1rem 0 1rem; + padding: clamp(0.5rem, 2vw, 1rem); } .row .right_portion .langChangeBtn { position: absolute; - margin: 1rem; + margin: clamp(0.5rem, 2vw, 1rem); left: 0; top: 0; } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/style/app.module.css
(4 hunks)
🔇 Additional comments (4)
src/style/app.module.css (4)
658-669
: LGTM: Scrollbar styling follows modern best practices.
The scrollbar styling provides good visual feedback while maintaining aesthetics. The implementation uses proper vendor prefixes and maintains accessibility.
757-767
: Avoid using negative margins for spacing.
Using negative margins for spacing can lead to unpredictable layout behavior and maintenance issues. Consider using padding or flexbox gap properties instead.
845-853
: Prevent layout shifts during page load.
The drastic changes in logo size and positioning between breakpoints can cause Cumulative Layout Shift (CLS).
916-924
: LGTM: Proper implementation of reduced motion preferences.
The implementation correctly respects user preferences for reduced motion, which is essential for accessibility.
…8/refactor_LoginPage_css
…m/devender18/talawa-admin into devender18/refactor_LoginPage_css
What kind of change does this PR introduce?
Refactoring
Issue Number:
Fixes #2509
Did you add tests for your changes?
No
Snapshots/Videos:
If relevant, did you update the documentation?
Not relevant
Summary
The goal is to convert the CSS file in this subdirectory and all the components related to this screen to use this new design pattern.
Does this PR introduce a breaking change?
No
Other information
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Bug Fixes
Style