Skip to content

Conversation

@TCOTC
Copy link
Contributor

@TCOTC TCOTC commented Aug 16, 2025

01

Close #15604

例如使用以下 CSS 片段,在明亮主题给选中文本设置特定背景色时,同时应用特定的文本颜色:

.protyle-wysiwyg [data-node-id] span[style*="background-color: var(--b3-font-background13)"],
.color__square[style*="--b3-font-background13"] {
  background-color: rgb(0 0 0);
  color: var(--b3-color-text, rgb(249 255 0));
}

原本只能知道会设置成什么背景颜色:

image

现在能同时知道背景颜色和文本颜色:

image

同时也与移动端保持一致:

<span class="keyboard__slash-icon" ${item ? `style="background-color:${item}"` : ""}>A</span>

f83e4654475089411c0f3dd89cbc7a75

02

给一些元素添加 data-id 属性,便于主题样式定位元素

03

有时候要设置了背景色之后才发现跟文本的颜色对比度不太够,然后重新设置。

实现了动态显示选中文本的颜色,方便判断设置背景色之后的真实效果:

video.webm

p.s. 设置文本颜色的那部分按钮需不需要也实现动态的背景色?

@TCOTC TCOTC marked this pull request as ready for review August 16, 2025 16:02
@88250 88250 assigned Vanessa219 and unassigned Vanessa219 Aug 18, 2025
@88250 88250 requested a review from Vanessa219 October 2, 2025 08:49
@88250 88250 added this to the 3.3.5 milestone Oct 2, 2025
@88250 88250 modified the milestones: 3.3.5, 3.3.6 Oct 14, 2025
@Vanessa219
Copy link
Member

notion 是这样的。如果改成都有文字的话太过于花哨,界面不够美观。

QQ_1760929142878

@TCOTC
Copy link
Contributor Author

TCOTC commented Oct 20, 2025

@88250 移除 milestone

@TCOTC TCOTC deleted the feat/font-color branch October 20, 2025 07:19
@88250 88250 removed this from the 3.3.6 milestone Oct 20, 2025
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

Successfully merging this pull request may close these issues.

3 participants