styles.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /*
  2. * Write hoppscotch-common related custom styles in this file.
  3. * If styles are sharable across all package then write into hoppscotch-ui/assets/scss/styles.scss file.
  4. */
  5. * {
  6. backface-visibility: hidden;
  7. -moz-backface-visibility: hidden;
  8. -webkit-backface-visibility: hidden;
  9. &::before {
  10. backface-visibility: hidden;
  11. -moz-backface-visibility: hidden;
  12. -webkit-backface-visibility: hidden;
  13. }
  14. &::after {
  15. backface-visibility: hidden;
  16. -moz-backface-visibility: hidden;
  17. -webkit-backface-visibility: hidden;
  18. }
  19. @apply selection:bg-accentDark;
  20. @apply selection:text-accentContrast;
  21. @apply overscroll-none;
  22. }
  23. :root {
  24. @apply antialiased;
  25. accent-color: var(--accent-color);
  26. font-variant-ligatures: common-ligatures;
  27. // Colors
  28. --info-color: #ec4899;
  29. --success-color: #10b981;
  30. --blue-color: #3b82f6;
  31. --warning-color: #f59e0b;
  32. --cl-error-color: #ef4444;
  33. --sv-error-color: #dc2626;
  34. }
  35. ::-webkit-scrollbar-track {
  36. @apply bg-transparent;
  37. @apply border-b-0 border-l border-r-0 border-t-0 border-solid border-dividerLight;
  38. }
  39. ::-webkit-scrollbar-thumb {
  40. @apply bg-divider bg-clip-content;
  41. @apply rounded-full;
  42. @apply border-4 border-solid border-transparent;
  43. @apply hover:bg-dividerDark;
  44. @apply hover:bg-clip-content;
  45. }
  46. ::-webkit-scrollbar {
  47. @apply w-4;
  48. @apply h-0;
  49. }
  50. .no-scrollbar {
  51. scrollbar-width: none;
  52. }
  53. input::placeholder,
  54. textarea::placeholder,
  55. .cm-placeholder {
  56. @apply text-secondary;
  57. @apply opacity-50;
  58. }
  59. input,
  60. textarea {
  61. @apply text-secondaryDark;
  62. @apply font-medium;
  63. }
  64. html {
  65. scroll-behavior: smooth;
  66. }
  67. body {
  68. @apply bg-primary;
  69. @apply text-body text-secondary;
  70. @apply font-medium;
  71. @apply select-none;
  72. @apply overflow-x-hidden;
  73. @apply leading-body;
  74. animation: fade 300ms forwards;
  75. -webkit-tap-highlight-color: transparent;
  76. -webkit-touch-callout: none;
  77. }
  78. @keyframes fade {
  79. 0% {
  80. @apply opacity-0;
  81. }
  82. 100% {
  83. @apply opacity-100;
  84. }
  85. }
  86. .fade-enter-active,
  87. .fade-leave-active {
  88. @apply transition-opacity;
  89. }
  90. .fade-enter-from,
  91. .fade-leave-to {
  92. @apply opacity-0;
  93. }
  94. .slide-enter-active,
  95. .slide-leave-active {
  96. @apply transition;
  97. @apply duration-300;
  98. }
  99. .slide-enter-from,
  100. .slide-leave-to {
  101. @apply transform;
  102. @apply translate-x-full;
  103. }
  104. .bounce-enter-active,
  105. .bounce-leave-active {
  106. @apply transition;
  107. }
  108. .bounce-enter-from,
  109. .bounce-leave-to {
  110. @apply transform;
  111. @apply scale-95;
  112. }
  113. .svg-icons {
  114. @apply flex-shrink-0;
  115. @apply overflow-hidden;
  116. height: var(--line-height-body);
  117. width: var(--line-height-body);
  118. }
  119. a {
  120. @apply inline-flex;
  121. @apply text-current;
  122. @apply no-underline;
  123. @apply transition;
  124. @apply leading-body;
  125. @apply focus:outline-none;
  126. &.link {
  127. @apply items-center;
  128. @apply px-1 py-0.5;
  129. @apply -mx-1 -my-0.5;
  130. @apply text-accent;
  131. @apply rounded;
  132. @apply hover:text-accentDark;
  133. @apply focus-visible:ring;
  134. @apply focus-visible:ring-accent;
  135. @apply focus-visible:text-accentDark;
  136. }
  137. }
  138. .cm-tooltip {
  139. .tippy-box {
  140. @apply shadow-none #{!important};
  141. @apply fixed;
  142. @apply inline-flex;
  143. @apply -mt-8;
  144. }
  145. }
  146. .tippy-box[data-theme~="tooltip"] {
  147. @apply bg-tooltip;
  148. @apply border-solid border-tooltip;
  149. @apply rounded;
  150. @apply shadow;
  151. .tippy-content {
  152. @apply flex;
  153. @apply text-tiny text-primary;
  154. @apply font-semibold;
  155. @apply px-2 py-1;
  156. @apply truncate;
  157. @apply leading-normal;
  158. @apply items-center;
  159. kbd {
  160. @apply hidden;
  161. @apply font-sans;
  162. background-color: rgba(107, 114, 128, 0.45);
  163. @apply text-primaryLight;
  164. @apply rounded-sm;
  165. @apply px-1;
  166. @apply my-0 ml-1;
  167. @apply truncate;
  168. @apply sm:inline-flex;
  169. }
  170. .env-icon {
  171. @apply transition;
  172. @apply inline-flex;
  173. @apply items-center;
  174. }
  175. }
  176. .tippy-svg-arrow {
  177. svg:first-child {
  178. @apply fill-tooltip;
  179. }
  180. svg:last-child {
  181. @apply fill-tooltip;
  182. }
  183. }
  184. }
  185. .tippy-box[data-theme~="popover"] {
  186. @apply bg-popover;
  187. @apply border-solid border-dividerDark;
  188. @apply rounded;
  189. @apply shadow-lg;
  190. @apply max-w-[45vw] #{!important};
  191. .tippy-content {
  192. @apply flex flex-col;
  193. @apply max-h-[45vh];
  194. @apply items-stretch;
  195. @apply overflow-y-auto;
  196. @apply text-body text-secondary;
  197. @apply p-2;
  198. @apply leading-normal;
  199. @apply focus:outline-none;
  200. scroll-behavior: smooth;
  201. & > span {
  202. @apply block #{!important};
  203. }
  204. }
  205. .tippy-svg-arrow {
  206. svg:first-child {
  207. @apply fill-dividerDark;
  208. }
  209. svg:last-child {
  210. @apply fill-popover;
  211. }
  212. }
  213. }
  214. [data-v-tippy] {
  215. @apply flex flex-1;
  216. @apply truncate;
  217. }
  218. [interactive] > div {
  219. @apply flex flex-1;
  220. @apply h-full;
  221. }
  222. hr {
  223. @apply border-b border-dividerLight;
  224. @apply my-2;
  225. }
  226. .heading {
  227. @apply font-bold;
  228. @apply text-lg text-secondaryDark;
  229. @apply tracking-tight;
  230. }
  231. .input,
  232. .select,
  233. .textarea {
  234. @apply flex;
  235. @apply w-full;
  236. @apply px-4 py-2;
  237. @apply bg-transparent;
  238. @apply rounded;
  239. @apply text-secondaryDark;
  240. @apply border border-divider;
  241. @apply focus-visible:border-dividerDark;
  242. }
  243. input,
  244. select,
  245. textarea,
  246. button {
  247. @apply truncate;
  248. @apply transition;
  249. @apply text-body;
  250. @apply leading-body;
  251. @apply focus:outline-none;
  252. @apply disabled:cursor-not-allowed;
  253. }
  254. .input[type="file"],
  255. .input[type="radio"],
  256. #installPWA {
  257. @apply hidden;
  258. }
  259. .floating-input ~ label {
  260. @apply absolute;
  261. @apply px-2 py-0.5;
  262. @apply m-2;
  263. @apply rounded;
  264. @apply transition;
  265. @apply origin-top-left;
  266. }
  267. .floating-input:focus-within ~ label,
  268. .floating-input:not(:placeholder-shown) ~ label {
  269. @apply bg-primary;
  270. @apply transform;
  271. @apply origin-top-left;
  272. @apply scale-75;
  273. @apply -translate-y-4 translate-x-1;
  274. }
  275. .floating-input:focus-within ~ label {
  276. @apply text-secondaryDark;
  277. }
  278. .floating-input ~ .end-actions {
  279. @apply absolute;
  280. @apply right-[.05rem];
  281. @apply inset-y-0;
  282. @apply flex;
  283. @apply items-center;
  284. }
  285. .floating-input:has(~ .end-actions) {
  286. @apply pr-12;
  287. }
  288. pre.ace_editor {
  289. @apply font-mono;
  290. @apply resize-none;
  291. @apply z-0;
  292. }
  293. .select {
  294. @apply appearance-none;
  295. @apply cursor-pointer;
  296. &::-ms-expand {
  297. @apply hidden;
  298. }
  299. }
  300. .select-wrapper {
  301. @apply flex flex-1;
  302. @apply relative;
  303. @apply after:absolute;
  304. @apply after:flex;
  305. @apply after:inset-y-0;
  306. @apply after:items-center;
  307. @apply after:justify-center;
  308. @apply after:pointer-events-none;
  309. @apply after:font-icon;
  310. @apply after:text-current;
  311. @apply after:right-3;
  312. @apply after:content-["\e5cf"];
  313. @apply after:text-lg;
  314. }
  315. .info-response {
  316. color: var(--info-color);
  317. }
  318. .success-response {
  319. color: var(--success-color);
  320. }
  321. .redir-response {
  322. color: var(--warning-color);
  323. }
  324. .cl-error-response {
  325. color: var(--cl-error-color);
  326. }
  327. .sv-error-response {
  328. color: var(--sv-error-color);
  329. }
  330. .missing-data-response {
  331. @apply text-secondaryLight;
  332. }
  333. .toasted-container {
  334. @apply max-w-md;
  335. .toasted {
  336. &.toasted-primary {
  337. @apply px-4 py-2;
  338. @apply bg-tooltip;
  339. @apply border-secondaryDark;
  340. @apply text-body text-primary;
  341. @apply justify-between;
  342. @apply shadow-lg;
  343. @apply font-semibold;
  344. @apply transition;
  345. @apply leading-body;
  346. @apply sm:rounded;
  347. @apply sm:border;
  348. .action {
  349. @apply relative;
  350. @apply flex flex-shrink-0;
  351. @apply text-body;
  352. @apply px-4;
  353. @apply my-1;
  354. @apply ml-auto;
  355. @apply normal-case;
  356. @apply font-semibold;
  357. @apply leading-body;
  358. @apply tracking-normal;
  359. @apply rounded;
  360. @apply last:ml-4;
  361. @apply sm:ml-8;
  362. @apply before:absolute;
  363. @apply before:bg-current;
  364. @apply before:opacity-10;
  365. @apply before:inset-0;
  366. @apply before:transition;
  367. @apply before:content-[''];
  368. @apply hover:no-underline;
  369. @apply hover:before:opacity-20;
  370. }
  371. }
  372. &.info {
  373. @apply bg-accent;
  374. @apply text-accentContrast;
  375. @apply border-accentDark;
  376. }
  377. &.error {
  378. @apply bg-red-200;
  379. @apply text-red-800;
  380. @apply border-red-400;
  381. }
  382. &.success {
  383. @apply bg-green-200;
  384. @apply text-green-800;
  385. @apply border-green-400;
  386. }
  387. }
  388. }
  389. .smart-splitter .splitpanes__splitter {
  390. @apply relative;
  391. @apply before:absolute;
  392. @apply before:inset-0;
  393. @apply before:bg-accentLight;
  394. @apply before:opacity-0;
  395. @apply before:z-20;
  396. @apply before:transition;
  397. @apply before:content-[''];
  398. @apply hover:before:opacity-100;
  399. }
  400. .no-splitter .splitpanes__splitter {
  401. @apply relative;
  402. }
  403. .smart-splitter.splitpanes--vertical > .splitpanes__splitter {
  404. @apply w-0;
  405. @apply before:-left-0.5;
  406. @apply before:-right-0.5;
  407. @apply before:h-full;
  408. @apply bg-divider;
  409. }
  410. .smart-splitter.splitpanes--horizontal > .splitpanes__splitter {
  411. @apply h-0;
  412. @apply before:-top-0.5;
  413. @apply before:-bottom-0.5;
  414. @apply before:w-full;
  415. @apply bg-divider;
  416. }
  417. .no-splitter.splitpanes--vertical > .splitpanes__splitter {
  418. @apply w-0;
  419. @apply pointer-events-none;
  420. @apply bg-dividerLight;
  421. }
  422. .no-splitter.splitpanes--horizontal > .splitpanes__splitter {
  423. @apply h-0;
  424. @apply pointer-events-none;
  425. @apply bg-dividerLight;
  426. }
  427. .splitpanes--horizontal .splitpanes__pane {
  428. @apply transition-none;
  429. }
  430. .splitpanes--vertical .splitpanes__pane {
  431. @apply transition-none;
  432. }
  433. .cm-focused {
  434. @apply select-auto;
  435. @apply outline-none #{!important};
  436. .cm-activeLine {
  437. @apply bg-primaryLight;
  438. }
  439. .cm-activeLineGutter {
  440. @apply bg-primaryDark;
  441. }
  442. }
  443. .cm-scroller {
  444. @apply overscroll-y-auto;
  445. }
  446. .cm-editor {
  447. .cm-line::selection {
  448. @apply bg-accentDark #{!important};
  449. @apply text-accentContrast #{!important};
  450. }
  451. .cm-line ::selection {
  452. @apply bg-accentDark #{!important};
  453. @apply text-accentContrast #{!important};
  454. }
  455. }
  456. .shortcut-key {
  457. @apply inline-flex;
  458. @apply font-sans;
  459. @apply text-tiny;
  460. @apply bg-divider;
  461. @apply rounded;
  462. @apply ml-2;
  463. @apply px-1;
  464. @apply min-w-5;
  465. @apply min-h-5;
  466. @apply items-center;
  467. @apply justify-center;
  468. @apply border border-dividerDark;
  469. @apply shadow-sm;
  470. @apply <sm:hidden;
  471. }
  472. .capitalize-first {
  473. @apply first-letter:capitalize;
  474. }
  475. details {
  476. @apply select-none;
  477. }
  478. details summary::-webkit-details-marker {
  479. @apply hidden;
  480. }
  481. details summary .indicator {
  482. @apply transition;
  483. }
  484. details[open] summary .indicator {
  485. @apply transform;
  486. @apply rotate-90;
  487. }
  488. @media (max-width: 767px) {
  489. main {
  490. margin-bottom: env(safe-area-inset-bottom);
  491. }
  492. }
  493. .env-highlight {
  494. @apply text-accentContrast;
  495. &.env-found {
  496. @apply bg-accentDark;
  497. @apply hover:bg-accent;
  498. }
  499. &.env-not-found {
  500. @apply bg-red-500;
  501. @apply hover:bg-red-600;
  502. }
  503. }
  504. #nprogress .bar {
  505. @apply bg-accent #{!important};
  506. }
  507. .color-picker[type="color"] {
  508. @apply appearance-none;
  509. }
  510. .color-picker[type="color"]::-webkit-color-swatch-wrapper {
  511. @apply rounded;
  512. @apply p-0;
  513. }
  514. .color-picker[type="color"]::-webkit-color-swatch {
  515. @apply rounded;
  516. @apply border-0;
  517. }
  518. .gql-operation-not-highlight {
  519. @apply opacity-50;
  520. }
  521. .gql-operation-highlight {
  522. @apply opacity-100;
  523. }