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

背景图实现暗黑模式 #209

Open
smileyby opened this issue Jan 18, 2022 · 1 comment
Open

背景图实现暗黑模式 #209

smileyby opened this issue Jan 18, 2022 · 1 comment
Labels
CSS 🌚 CSS相关

Comments

@smileyby
Copy link
Owner

smileyby commented Jan 18, 2022

https://tonsky.me/blog/swiftui/
实现原理:

  1. 暗黑模式下:文字整体变黑,背景颜色变黑
  2. 通过 设置 background-image 和 background-position 来调解般透明图的位置,来显示内容(需要注意禁用文本选择,不然文字选中后页面会出现蓝色选中背景色)
  3. 思路新颖,学到了
@smileyby smileyby added the CSS 🌚 CSS相关 label Jan 18, 2022
@smileyby
Copy link
Owner Author

smileyby commented Jan 19, 2022

在线体验

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS 🌚 CSS相关
Projects
None yet
Development

No branches or pull requests

1 participant