styles.scss 12 KB

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