styles.scss 12 KB

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