Character.ai Custom CSS

Apply custom CSS styles to character.ai

目前为 2024-08-29 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Character.ai Custom CSS
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Apply custom CSS styles to character.ai
  6. // @author Vishanka
  7. // @match https://character.ai/*
  8. // @grant GM_addStyle
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to create or update a style element
  15. function updateCSSVariable(variableName, value) {
  16. document.documentElement.style.setProperty(variableName, value);
  17. }
  18.  
  19. // Update the specific CSS variables
  20. updateCSSVariable('--G850', '#2B2C2D');
  21. updateCSSVariable('--G900', '#242525');
  22. updateCSSVariable('--G950', '#1E1F1F');
  23.  
  24. // Custom CSS for specific classes
  25. const customClassStyles = `
  26. .mt-1.bg-surface-elevation-2 { background-color: #2B2C2D !important; }
  27. .mt-1.bg-surface-elevation-3 { background-color: #2B2C2D !important; }
  28. `;
  29.  
  30. // Inject the custom styles for classes into the page
  31. GM_addStyle(customClassStyles);
  32.  
  33. })();