improvement(styling): consistent branded text-selection color app-wide by waleedlatif1 · Pull Request #5389 · simstudioai/sim · GitHub
Skip to content

improvement(styling): consistent branded text-selection color app-wide#5389

Merged
waleedlatif1 merged 2 commits into
stagingfrom
worktree-global-selection-color
Jul 3, 2026
Merged

improvement(styling): consistent branded text-selection color app-wide#5389
waleedlatif1 merged 2 commits into
stagingfrom
worktree-global-selection-color

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Adds one global ::selection rule (app/_styles/globals.css) using the existing --selection design token, so text-selection color is consistent everywhere instead of falling back to the browser/OS default.
  • No ::selection rule existed anywhere in the codebase before this — the perceived inconsistency between platform pages and the comparison pages was actually the browser dimming selection color on an unfocused window, not a real CSS difference. This makes the highlight color deliberate and stable regardless of window focus.

Type of Change

  • Style/UI improvement

Testing

Verified the CSS rule directly (light --selection: #1a5cf6, dark --selection: #4b83f7, both light-on-blue with white text for contrast). Could not get a full visual render in this environment due to a pre-existing, unrelated critters module gap (optimizeCss: true in next.config.ts with no critters package installed anywhere in the repo) — not introduced by this change.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…pp-wide

Previously no ::selection rule was defined anywhere, so text selection fell
back to the browser/OS default, which dims when a window loses focus and
made pages look inconsistent side by side. Adds one global rule using the
existing --selection token.
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@cursor

cursor Bot commented Jul 3, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
CSS-only presentation change with no logic, auth, or data impact; minor visual shift for selected links and struck-through text in the markdown editor.

Overview
Adds a global ::selection rule in globals.css using var(--selection) for the highlight and var(--white) for selected text, so selection color stays on-brand and does not depend on browser/OS defaults (including dimming when the window loses focus).

Removes rich-markdown-editor-only ::selection overrides on strikethrough (del/s) and links that forced selected text back to --text-primary; those elements now follow the same global branded selection styling as the rest of the app.

Reviewed by Cursor Bugbot for commit 2dd75c5. Configure here.

Comment thread apps/sim/app/_styles/globals.css
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a single global ::selection rule in globals.css using the existing --selection / --white design tokens, making the text-highlight color consistent and window-focus-independent across the whole app. It also cleans up two component-level ::selection overrides in the rich markdown editor that would have silently beaten the new global color: var(--white) due to higher specificity.

  • globals.css: Adds ::selection { background-color: var(--selection); color: var(--white); } inside @layer base, using already-defined light (#1a5cf6) and dark (#4b83f7) token values — both yield legible white-on-blue contrast.
  • rich-markdown-editor.css: Removes del/s::selection and a::selection overrides whose color: var(--text-primary) would have overridden the new global var(--white), breaking uniform selection appearance inside the editor.

Confidence Score: 5/5

Safe to merge — two CSS files with purely additive/subtractive styling changes, no logic or data affected.

Both changes are CSS-only: a single new ::selection rule backed by existing design tokens, and the removal of two component overrides that would have silently overridden the new global text color. The removals are deliberate and necessary — keeping them would have broken the uniform white text on selection inside the rich markdown editor. No regressions are introduced.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/_styles/globals.css Adds a single global ::selection rule using the --selection design token and var(--white), placed inside the @layer base block. Tokens and placement look correct.
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.css Removes two component-level ::selection overrides (del/s and a) that would have conflicted with the new global color: var(--white) rule, since their higher-specificity color: var(--text-primary) would have silently won over the global rule.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User selects text anywhere in the app"] --> B{"Is text inside\n.rich-markdown-prose?"}
    B -- No --> C["globals.css\n::selection\nbackground: var(--selection)\ncolor: var(--white)"]
    B -- Yes --> D{"Is it a del/s\nor a element?"}
    D -- "Yes (before PR)" --> E["rich-markdown-editor.css\ndel/a::selection\ncolor: var(--text-primary)\n⚠️ overrides global white"]
    D -- "Yes (after PR)" --> C
    D -- No --> C
    E -. "removed by this PR" .-> C
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["User selects text anywhere in the app"] --> B{"Is text inside\n.rich-markdown-prose?"}
    B -- No --> C["globals.css\n::selection\nbackground: var(--selection)\ncolor: var(--white)"]
    B -- Yes --> D{"Is it a del/s\nor a element?"}
    D -- "Yes (before PR)" --> E["rich-markdown-editor.css\ndel/a::selection\ncolor: var(--text-primary)\n⚠️ overrides global white"]
    D -- "Yes (after PR)" --> C
    D -- No --> C
    E -. "removed by this PR" .-> C
Loading

Reviews (2): Last reviewed commit: "fix(styling): resolve markdown-selection..." | Re-trigger Greptile

Comment thread apps/sim/app/_styles/globals.css
Comment thread apps/sim/app/_styles/globals.css Outdated
Remove the local link/strikethrough ::selection color overrides in
rich-markdown-editor.css now that the global ::selection rule already
forces uniform white text on every selection. Also swap the literal
#ffffff for the existing --white design token.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2dd75c5. Configure here.

@waleedlatif1 waleedlatif1 merged commit 03e0e07 into staging Jul 3, 2026
13 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-global-selection-color branch July 3, 2026 19:50
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.

1 participant