AiStudio Chat 主题优化

优化了AiStudio Chat板块的主题,使它不那么刺眼

目前为 2025-03-27 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name AiStudio Chat 主题优化
  3. // @namespace http://120.46.24.57/
  4. // @version 0.4
  5. // @description 优化了AiStudio Chat板块的主题,使它不那么刺眼
  6. // @author ChenMo
  7. // @match https://aistudio.google.com/*
  8. // @grant GM_addStyle
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // CSS 样式
  16. const customCSS = `
  17. body.dark-theme {
  18. & .chat-turn-container .inline-code {
  19. color: #ffec99;
  20. background-color: rgba(255, 249, 219, 0.1);
  21. }
  22.  
  23. /* 针对所有支持的浏览器 */
  24. & .chat-turn-container ::selection {
  25. background-color: #495057;
  26. }
  27.  
  28. & .chat-turn-container.render.user .user-prompt-container .turn-content .text-chunk {
  29. background-color: #343a40;
  30. color: #efefef
  31. }
  32. }
  33.  
  34. body.light-theme {
  35. & .chat-turn-container .inline-code {
  36. color: #e67700;
  37. background-color: rgba(255, 249, 219, 0.9);
  38. }
  39.  
  40. /* 针对所有支持的浏览器 */
  41. & .chat-turn-container ::selection {
  42. background-color: #a5d8ff;
  43. }
  44.  
  45. & .chat-turn-container.render.user .user-prompt-container .turn-content .text-chunk {
  46. background-color: #343a40;
  47. color: #efefef
  48. }
  49. }
  50.  
  51. .chat-turn-container .ng-star-inserted {
  52. font-family: "Arial", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Helvetica, sans-serif;
  53. }
  54.  
  55. .chat-turn-container span.ng-star-inserted {
  56. font-size: 1.15rem;
  57. line-height: 1.7;
  58. }
  59.  
  60. .chat-turn-container code,
  61. .chat-turn-container .inline-code {
  62. font-family: "Fira Code", "Consolas" !important;
  63. }
  64.  
  65. .chat-turn-container code {
  66. font-size: 1rem;
  67. }
  68. `;
  69.  
  70. // 使用 GM_addStyle 函数注入 CSS
  71. GM_addStyle(customCSS);
  72.  
  73. // (可选) 在控制台输出一条消息确认脚本已运行
  74. console.log('AiStudio Dark Optmized 样式已应用。');
  75.  
  76. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址