summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorJake Leahy <jake@leahy.dev>2024-09-09 17:42:45 +1000
committerGitHub <noreply@github.com>2024-09-09 09:42:45 +0200
commit6a5aa007010f90141199f3a4eb14ab85105ddac7 (patch)
treee03d6f08d7824a9752c2e8293cfffbf91e5ef6ac /doc
parent79a65da22a56eaeafce24b7c08c9d7db017173ac (diff)
downloadNim-6a5aa007010f90141199f3a4eb14ab85105ddac7.tar.gz
Fix CSS for `number-lines` code blocks (#24081)
Adds a few fixes for when using code blocks with lines numbered

- Use CSS variables for the colours so that it works in dark mode
- Don't turn on normal table effects like hover and smaller font when
its a line number table
- With dochack.nim, don't add a clipboard copy button for the line
numbers at the side

[Example page showing the
changes](https://66dcde6e4a655efb70771d9a--dazzling-kitten-6c3419.netlify.app/)
Diffstat (limited to 'doc')
-rw-r--r--doc/nimdoc.css9
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/nimdoc.css b/doc/nimdoc.css
index a9e4ac9c6..0c399e4c1 100644
--- a/doc/nimdoc.css
+++ b/doc/nimdoc.css
@@ -623,8 +623,8 @@ pre {
 

 table.line-nums-table {

   border-radius: 4px;

-  border: 1px solid #cccccc;

-  background-color: ghostwhite;

+  border: 1px solid var(--border);

+  background-color: var(--secondary-background);

   border-collapse: separate;

   margin-top: 15px;

   margin-bottom: 25px; }

@@ -660,6 +660,9 @@ table {
   border-collapse: collapse;

   border-color: var(--third-background);

   border-spacing: 0;

+}

+

+table:not(.line-nums-table) {

   font-size: 0.9em;

 }

 

@@ -678,7 +681,7 @@ table th.docinfo-name {
   text-align: right;

 }

 

-table tr:hover {

+table:not(.line-nums-table) tr:hover {

   background-color: var(--third-background); }

 

 

177'>177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229