Skip to content

[BUG]: Text selection styling is not working in portfolio #167

Description

@Gautam25Raj

Affected Apps / Packages

Portfolio (apps/portfolio)

Description

When selecting text on the portfolio website, the custom selection background color and text color do not show up. It defaults to the browser's default highlight color.

Metadata

  • Suggested Branch: fix/portfolio-selection-style
  • Suggested PR Title: [Fix] [Portfolio]: Resolve text selection styling in globals.css

Steps to Reproduce

  1. Go to any public portfolio page.
  2. Click and drag to select any text.
  3. Observe that the text highlights in the browser default style instead of the custom blue/white accent colors.

Expected Behavior

The selected text background should be var(--color-accent) (blue) and the text color should be var(--color-accent-ink) (white).

Environment Information

  • OS: All (Windows, macOS, Linux)
  • Browser: Chrome, Safari, Firefox

Relevant Logs

No response

Proposed Fix / Suggestions

Modify apps/portfolio/app/globals.css to add !important to the selection colors and add the universal selector:

::selection {
  background: var(--color-accent) !important;
  color: var(--color-accent-ink) !important;
}

*::selection {
  background: var(--color-accent) !important;
  color: var(--color-accent-ink) !important;
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions