styles.scss 13 KB

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