-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
Refactoring CSS files: merged PageNotFound styles into global app.module.css #2536
Refactoring CSS files: merged PageNotFound styles into global app.module.css #2536
Conversation
WalkthroughThe changes in this pull request involve the removal of the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
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.
Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.
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)
578-603
: Use CSS variables for colors and consider layout constraints
- The hardcoded color value
#31bb6b
should use a CSS variable for consistency.- The very large font size (250px) might cause layout issues on some screens.
Consider these improvements:
+:root { + --color-primary: #31bb6b; + --heading-max-size: min(250px, 25vh); +} -.notfound h1.head { +.notFound h1.head { - font-size: 250px; + font-size: var(--heading-max-size); font-weight: 900; - color: #31bb6b; + color: var(--color-primary); letter-spacing: 25px; margin: 10px 0 0 0; }
605-667
: Optimize media queries for better maintainability
- Consider using CSS variables for breakpoints
- Some media queries could be combined to reduce code duplication
- Font sizes between 640px and 768px breakpoints are identical
Consider this optimization:
+:root { + --breakpoint-xl: 1024px; + --breakpoint-lg: 768px; + --breakpoint-md: 480px; + --breakpoint-sm: 320px; +} -@media (max-width: 1024px) { +@media (max-width: var(--breakpoint-xl)) { /* ... */ } -@media (max-width: 768px) { +@media (max-width: var(--breakpoint-lg)) { /* ... */ } -@media (max-width: 640px) { /* Remove this duplicate breakpoint */ - .notfound h1.head { - font-size: 150px; - letter-spacing: 0; - } -} -@media (max-width: 480px) { +@media (max-width: var(--breakpoint-md)) { /* ... */ } -@media (max-width: 320px) { +@media (max-width: var(--breakpoint-sm)) { /* ... */ }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
src/screens/PageNotFound/PageNotFound.module.css
(0 hunks)src/screens/PageNotFound/PageNotFound.tsx
(1 hunks)src/style/app.module.css
(1 hunks)
💤 Files with no reviewable changes (1)
- src/screens/PageNotFound/PageNotFound.module.css
✅ Files skipped from review due to trivial changes (1)
- src/screens/PageNotFound/PageNotFound.tsx
🔇 Additional comments (1)
src/style/app.module.css (1)
559-667
: Changes align with PR objectives
The PageNotFound styles have been successfully merged into the global CSS file, meeting the primary objective of the PR. While there are opportunities for improvement in terms of CSS best practices, the core functionality remains intact.
.notfound h3 { | ||
font-family: 'Roboto', sans-serif; | ||
font-weight: normal; | ||
letter-spacing: 1px; | ||
} | ||
|
||
.notfound .brand span { | ||
margin-top: 50px; | ||
font-size: 40px; | ||
} | ||
.notfound .brand h3 { | ||
font-weight: 300; | ||
margin: 10px 0 0 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
Use CSS variables for typography values
Consider using CSS variables for typography-related values to maintain consistency and make future updates easier. This includes font families, sizes, and weights.
Example refactor:
+:root {
+ --font-family-primary: 'Roboto', sans-serif;
+ --font-size-large: 40px;
+ --font-weight-normal: 300;
+ --letter-spacing-base: 1px;
+}
-.notfound h3 {
+.notFound h3 {
- font-family: 'Roboto', sans-serif;
+ font-family: var(--font-family-primary);
font-weight: normal;
- letter-spacing: 1px;
+ letter-spacing: var(--letter-spacing-base);
}
-.notfound .brand span {
+.notFound .brand span {
margin-top: 50px;
- font-size: 40px;
+ font-size: var(--font-size-large);
}
Committable suggestion skipped: line range outside the PR's diff.
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.
that notFound class is for component for NotFound and the class which I edited is for PageNotFound page, should I rename class to pageNotFound?
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.
@mandeepnh5, thank you for the clarification. Renaming the class to pageNotFound
would be a good idea to reflect that it's specific to the PageNotFound
page. This would help avoid confusion with the NotFound
component and improve code readability.
🐰🤔
✏️ Learnings added
Learnt from: mandeepnh5
PR: PalisadoesFoundation/talawa-admin#2536
File: src/style/app.module.css:564-577
Timestamp: 2024-12-01T10:46:49.617Z
Learning: The `notFound` class is used in the `NotFound` component, whereas the `PageNotFound` page has its own styles. It's important to distinguish between them to avoid confusion.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
Please submit your PRs against our |
What kind of change does this PR introduce?
Refactoring CSS files: merged PageNotFound styles into global app.module.css
Issue Number:
Fixes #2524
Did you add tests for your changes?
Yes
Summary
It is my first PR on Palisadoes Foundation and I am looking forward to contribute more to this organization.
This PR solves the problem of having a single global CSS file instead of having many CSS files in sub directories.
Does this PR introduce a breaking change?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit
PageNotFound
component to ensure correct styling is applied.