Mistral responsive + customizations

Mistral website is more suitable for wide screens.

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

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

QingJ © 2025

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