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

Wrong background color for selected text #770

Open
3 tasks done
dokurorz opened this issue Mar 3, 2024 · 2 comments
Open
3 tasks done

Wrong background color for selected text #770

dokurorz opened this issue Mar 3, 2024 · 2 comments
Labels
Bug Something isn't working

Comments

@dokurorz
Copy link

dokurorz commented Mar 3, 2024

Issue Checklist

Expected behavior

By modifying /source/css/_variables/base.styl, the blue color looks reasonable.
blue

Actual behavior

The default selection-bg is blue-deep #262a30 , but it is indistinguishable in dark-theme code blocks.
blue-deep

Steps to reproduce the behavior

none

Node.js and NPM Information

v16.20.2
8.19.4

Package dependencies Information

├── hexo-deployer-sftp@0.4.1
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-tag@2.0.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-marked@6.2.0
├── hexo-renderer-stylus@3.0.1
├── hexo-server@3.0.0
├── hexo-theme-landscape@1.0.0
└── hexo@7.1.1

Hexo Configuration

syntax_highlighter: highlight.js
highlight:
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false

NexT Configuration

codeblock:
  theme:
    light: a11y-dark
    dark: a11y-dark

Other Information

Changing the color of selection-bg is simple, but replacing the default color with a color of better contrast would be more user-friendly.

@dokurorz dokurorz added the Bug Something isn't working label Mar 3, 2024
Copy link

welcome bot commented Mar 3, 2024

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@shenbo
Copy link

shenbo commented Apr 15, 2024

Same.
In the source code ('\hexo-source\node_modules\hexo-theme-next\source\css_variables\base.styl'), the default $selection-bg is defined as $blue-deep, #262a30;

$blue-deep          = #262a30;
$selection-bg       = $blue-deep;

it's hard to indistinguish in dark-theme.


my solution: redefine the $selection-bg variable.

  1. in the next theme config file: _config.next.yml, add:
custom_file_path:
  variable: variables.styl
  1. creat variables.styl file in the blog root folder, add:
$selection-bg = #0066ff
  1. hexo clean and hexo g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants