Skip to content
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

[功能]: 选中文字后的高亮显示背景颜色换成其他颜色 #610

Closed
mooerccx opened this issue Jan 1, 2025 · 3 comments
Closed
Assignees

Comments

@mooerccx
Copy link

mooerccx commented Jan 1, 2025

您的功能建议是否与某个问题相关?

选中文字的时候一般都是蓝色的背景,比较刺眼

请描述您希望实现的解决方案

希望能够像lobechat那样,选中文字的高亮色是橙黄色#ffef5c,类似这样的 :
image

(function() {
    'use strict';

    // 创建样式元素
    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = `
        ::selection {
            background-color: #ffef5c !important;
            color: black !important;
        }
        /* 对支持 ::-moz-selection 的 Firefox 浏览器 */
        ::-moz-selection {
            background-color: #ffef5c !important;
            color: black !important;
        }
    `;

    // 将样式添加到 <head> 标签中
    document.head.appendChild(style);
})();

请描述您考虑过的其他方案

No response

其他补充信息

No response

@mooerccx
Copy link
Author

mooerccx commented Jan 1, 2025

我认为这样能够在一定程度上缓解大家的眼睛疲劳的问题

@kangfenmao
Copy link
Collaborator

自己设置就好了

image

@mooerccx
Copy link
Author

mooerccx commented Jan 2, 2025

多谢,之前没有看到自定义css,

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

No branches or pull requests

2 participants