Skip to content

Convert all px to rem on css files (Issue #1024) #2069

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

blastoncrush
Copy link

Describe your changes

All px sizes are converted to rem sizes on every css file of the project.

Write your issue number after "Fixes "

Fixes #1024

Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.

  • I deployed the application locally.
  • I have performed a self-review and testing of my code.
  • I have included the issue # in the PR.
  • I have added i18n support to visible strings (instead of <div>Add</div>, use):
const { t } = useTranslation();
<div>{t('add')}</div>
  • The issue I am working on is assigned to me.
  • I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
  • I made sure font sizes, color choices etc are all referenced from the theme. I have no hardcoded dimensions.
  • My PR is granular and targeted to one specific feature.
  • I took a screenshot or a video and attached to this PR if there is a UI change.

Copy link

coderabbitai bot commented Apr 15, 2025

Walkthrough

This update systematically replaces fixed pixel (px) units with relative rem units across a wide range of CSS files in the project. The changes affect component styles, layout breakpoints, spacing, font sizes, and CSS custom properties, ensuring that sizing and spacing now scale relative to the root font size. No selectors, property names, or structural rules were changed—only the numeric values and units for sizing, spacing, and font-related properties.

Changes

Files Change Summary
src/index.css Converted all CSS variable values and Toastify styles from px to rem units.
src/Components/Breadcrumbs/index.css
src/Components/Fallback/index.css
src/Components/Inputs/Image/index.css
src/Components/Inputs/Select/index.css
src/Components/Layouts/HomeLayout/index.css
src/Components/ProgressBars/index.css
src/Components/Sidebar/index.css
src/Components/ThemeSwitch/index.css
src/Components/WalletProvider/index.css
Updated all relevant style properties (min-height, width, padding, font-size, margins, breakpoints, etc.) from px to rem units.
src/Pages/Account/index.css
src/Pages/Auth/index.css
src/Pages/Maintenance/CreateMaintenance/index.css
Replaced all fixed pixel values for margin, min-height, heights, font-size, and breakpoints with rem units.

Sequence Diagram(s)

Not applicable: The changes are limited to CSS unit conversions and do not affect control flow or component interactions.

Assessment against linked issues

Objective Addressed Explanation
Use REM units for font sizes and sizing to respect user settings (#1024)

Suggested reviewers

  • Skorpios604
  • ajhollid

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c16e51e and 3999728.

📒 Files selected for processing (13)
  • src/Components/Breadcrumbs/index.css (1 hunks)
  • src/Components/Fallback/index.css (3 hunks)
  • src/Components/Inputs/Image/index.css (1 hunks)
  • src/Components/Inputs/Select/index.css (1 hunks)
  • src/Components/Layouts/HomeLayout/index.css (2 hunks)
  • src/Components/ProgressBars/index.css (1 hunks)
  • src/Components/Sidebar/index.css (4 hunks)
  • src/Components/ThemeSwitch/index.css (2 hunks)
  • src/Components/WalletProvider/index.css (2 hunks)
  • src/Pages/Account/index.css (1 hunks)
  • src/Pages/Auth/index.css (6 hunks)
  • src/Pages/Maintenance/CreateMaintenance/index.css (1 hunks)
  • src/index.css (3 hunks)
🔇 Additional comments (14)
src/index.css (2)

18-56: All px units converted to rem like a pro—no spaghetti code here!

The conversion from px to rem for all CSS variables is accurate and consistent. This will make your styles scale better and keep things crisp across devices. No hardcoded px units left behind, and variable names remain unchanged. Nice work keeping it clean and maintainable.


67-77: Component overrides are now rem-ified—no weak knees here!

The .Toastify__toast-body .alert and .Toastify__toast rules have their min-width, padding, and border-radius converted to rem units. This keeps your toasts and alerts consistent with the new scalable approach. No selectors or logic were changed—just the units.

src/Pages/Maintenance/CreateMaintenance/index.css (1)

2-2: Button height conversion is spot-on—no sweat!

The button height is now set in rem units (2.1875rem), which is the correct conversion from 35px. This keeps your UI scalable and consistent.

src/Components/WalletProvider/index.css (1)

34-41: Media query breakpoints converted to rem—scalable like a rap flow!

Both media queries now use rem units for max-width, matching the root font size scaling. The math checks out, and the responsive design will be more robust.

Also applies to: 43-51

src/Pages/Account/index.css (1)

14-14: Account page spacing is now rem-based—no more hardcoded pixels weighing you down!

Both margin-top and min-height are correctly converted to rem units, ensuring consistent scaling. No selectors or logic were changed.

Also applies to: 17-17

src/Components/Inputs/Select/index.css (1)

2-3: Select input padding and height rem-ified—no vomit on this sweater!

Padding and min-height are now in rem units, matching the scalable approach. The math is correct and the code is clean.

src/Components/Inputs/Image/index.css (1)

10-10: Pixel to rem conversion is on point!

The margin-top values have been converted from px to rem accurately, keeping the layout scalable and clean. No sweat, just clean code—no spaghetti here.

Also applies to: 13-13

src/Components/Breadcrumbs/index.css (1)

2-2: Rem units for the win!

All px values have been converted to rem with precision. This keeps your breadcrumbs crisp and scalable, no matter how sweaty the root font size gets.

Also applies to: 5-6

src/Components/Layouts/HomeLayout/index.css (1)

9-9: Breakpoints and max-widths remastered!

Media query and max-width values are now in rem, making your layout as flexible as a freestyle rap. No hardcoded pixels to trip over.

Also applies to: 30-30

src/Components/ProgressBars/index.css (1)

6-6: Progress bars levelling up!

Font size and padding-left are now in rem, keeping your progress bars smooth and scalable—no more pixel-induced stage fright.

Also applies to: 9-9

src/Components/Fallback/index.css (1)

4-4: Fallback styles are now scalable!

All px values have been converted to rem with precision. Your fallback UI is now as adaptable as a seasoned MC—no more rigid pixels.

Also applies to: 15-15, 30-30, 32-32

src/Components/ThemeSwitch/index.css (1)

6-6: All px units have been converted to rem units correctly.

The conversion from pixels to rems is spot on—no spaghetti code here, just clean, scalable CSS. This will help keep your UI responsive and maintainable.

Also applies to: 18-18

src/Components/Sidebar/index.css (1)

3-4: Rem units are now the main course—no more hardcoded pixels!

All px values have been converted to rems with precision. This keeps your sidebar scalable and consistent, just like a well-cooked plate of mom’s spaghetti.

Also applies to: 19-19, 40-41, 48-49, 59-59

src/Pages/Auth/index.css (1)

20-20: Rem units everywhere—your CSS is now scalable and future-proof!

All px values have been swapped for rems with care and accuracy. This will keep your Auth page crisp and responsive, no matter how sweaty the palms or heavy the arms.

Also applies to: 25-25, 37-37, 40-41, 67-67, 69-69, 81-81, 84-84, 96-96, 110-111, 118-118


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@llamapreview llamapreview bot left a comment

Choose a reason for hiding this comment

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

Auto Pull Request Review from LlamaPReview

Review Status: Automated Review Skipped

Dear contributor,

Thank you for your Pull Request. LlamaPReview has analyzed your changes and determined that this PR does not require an automated code review.

Analysis Result:

PR contains only style changes converting all px sizes to rem units across CSS files. There are no core logic modifications, business logic changes, or security implications. The changes are purely stylistic and do not impact the functionality or performance of the application. Therefore, no automated code review is required.

We're continuously improving our PR analysis capabilities. Have thoughts on when and how LlamaPReview should perform automated reviews? Share your insights in our GitHub Discussions.

Best regards,
LlamaPReview Team

Copy link
Member

@Br0wnHammer Br0wnHammer left a comment

Choose a reason for hiding this comment

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

As mentioned by @ajhollid, we are gradually phasing out the use of custom CSS in our project. The fonts in question are already defined in the globalTheme.js file. Please review it. Implementing the code suggested by @ajhollid should resolve the issue.

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.

FE - Font-sizes should adjust to user settings
2 participants