Search

Back

Copy Link

Library

/

Free

/

55

Color of Highlighted Text

55

Color of Highlighted Text

Not loading? Preview

Made by

@frameroverrides

override

select

Override

Color of Highlighted Text

Copy

Override

Copied to Clipboard!

Instructions

Apply to any text layer. Change line 4 of the code to your desired color.

Code Preview

import type { ComponentType } from "react"
import { createGlobalStyle } from "styled-components"

const HIGHLIGHT_COLOR = "#97E025" // change to your preferred color

const GlobalStyle = createGlobalStyle`
  *::selection {
    background: ${HIGHLIGHT_COLOR};
  }
  *::-moz-selection {
    background: ${HIGHLIGHT_COLOR};
  }
`

export function withHighlightColor(Component): ComponentType {
    return (props) => {
        return (
            <>
                <GlobalStyle />
                <Component {...props} />
            </>
        )
    }
}

Terms of Use for Free Assets

By accessing and using this Framer Override Library, you agree to the following terms:

All code snippets provided are available for your personal and professional use. This includes personal websites, client projects, and other website projects in Framer. You are strictly prohibited from sharing, redistributing, selling these code snippets, or creating derivative works for resale or distribution. Unauthorized sharing, distribution, or selling of these code snippets is a breach of these terms and may result in termination of your access to this library, along with potential legal action.