Mistral responsive + customizations

Mistral website is more suitable for wide screens.

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

  1. /* ==UserStyle==
  2. @name Mistral responsive + customizations
  3. @version 1.0.14
  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.14 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: 1em;
  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="flex h-fit w-full flex-col"] > div:nth-child(odd) {
  117. position: relative;
  118. }
  119. [class="flex h-fit w-full flex-col"] > div:nth-child(odd) > div {
  120. margin-right: calc(32px + .5em);
  121. }
  122. [class="flex h-fit w-full flex-col"] > div:nth-child(odd) > div::before {
  123. position: absolute;
  124. right: 0;
  125. }
  126. [data-sidebar="header"] button:nth-of-type(1) > div > div:nth-of-type(1):before,
  127. [class="flex h-fit w-full flex-col"] > div:nth-child(odd) > div::before {
  128. background: url(avatarurl) no-repeat center center / cover;
  129. border-radius: 50%;
  130. content: "";
  131. display: inline-block;
  132. height: 32px;
  133. width: 32px;
  134. }
  135. }
  136. if cmmistralavatar {
  137. [class="flex h-full w-full flex-1 flex-col items-center justify-center gap-5"] > div:nth-of-type(3) {
  138. bottom: 0;
  139. max-width: 100%;
  140. top: auto !important;
  141. }
  142. [class="mb-40 flex flex-col items-stretch"] {
  143. height: auto;
  144. max-height: calc(100vh - 64px - 167px) !important;
  145. }
  146. [class="mb-40 flex flex-col items-stretch"] svg {
  147. aspect-ratio: 1 / 1;
  148. background: url(cmmistralavatarurl) no-repeat center center / cover;
  149. border-radius: cmmistralavatarcorner;
  150. height: 0;
  151. margin: 0 auto;
  152. padding-left: cmmistralavatarsize;
  153. padding-top: cmmistralavatarsize;
  154. width: 0;
  155. }
  156. [class="group flex w-full gap-3"] > span > svg {
  157. aspect-ratio: 1 / 1;
  158. background: url(cmmistralavatarurl) no-repeat center center / cover;
  159. border-radius: 50%;
  160. height: 0;
  161. padding-left: 32px;
  162. padding-top: 32px;
  163. width: 0;
  164. }
  165. }
  166. if chatmode {
  167. [class="flex h-fit w-full flex-col"] > div {
  168. max-width: 80%;
  169. }
  170. code[style*="white-space: pre"],
  171. code[style*="white-space:pre"] {
  172. white-space: break-spaces !important;
  173. }
  174. [class="flex h-fit w-full flex-col"] > div:nth-child(odd) {
  175. align-self: flex-end !important;
  176. justify-content: flex-end !important;
  177. }
  178. [class="flex h-fit w-full flex-col"] > div:nth-child(odd) > div > div:nth-of-type(1) > div > div > div {
  179. margin-left: auto;
  180. }
  181. }
  182. if darkmode {
  183. .dark,
  184. .light {
  185. --background-primary: 240 7% 18%;
  186. --background-secondary: 240 5.9% 10%;
  187. --sidebar-background: 0 0% 5%;
  188. }
  189. /* Mistral logo/avatar */
  190. [class="group flex w-full gap-3"] > span > svg {
  191. height: 32px;
  192. margin-bottom: 0;
  193. width: 32px;
  194. }
  195. ::selection,
  196. .data-\\[state\\=open\\]\\:hover\\:bg-sidebar-accent:hover[data-state=open],
  197. .dark\\:hover\\:bg-secondary-200:hover:is(.dark *),
  198. .hover\\:bg-secondary-200:hover,
  199. .hover\\:text-sidebar-accent-foreground:hover {
  200. background-color: rgba(255, 149, 0, 0.2) !important;
  201. }
  202. [class="group relative flex w-full gap-3"] > div > div:nth-of-type(1) {
  203. background: rgba(50, 50, 50, 0.85);
  204. border-radius: 1.5rem;
  205. padding: .625rem 1.25rem .625rem 1.25rem !important;
  206. }
  207. code[node="[object Object]"] {
  208. background-color: rgba(203, 203, 203, 0.2) !important;
  209. border-radius: 12px !important;
  210. padding: .1em .5em!important;
  211. }
  212. /* Scroll down icon */
  213. svg.lucide-arrow-down path {
  214. stroke: rgb(255, 69, 0);
  215. }
  216. /* Links */
  217. .prose a {
  218. color: hsl(25, 88%, 51%);
  219. }
  220. }
  221. if widemode {
  222. .max-w-screen-md {
  223. max-width: 100%;
  224. }
  225. .max-h-\\[300px\\]:has(textarea) {
  226. max-height: 50vh !important;
  227. }
  228. .max-w-screen-md:has(textarea) {
  229. padding: 1em 1.75em;
  230. }
  231. /* Avatars */
  232. .h-7 {
  233. height: 32px;
  234. }
  235. .w-7 {
  236. width: 32px;
  237. }
  238. body:has(iframe[sandbox="allow-scripts allow-same-origin"]) {
  239. .cm-content {
  240. flex-shrink: 1;
  241. }
  242. .cm-line {
  243. white-space: wrap;
  244. width: 100% !important;
  245. }
  246. }
  247. /* Generated images */
  248. [class="group flex w-full gap-3"] > div:nth-of-type(2) p:has(img) {
  249. margin-left: auto;
  250. margin-right: auto;
  251. }
  252. /* Textarea box */
  253. [class="relative flex w-full flex-col justify-start"] > div {
  254. padding-bottom: 0 !important;
  255. }
  256. /* Scroll down icon */
  257. button:has(svg.lucide-arrow-down) {
  258. height: 40px;
  259. width: 40px;
  260. }
  261. svg.lucide-arrow-down path {
  262. stroke: rgb(255, 69, 0);
  263. }
  264. /* Small space between date and edit button */
  265. [aria-label="Edit question"] {
  266. margin-left: 1em !important;
  267. }
  268. /* Search box */
  269. div[role="dialog"]:has(label) {
  270. max-height: 80%;
  271. max-width: 80%;
  272. }
  273. div[role="dialog"]:has(label) input:hover {
  274. box-shadow: none;
  275. }
  276. }
  277. }
  278.  
  279. @-moz-document domain("console.mistral.ai") {
  280. /* Mistral Console */
  281. button[class*="flex w-full items-center gap-3 rounded px-3 py-2"] > div:nth-of-type(1),
  282. .user-initials {
  283. background: transparent !important;
  284. color: transparent;
  285. }
  286. button[class*="flex w-full items-center gap-3 rounded px-3 py-2"] > div:nth-of-type(1)::before,
  287. .user-initials::before {
  288. background: url(avatarurl) no-repeat center center / cover;
  289. border-radius: 50%;
  290. content: "";
  291. display: inline-block;
  292. height: 32px;
  293. width: 32px;
  294. }
  295. }

QingJ © 2025

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