Mistral Chat responsive + customizations

Mistral Chat website is more suitable for wide screens.

当前为 2025-01-06 提交的版本,查看 最新版本

  1. /* ==UserStyle==
  2. @name Mistral Chat responsive + customizations
  3. @version 1.0.6
  4. @description Mistral Chat website is more suitable for wide screens.
  5. @author BreatFR (https://breat.fr)
  6. @namespace https://gitlab.com/breatfr
  7. @homepageURL https://gitlab.com/breatfr/mistral
  8. @supportURL https://discord.gg/Q8KSHzdBxs
  9. @license AGPL-3.0-or-later; https://www.gnu.org/licenses/agpl-3.0.txt
  10. @preprocessor stylus
  11.  
  12. @var checkbox darkmode "Better dark mode" 1
  13. @var checkbox avatar "Custom avatar for us" 0
  14. @var text avatarurl "Custom avatar URL" "URL between quotes"
  15. @var checkbox cmmistralavatar "Custom Mistral avatar" 0
  16. @var text cmmistralavatarurl "Custom Mistral avatar URL" "URL between quotes"
  17. @var text cmmistralavatarsize "Custom Mistral avatar size" 256px
  18. @var text cmmistralavatarcorner "Custom Mistral avatar corner" 50%
  19. @var text fontsize "Custom font size" 1.2rem
  20. @var checkbox widemode "Wide mode" 1
  21. ==/UserStyle== */
  22.  
  23. /* === Credits ===
  24. Website https://breat.fr
  25. facebook https://www.facebook.com/breatfroff
  26. mastodon https://mastodon.social/@breat_fr
  27. telegram https://t.me/breatfr
  28. vk https://vk.com/breatfroff
  29. X (twitter) https://x.com/breatfroff
  30. === Credits === */
  31.  
  32. @-moz-document domain("chat.mistral.ai") {
  33. /* Theme */
  34. /* Versions */
  35. :root {
  36. --themeversion: 'Theme v1.0.6 by BreatFR (https://breat.fr)';
  37. --install1: ' usercssjs.breat.fr \A';
  38. --install2: ' gitlab.com/breatfr/mistral \A \A';
  39. --support1: ' ko-fi.com/breatfr \A';
  40. --support2: ' paypal.me/breat';
  41. }
  42.  
  43. @media (min-width: 900px) {
  44. body:not(:has(span[class="w-fit max-w-full truncate text-lg font-medium text-secondary-400 dark:text-secondary-400"])) [data-sidebar="trigger"]::after {
  45. background: linear-gradient(88.55deg, rgb(253, 73, 2) 22.43%, rgb(254, 206, 0) 92.28%);
  46. background-clip: text;
  47. -webkit-background-clip: text;
  48. color: transparent;
  49. content: var(--themeversion);
  50. display: block;
  51. font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  52. font-size: 1.2rem;
  53. left: 50%;
  54. line-height: 1.5;
  55. max-width: max-content;
  56. pointer-events: none;
  57. position: absolute;
  58. text-align: center;
  59. top: .25em;
  60. transform: translateX(-50%);
  61. width: 100%;
  62. white-space: wrap;
  63. }
  64. }
  65. [data-state="expanded"] [data-sidebar="sidebar"]::after {
  66. background: linear-gradient(88.55deg, rgb(253, 73, 2) 22.43%, rgb(254, 206, 0) 92.28%);
  67. background-clip: text;
  68. -webkit-background-clip: text;
  69. bottom: 1em;
  70. color: transparent;
  71. content: 'Install: \A' url("https://gitlab.com/breatfr/kindroid/-/raw/main/images/icon_breat.fr.png") var(--install1) url("https://gitlab.com/breatfr/kindroid/-/raw/main/images/icon_gitlab.png") var(--install2) 'Support me: \A' url("https://gitlab.com/breatfr/kindroid/-/raw/main/images/icon_ko-fi.png") var(--support1) url("https://gitlab.com/breatfr/kindroid/-/raw/main/images/icon_paypal.png") var(--support2);
  72. display: block;
  73. font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  74. font-size: 1.2rem;
  75. left: 0;
  76. line-height: 1.5;
  77. max-width: 256px;
  78. pointer-events: none;
  79. position: fixed;
  80. text-align: center;
  81. width: 100%;
  82. white-space: pre-line;
  83. }
  84.  
  85. body {
  86. overflow-x: hidden;
  87. }
  88. /* Custom font size */
  89. .prose,
  90. code,
  91. textarea,
  92. .max-w-screen-md:has(textarea) button {
  93. font-size: fontsize !important;
  94. line-height: 1.5 !important;
  95. }
  96. textarea.py-2 {
  97. min-height: max-content !important;
  98. }
  99. if avatar {
  100. [data-sidebar="header"] button:nth-of-type(1) > div:nth-of-type(1) {
  101. background: transparent;
  102. color: transparent;
  103. }
  104. [class="group relative flex w-full gap-3"] > span > span {
  105. display: none;
  106. }
  107. [data-sidebar="menu-button"] > div:nth-of-type(1):before,
  108. [class="group relative flex w-full gap-3"] > span:before {
  109. background: url(avatarurl) no-repeat center center / cover;
  110. border-radius: 50%;
  111. content: "";
  112. display: inline-block;
  113. height: 32px;
  114. width: 32px;
  115. }
  116. }
  117. if cmmistralavatar {
  118. [class="flex h-full w-full flex-1 flex-col items-center justify-center gap-5"] > div:nth-of-type(1) {
  119. max-height: fit-content;
  120. }
  121. [class="flex h-full w-full flex-1 flex-col items-center justify-center gap-5"] > div:nth-of-type(1) > div {
  122. align-items: center !important;
  123. justify-content: center;
  124. }
  125. [class="flex h-full w-full flex-1 flex-col items-center justify-center gap-5"] > div:nth-of-type(1) > div > div {
  126. margin-bottom: 1rem;
  127. max-width: 100%;
  128. }
  129. [class="flex h-full w-full flex-1 flex-col items-center justify-center gap-5"] > div:nth-of-type(2) {
  130. display: none !important;
  131. height: 0 !important;
  132. }
  133. [class="flex h-full w-full flex-1 flex-col items-center justify-center gap-5"] > div:nth-of-type(3) {
  134. bottom: 0;
  135. max-width: calc(100% - 17rem);
  136. position: fixed;
  137. top: auto !important;
  138. }
  139. [class="mb-32 flex flex-col items-stretch"] img[class="block dark:hidden"],
  140. [class="mb-32 flex flex-col items-stretch"] img[class="hidden dark:block"] {
  141. aspect-ratio: 1 / 1;
  142. background: url(cmmistralavatarurl) no-repeat center center / cover;
  143. border-radius: cmmistralavatarcorner;
  144. height: 0;
  145. margin: 0 auto;
  146. padding-left: cmmistralavatarsize;
  147. padding-top: cmmistralavatarsize;
  148. width: 0;
  149. }
  150. [class="flex w-full gap-3"] > div:nth-of-type(1) > div img,
  151. [class="group flex w-full gap-3"] > div:nth-of-type(1) > div img {
  152. aspect-ratio: 1 / 1;
  153. background: url(cmmistralavatarurl) no-repeat center center / cover;
  154. border-radius: 50%;
  155. padding-left: 32px;
  156. padding-top: 32px;
  157. }
  158. }
  159. if chatmode {
  160. [class="group relative flex w-full gap-3"] > span {
  161. order: 2;
  162. }
  163. [class="group relative flex w-full gap-3"] > div {
  164. order: 1;
  165. }
  166. [class="group relative flex w-full gap-3"] {
  167. align-self: flex-end !important;
  168. justify-content: flex-end !important;
  169. max-width: 80% !important;
  170. width: fit-content !important;
  171. }
  172. [class="group relative flex w-full gap-3"] * {
  173. justify-content: flex-end !important;
  174. margin-left: auto !important;
  175. }
  176. [class="group flex w-full gap-3"] > div {
  177. max-width: 80%;
  178. }
  179. }
  180. if darkmode {
  181. .dark,
  182. .light {
  183. --background: 240 5.9% 10%;
  184. --secondary-200: 240 5.9% 10%;
  185. --sidebar-background: 0 0% 5%;
  186. }
  187. .shadow-lg:not([data-radix-popper-content-wrapper] > div) {
  188. box-shadow: rgba(255, 149, 0, 0.4) -2px -2px 2px 2px,
  189. rgba(255, 149, 0, 0.4) -2px 2px 2px 2px,
  190. rgba(255, 69, 0, 0.4) 2px -2px 2px 2px,
  191. rgba(255, 69, 0, 0.4) 2px 2px 2px 2px;
  192. }
  193. /* Mistral logo/avatar */
  194. img[class="block dark:hidden"],
  195. img[class="hidden dark:block"] {
  196. background: url("https://gitlab.com/uploads/-/system/project/avatar/65782442/mistral.png") no-repeat center center / cover;
  197. height: 0;
  198. padding-left: 192px;
  199. padding-top: 192px;
  200. margin-bottom: 7em;
  201. width: 0;
  202. }
  203. [class="flex w-full gap-3"] > div:nth-of-type(1) > div img,
  204. [class="group flex w-full gap-3"] > div:nth-of-type(1) > div img {
  205. padding-left: 32px;
  206. padding-top: 32px;
  207. margin-bottom: 0;
  208. }
  209. ::selection,
  210. .data-\\[state\\=open\\]\\:hover\\:bg-sidebar-accent:hover[data-state=open],
  211. .dark\\:hover\\:bg-secondary-200:hover:is(.dark *),
  212. .hover\\:bg-secondary-200:hover,
  213. .hover\\:text-sidebar-accent-foreground:hover {
  214. background-color: rgba(255, 149, 0, 0.2) !important;
  215. }
  216. [class="group relative flex w-full gap-3"] > div > div:nth-of-type(1) {
  217. background: rgba(50, 50, 50, 0.85);
  218. border-radius: 1.5rem;
  219. padding: .625rem 1.25rem .625rem 1.25rem !important;
  220. }
  221. code[node="[object Object]"] {
  222. background-color: rgba(203, 203, 203, 0.2) !important;
  223. border-radius: 12px !important;
  224. padding: .1em .5em!important;
  225. }
  226. }
  227. if widemode {
  228. .max-w-screen-md {
  229. max-width: 100%;
  230. }
  231. .max-h-\\[300px\\]:has(textarea) {
  232. max-height: 50vh !important;
  233. }
  234. .max-w-screen-md:has(textarea) {
  235. padding: 20px;
  236. }
  237. /* Avatars */
  238. .h-7 {
  239. height: 32px;
  240. }
  241. .w-7 {
  242. width: 32px;
  243. }
  244. body:has(iframe[sandbox="allow-scripts allow-same-origin"]) {
  245. .cm-content {
  246. flex-shrink: 1;
  247. }
  248. .cm-line {
  249. white-space: wrap;
  250. width: 100% !important;
  251. }
  252. }
  253. }
  254. }

QingJ © 2025

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