Mistral responsive + customizations

Mistral website is more suitable for wide screens.

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

  1. /* ==UserStyle==
  2. @name Mistral responsive + customizations
  3. @version 1.0.13
  4. @description Mistral 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 chatmode "Chat mode" 1
  14. @var checkbox avatar "Custom avatar for us" 0
  15. @var text avatarurl "Custom avatar URL" "URL between quotes"
  16. @var checkbox cmmistralavatar "Custom Mistral avatar" 0
  17. @var text cmmistralavatarurl "Custom Mistral avatar URL" "URL between quotes"
  18. @var text cmmistralavatarsize "Custom Mistral avatar size" calc(100vh - 46px - 155px - 1rem)
  19. @var text cmmistralavatarcorner "Custom Mistral avatar corner" 50%
  20. @var text fontsize "Custom font size" 1.2rem
  21. @var checkbox widemode "Wide mode" 1
  22. ==/UserStyle== */
  23.  
  24. /* === Credits ===
  25. Website https://breat.fr
  26. facebook https://www.facebook.com/breatfroff
  27. mastodon https://mastodon.social/@breat_fr
  28. telegram https://t.me/breatfr
  29. vk https://vk.com/breatfroff
  30. X (twitter) https://x.com/breatfroff
  31. === Credits === */
  32.  
  33. @-moz-document domain("chat.mistral.ai") {
  34. /* Mistral Chat */
  35. /* Versions */
  36. :root {
  37. --themeversion: 'Theme v1.0.13 by BreatFR (https://breat.fr)';
  38. --install1: ' usercssjs.breat.fr \A';
  39. --install2: ' gitlab.com/breatfr/mistral \A \A';
  40. --support1: ' ko-fi.com/breatfr \A';
  41. --support2: ' paypal.me/breat';
  42. }
  43.  
  44. @media (min-width: 900px) {
  45. main main::after {
  46. background: linear-gradient(88.55deg, rgb(253, 73, 2) 22.43%, rgb(254, 206, 0) 92.28%);
  47. background-clip: text;
  48. -webkit-background-clip: text;
  49. color: transparent;
  50. content: var(--themeversion);
  51. display: block;
  52. font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  53. font-size: 1.2rem;
  54. left: 50%;
  55. line-height: 1.5;
  56. max-width: max-content;
  57. pointer-events: none;
  58. position: absolute;
  59. text-align: center;
  60. top: 0;
  61. transform: translate(-50%, 50%);
  62. width: 100%;
  63. white-space: wrap;
  64. }
  65. }
  66. [data-state="expanded"] [data-sidebar="sidebar"]::after,
  67. [data-mobile="true"][data-sidebar="sidebar"]::after {
  68. background: linear-gradient(88.55deg, rgb(253, 73, 2) 22.43%, rgb(254, 206, 0) 92.28%);
  69. background-clip: text;
  70. -webkit-background-clip: text;
  71. bottom: 4em;
  72. color: transparent;
  73. 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);
  74. display: block;
  75. font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  76. font-size: 1.2rem;
  77. left: 0;
  78. line-height: 1.5;
  79. max-width: 256px;
  80. pointer-events: none;
  81. position: fixed;
  82. text-align: center;
  83. width: 100%;
  84. white-space: pre-line;
  85. }
  86. body {
  87. max-height: 100vh;
  88. overflow: hidden;
  89. }
  90. /* Textarea focused */
  91. body:has(textarea:focus) {
  92. [class="flex w-full flex-col p-4"] {
  93. border-radius: calc(var(--radius) + 4px);
  94. box-shadow: rgba(255, 149, 0, 0.4) -2px -2px 2px 2px,
  95. rgba(255, 149, 0, 0.4) -2px 2px 2px 2px,
  96. rgba(255, 69, 0, 0.4) 2px -2px 2px 2px,
  97. rgba(255, 69, 0, 0.4) 2px 2px 2px 2px;
  98. }
  99. }
  100. /* Custom font size */
  101. .prose,
  102. code,
  103. textarea,
  104. .max-w-screen-md:has(textarea) button {
  105. font-size: fontsize !important;
  106. line-height: 1.5 !important;
  107. }
  108. textarea.py-2 {
  109. min-height: max-content !important;
  110. }
  111. if avatar {
  112. [data-sidebar="header"] button:nth-of-type(1) > div > div:nth-of-type(1) {
  113. background: transparent;
  114. color: transparent;
  115. }
  116. [class="group relative flex w-full gap-3"] > span > span {
  117. display: none;
  118. }
  119. [data-sidebar="header"] button:nth-of-type(1) > div > div:nth-of-type(1):before,
  120. [class="group relative flex w-full gap-3"] > span:before {
  121. background: url(avatarurl) no-repeat center center / cover;
  122. border-radius: 50%;
  123. content: "";
  124. display: inline-block;
  125. height: 32px;
  126. width: 32px;
  127. }
  128. }
  129. if cmmistralavatar {
  130. [class="flex h-full w-full flex-1 flex-col items-center justify-center gap-5"] > div:nth-of-type(3) {
  131. bottom: 0;
  132. max-width: 100%;
  133. top: auto !important;
  134. }
  135. [class="mb-40 flex flex-col items-stretch"] {
  136. height: auto;
  137. max-height: calc(100vh - 64px - 167px) !important;
  138. }
  139. [class="mb-40 flex flex-col items-stretch"] svg {
  140. aspect-ratio: 1 / 1;
  141. background: url(cmmistralavatarurl) no-repeat center center / cover;
  142. border-radius: cmmistralavatarcorner;
  143. height: 0;
  144. margin: 0 auto;
  145. padding-left: cmmistralavatarsize;
  146. padding-top: cmmistralavatarsize;
  147. width: 0;
  148. }
  149. [class="group flex w-full gap-3"] > span > svg {
  150. aspect-ratio: 1 / 1;
  151. background: url(cmmistralavatarurl) no-repeat center center / cover;
  152. border-radius: 50%;
  153. height: 0;
  154. padding-left: 32px;
  155. padding-top: 32px;
  156. width: 0;
  157. }
  158. }
  159. if chatmode {
  160. [class="flex h-fit w-full flex-col gap-4"] {
  161. overflow-x: hidden;
  162. }
  163. [class="flex h-fit w-full flex-col gap-4"] > div {
  164. max-width: 80%;
  165. }
  166. code[style*="white-space: pre"],
  167. code[style*="white-space:pre"] {
  168. white-space: break-spaces !important;
  169. }
  170. [class="group relative flex w-full gap-3"] {
  171. align-self: flex-end !important;
  172. justify-content: flex-end !important;
  173. max-width: 80% !important;
  174. }
  175. [class="group relative flex w-full gap-3"] * {
  176. justify-content: flex-end !important;
  177. margin-left: auto !important;
  178. }
  179. [class="group relative flex w-full gap-3"] > span {
  180. order: 2;
  181. }
  182. [class="group relative flex w-full gap-3"] > div {
  183. order: 1;
  184. }
  185. [class="group relative flex w-full gap-3"] > div > div:not(:only-child) {
  186. width: auto;
  187. }
  188. }
  189. if darkmode {
  190. .dark,
  191. .light {
  192. --background-primary: 240 7% 18%;
  193. --background-secondary: 240 5.9% 10%;
  194. --sidebar-background: 0 0% 5%;
  195. }
  196. /* Mistral logo/avatar */
  197. [class="group flex w-full gap-3"] > span > svg {
  198. height: 32px;
  199. margin-bottom: 0;
  200. width: 32px;
  201. }
  202. ::selection,
  203. .data-\\[state\\=open\\]\\:hover\\:bg-sidebar-accent:hover[data-state=open],
  204. .dark\\:hover\\:bg-secondary-200:hover:is(.dark *),
  205. .hover\\:bg-secondary-200:hover,
  206. .hover\\:text-sidebar-accent-foreground:hover {
  207. background-color: rgba(255, 149, 0, 0.2) !important;
  208. }
  209. [class="group relative flex w-full gap-3"] > div > div:nth-of-type(1) {
  210. background: rgba(50, 50, 50, 0.85);
  211. border-radius: 1.5rem;
  212. padding: .625rem 1.25rem .625rem 1.25rem !important;
  213. }
  214. code[node="[object Object]"] {
  215. background-color: rgba(203, 203, 203, 0.2) !important;
  216. border-radius: 12px !important;
  217. padding: .1em .5em!important;
  218. }
  219. /* Scroll down icon */
  220. svg.lucide-arrow-down path {
  221. stroke: rgb(255, 69, 0);
  222. }
  223. /* Links */
  224. .prose a {
  225. color: hsl(25, 88%, 51%);
  226. }
  227. }
  228. if widemode {
  229. .max-w-screen-md {
  230. max-width: 100%;
  231. }
  232. .max-h-\\[300px\\]:has(textarea) {
  233. max-height: 50vh !important;
  234. }
  235. .max-w-screen-md:has(textarea) {
  236. padding: 1em 1.75em;
  237. }
  238. /* Avatars */
  239. .h-7 {
  240. height: 32px;
  241. }
  242. .w-7 {
  243. width: 32px;
  244. }
  245. body:has(iframe[sandbox="allow-scripts allow-same-origin"]) {
  246. .cm-content {
  247. flex-shrink: 1;
  248. }
  249. .cm-line {
  250. white-space: wrap;
  251. width: 100% !important;
  252. }
  253. }
  254. /* Generated images */
  255. [class="group flex w-full gap-3"] > div:nth-of-type(2) p:has(img) {
  256. margin-left: auto;
  257. margin-right: auto;
  258. }
  259. /* Textarea box */
  260. [class="relative flex w-full flex-col justify-start"] > div {
  261. padding-bottom: 0 !important;
  262. }
  263. /* Scroll down icon */
  264. button:has(svg.lucide-arrow-down) {
  265. height: 40px;
  266. width: 40px;
  267. }
  268. svg.lucide-arrow-down path {
  269. stroke: rgb(255, 69, 0);
  270. }
  271. /* Small space between date and edit button */
  272. [aria-label="Edit question"] {
  273. margin-left: 1em !important;
  274. }
  275. /* Search box */
  276. div[role="dialog"]:has(label) {
  277. max-height: 80%;
  278. max-width: 80%;
  279. }
  280. div[role="dialog"]:has(label) input:hover {
  281. box-shadow: none;
  282. }
  283. }
  284. }
  285.  
  286. @-moz-document domain("console.mistral.ai") {
  287. /* Mistral Console */
  288. button[class*="flex w-full items-center gap-3 rounded px-3 py-2"] > div:nth-of-type(1),
  289. .user-initials {
  290. background: transparent !important;
  291. color: transparent;
  292. }
  293. button[class*="flex w-full items-center gap-3 rounded px-3 py-2"] > div:nth-of-type(1)::before,
  294. .user-initials::before {
  295. background: url(avatarurl) no-repeat center center / cover;
  296. border-radius: 50%;
  297. content: "";
  298. display: inline-block;
  299. height: 32px;
  300. width: 32px;
  301. }
  302. }

QingJ © 2025

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