[clang] [clang][dataflow] Show triangle in `<details>` element. (PR #67431)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 28 00:48:45 PDT 2023


================
@@ -122,10 +122,22 @@ code.line:has(.bb-select):before {
   font-size: x-small;
   flex-grow: 1;
 }
-.value summary {
+.value > summary {
   background-color: #ace;
   display: flex;
   justify-content: space-between;
+  cursor: pointer;
+}
+.value > summary::before {
+  content: '►';
+  margin-right: 0.5em;
+  font-size: 0.9em;
+}
+.value[open] > summary::before {
+  content: '▼';
+}
+.value > summary > .location {
----------------
martinboehme wrote:

True, it doesn't solve a problem ("space" would work just as well), but as the `.location` is always a direct child of the `<summary>`, it seemed more specific to do it this way.

Is "descendant", rather than "child", considered to be the default in CSS? The former is syntactically shorter, but "child" is arguably the simpler concept. Or is "child" problematic because it makes the CSS more brittle (i.e. less resilient in the fact of changes to the HTML)?

https://github.com/llvm/llvm-project/pull/67431


More information about the cfe-commits mailing list