Youtube Subtitle Caption Stylish

This is to replace the subtitle / caption style using in Youtube

目前为 2021-07-07 提交的版本。查看 最新版本

  1. /* ==UserStyle==
  2. @name Youtube Subtitle Caption Stylish
  3. @namespace http://userstyles.org
  4. @version 1.1
  5. @author CY Fung
  6. @homepage https://userstyles.org/styles/207551
  7. @include https://www.youtube.com*
  8. @description This is to replace the subtitle / caption style using in Youtube
  9. @license MIT
  10. @run-at document-start
  11. ==/UserStyle== */
  12.  
  13. @-moz-document url-prefix("https://www.youtube.com") {
  14. @font-face {
  15. font-family: 'cwTeXYen';
  16. src: url(https://fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.eot);
  17. src: url(https://fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.eot?#iefix) format('embedded-opentype'),
  18. url(https://fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.woff2) format('woff2'),
  19. url(https://fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.woff) format('woff'),
  20. url(https://fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.ttf) format('truetype');
  21. }
  22. @font-face {
  23. font-family: 'cwTeXHei';
  24. src: url(https://fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.eot);
  25. src: url(https://fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.eot?#iefix) format('embedded-opentype'),
  26. url(https://fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.woff2) format('woff2'),
  27. url(https://fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.woff) format('woff'),
  28. url(https://fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.ttf) format('truetype');
  29. }
  30. @import url(https://raw.githubusercontent.com/cyfung1031/Youtube-Subtitle-Caption-Stylish/main/css/noto-sans-cjk-400.css);
  31.  
  32. ytd-watch-flexy .ytp-caption-segment{
  33. --font-size: 18px;
  34. }
  35. ytd-watch-flexy[theater] .ytp-caption-segment{
  36. --font-size: 2vw;
  37. }
  38. ytd-watch-flexy[fullscreen] .ytp-big-mode .ytp-caption-segment{
  39. --font-size: 2.6vw;
  40. }
  41. #ytp-caption-window-container .caption-window.ytp-caption-window-bottom[style*="text-align:"][style*="center"][style*="bottom:"][style*="margin-left:"][style*="left:"]{
  42. width:auto !important;
  43. width:100% !important;
  44. left:0 !important;
  45. margin-left:0 !important;
  46. padding-bottom:0 !important;
  47. margin-bottom:0 !important;
  48. bottom:calc(40px + 2%) !important;
  49. touch-action: none !important;
  50. pointer-events:none !important;
  51. cursor:default !important;
  52. }
  53. #ytp-caption-window-container .caption-window.ytp-caption-window-bottom[style*="text-align:"][style*="center"][style*="bottom:"][style*="margin-left:"][style*="left:"] .captions-text .caption-visual-line .ytp-caption-segment{
  54. --scale: 2.15;
  55. --base-font-size:13.6233px;
  56. --text-color:rgba(221, 221, 221, 0.863);
  57. --text-color:rgba(244, 244, 244, 1);
  58. --text-shadow-h-shadow: 0px;
  59. --text-shadow-v-shadow: 0px;
  60. --text-shadow-blur-radius: 1.7px;
  61. --text-shadow-color:rgb(0, 120, 255);
  62. --text-outline-color:rgb(0, 0, 255);
  63. --text-shadow: var(--text-shadow-color) var(--text-shadow-h-shadow) var(--text-shadow-v-shadow) var(--text-shadow-blur-radius);
  64. --text-font: "Noto Sans CJK", "YouTube Noto", Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif;
  65. --font-weight:400;
  66. --letter-spacing: 0px;
  67. --text-shadow-black-outline: rgb(0, 60, 127);
  68. margin:2px 0 !important;
  69. display: inline-block !important;
  70. white-space: nowrap !important;
  71. background: transparent !important;
  72. font-size: var(--font-size) !important;
  73. transform:none !important;
  74. text-shadow:
  75. var( --text-shadow-color) 0 0 1.5px,
  76. var( --text-shadow-color) 0 0 2px,
  77. var( --text-shadow-color) 0 0 2.5px,
  78. var( --text-shadow-color) 0 0 3px,
  79. var( --text-shadow-color) 0 0 3.5px,
  80. var( --text-shadow-color) 0 0 4px,
  81. var( --text-outline-color) -1px -1px 0,
  82. var( --text-outline-color) -1px 1px 0,
  83. var( --text-outline-color) 1px -1px 0,
  84. var( --text-outline-color) 1px 1px 0,
  85. var( --text-shadow-black-outline) -2px -2px 2px,
  86. var( --text-shadow-black-outline) 2px 2px 2px,
  87. var( --text-shadow-black-outline) 2px -2px 2px,
  88. var( --text-shadow-black-outline) -2px 2px 2px
  89. !important;
  90. color: var(--text-color) !important;
  91. fill: var(--text-color) !important;
  92. font-family: var(--text-font) !important;
  93. font-weight: var(--font-weight) !important;
  94. letter-spacing: var(--letter-spacing) !important;
  95. touch-action: none !important;
  96. pointer-events:none !important;
  97. cursor:default !important;
  98. }
  99. }

QingJ © 2025

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