WorkFlowyの空行のバレットを見えなくする
Stylusなどを用いてCSSを上書きする
以下のどちらかを採用する
code:answer.css
div.name:has(div.content:empty) a._rs4r54 {
color: white; /* 薄い灰色のカラーコード */
}
div.name:not(:has(span.innerContentContainer)) a._rs4r54 {
color: white; /* 薄い灰色のカラーコード */
}
CSSを上書きした状態
https://gyazo.com/504c7c1c9ebeff21be613243e5d3dbf0
参考情報
中身のテキストがある行と無い行のHTML
code:hav.html
<div tabindex="-1" class="name _1xuo0li _3hmsj"><a href="/#/152aaa96ed06" data-handbook="bullet.handle" class="bullet _rs4r54"><svg width="100%" height="100%" viewBox="0 0 18 18" fill="currentColor" class="zoomBulletIcon _uhlm2"><circle cx="9" cy="9" r="3.5"></circle></svg></a><div class="content _1wsppdf _6pmpme data-hj-suppress" contenteditable="true"><span class="innerContentContainer">質という言葉</span></div><div style="margin-left: 0px;" class="nameButtons "></div><a class="expand _1eg9dij" data-handbook="expand.toggle"><div class=" _3hmsj"><svg width="20" height="20" viewBox="0 0 20 20" class=" _64tdz9"><path d="M13.75 9.56879C14.0833 9.76124 14.0833 10.2424 13.75 10.4348L8.5 13.4659C8.16667 13.6584 7.75 13.4178 7.75 13.0329L7.75 6.97072C7.75 6.58582 8.16667 6.34525 8.5 6.5377L13.75 9.56879Z" stroke="none" fill="currentColor"></path></svg></div></a></div>
code:nohav.html
<div tabindex="-1" class="name _1xuo0li empty _3hmsj"><a href="/#/4a5476e26e96" data-handbook="bullet.handle" class="bullet _rs4r54"><svg width="100%" height="100%" viewBox="0 0 18 18" fill="currentColor" class="zoomBulletIcon _uhlm2"><circle cx="9" cy="9" r="3.5"></circle></svg></a><div class="content _1wsppdf _6pmpme data-hj-suppress" contenteditable="true"></div><div style="margin-left: 0px;" class="nameButtons "></div><a class="expand _1eg9dij" data-handbook="expand.toggle"></a></div>
文のデータは<span class="innerContentContainer">が持っている。この有無が切り分けの条件になる
Gemininに上のhtmlをそのまま投げて、やりたいことを訊いてみる
code:質問.txt
片方のdiv.nameは内側にspan.innerContentContainerを持っており、もう片方は持っていません。このとき、持っていない方のdiv.nameの中にあるaタグの色を変えたいと思っています。具体的には、aタグに付与されている _rs4r54 で指定するカラーの色を薄めの灰色にしたいと考えています。
もう一度確認します。span.innerContentContainerを持っているdivの中のaはそのままで、それを持っていないdivの中にあるaのカラーを変えるという条件のCSSの書き方を教えてください。
帰ってきた答えをアレンジしたもの。
from 2025/3/22