|
309 | 309 | overflow: auto; |
310 | 310 | } |
311 | 311 |
|
| 312 | +.markdown-body .table-wrapper { |
| 313 | + position: relative; |
| 314 | + margin-bottom: 16px; |
| 315 | + |
| 316 | + .copy-table-button { |
| 317 | + position: absolute; |
| 318 | + top: 8px; |
| 319 | + right: 8px; |
| 320 | + width: 24px; |
| 321 | + height: 24px; |
| 322 | + background: rgba(0, 0, 0, 0.3); |
| 323 | + border: none; |
| 324 | + border-radius: 4px; |
| 325 | + cursor: pointer; |
| 326 | + opacity: 0; |
| 327 | + transition: |
| 328 | + opacity 0.2s ease, |
| 329 | + background-color 0.2s ease; |
| 330 | + z-index: 10; |
| 331 | + |
| 332 | + /* 复制图标 */ |
| 333 | + &::before { |
| 334 | + content: ''; |
| 335 | + position: absolute; |
| 336 | + top: 50%; |
| 337 | + left: 50%; |
| 338 | + transform: translate(-50%, -50%); |
| 339 | + width: 14px; |
| 340 | + height: 14px; |
| 341 | + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z'/%3E%3C/svg%3E"); |
| 342 | + background-repeat: no-repeat; |
| 343 | + background-position: center; |
| 344 | + background-size: contain; |
| 345 | + } |
| 346 | + |
| 347 | + &:active { |
| 348 | + background: rgba(0, 0, 0, 0.6); |
| 349 | + } |
| 350 | + |
| 351 | + /* 复制成功状态 */ |
| 352 | + &.copied { |
| 353 | + background: rgba(34, 197, 94, 0.8); |
| 354 | + opacity: 1; |
| 355 | + |
| 356 | + &::before { |
| 357 | + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z'/%3E%3C/svg%3E"); |
| 358 | + } |
| 359 | + } |
| 360 | + } |
| 361 | + |
| 362 | + &:hover .copy-table-button { |
| 363 | + opacity: 0.6; |
| 364 | + } |
| 365 | + |
| 366 | + .copy-table-button:hover { |
| 367 | + background: rgba(0, 0, 0, 0.5); |
| 368 | + opacity: 1; |
| 369 | + } |
| 370 | +} |
| 371 | + |
312 | 372 | .markdown-body td, |
313 | 373 | .markdown-body th { |
314 | 374 | padding: 0; |
|
1227 | 1287 | } |
1228 | 1288 | } |
1229 | 1289 | } |
| 1290 | + |
| 1291 | +.dark .markdown-body .table-wrapper .copy-table-button { |
| 1292 | + background: rgba(255, 255, 255, 0.15); |
| 1293 | + |
| 1294 | + &::before { |
| 1295 | + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z'/%3E%3C/svg%3E"); |
| 1296 | + } |
| 1297 | + |
| 1298 | + &:hover { |
| 1299 | + background: rgba(255, 255, 255, 0.25); |
| 1300 | + } |
| 1301 | + |
| 1302 | + &:active { |
| 1303 | + background: rgba(255, 255, 255, 0.35); |
| 1304 | + } |
| 1305 | + |
| 1306 | + &.copied { |
| 1307 | + background: rgba(34, 197, 94, 0.8); |
| 1308 | + |
| 1309 | + &::before { |
| 1310 | + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z'/%3E%3C/svg%3E"); |
| 1311 | + } |
| 1312 | + } |
| 1313 | +} |
0 commit comments