Skip to content

feat(scrollbar): replace TODO colors with React-defined tokens#33705

Closed
kamja44 wants to merge 2 commits intofacebook:mainfrom
kamja44:feat/vertical-scrollbar-color-update
Closed

feat(scrollbar): replace TODO colors with React-defined tokens#33705
kamja44 wants to merge 2 commits intofacebook:mainfrom
kamja44:feat/vertical-scrollbar-color-update

Conversation

@kamja44
Copy link

@kamja44 kamja44 commented Jul 5, 2025

Replaced placeholder colors in VerticalScrollBarView.js and constants.js with standardized React-defined colors, resolving the inline TODO comment.

Note: REACT_RESIZE_BAR_BORDER's SCROLL_BORDER is not defined in constants, so it was intentionally left unchanged.

Summary

This is one of my first contributions to open source.
I'm starting with small cleanup tasks like addressing // TODO comments to get more familiar with the codebase and contribution process.
I'm looking forward to contributing more over time 🙂

This change resolves several TODO comments related to placeholder scrollbar colors in VerticalScrollBarView.js.

Previously, the scrollbar background (REACT_RESIZE_BAR) and thumb (SCROLL_CARET) were using temporary color values that were not aligned with the React theme system. Although these values were defined in the COLORS object, they lacked corresponding CSS variables and were therefore rendered with incorrect or fallback colors.

To address this:

  • Added two new color tokens to the COLORS object: SCROLL_TRACK and SCROLL_THUMB
  • Updated updateColorsToMatchTheme() to read their values from --color-scroll-track and --color-scroll-thumb
  • Replaced the usage of REACT_RESIZE_BAR and SCROLL_CARET in the draw() method with the new SCROLL_TRACK and SCROLL_THUMB entries

The REACT_RESIZE_BAR_BORDER color was intentionally left unchanged, as there is no corresponding CSS variable defined for it.

As a result, the scrollbar visuals are now fully integrated with the theme system. Colors are dynamically resolved from CSS variables, removing the need for hardcoded placeholder values and improving maintainability and theming consistency.

How did you test this change?

  • Verified that all relevant colors are correctly populated via updateColorsToMatchTheme()
  • Manually tested scrollbar rendering under both light and dark themes
  • Confirmed that the following all pass:
    • yarn test
    • yarn lint
    • yarn flow dom-node
    • yarn build

Replaced placeholder colors in VerticalScrollBarView.js and constants.js
with standardized React-defined colors, resolving the inline TODO comment.

Note: REACT_RESIZE_BAR_BORDER's SCROLL_BORDER is not defined in constants,
so it was intentionally left unchanged.
@facebook-github-bot
Copy link
Contributor

Hi @kamja44!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@github-actions
Copy link

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Oct 22, 2025
@github-actions
Copy link

Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

@github-actions github-actions bot closed this Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Resolution: Stale Automatically closed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants