Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

4.4 KB
Raw Blame
/* Linked, not inlined in index.html: release builds hash inline <style> blocks into the CSP,
   which voids style-src 'unsafe-inline' and blocks the editor's runtime-injected styles. */
/* Start-up splash over the page until the window's launch project is open (platform/splash.ts).
   Until tokens load, the colours are the last theme's --bg-frame / --fg-muted that boot.js
   restored as --boot-*, else these built-in ones; the bar keeps the last --accent throughout. */
/* Not on html: the canvas then takes body's (themed) background, which a fast resize shows before relayout. */
body,
.splash {
  background: var(--bg-frame, var(--boot-frame, #e9eaee));
}
:root[data-theme="dark"] :is(body, .splash) {
  background: var(--bg-frame, var(--boot-frame, #26282c));
}
:root:is([data-theme="dark-hc"], [data-theme="dark"][data-contrast="high"]) :is(body, .splash) {
  background: var(--bg-frame, var(--boot-frame, #1a1b1e));
}
.splash {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--splash-gap, 14px);
  padding-bottom: var(--splash-offset, 38px);
  box-sizing: border-box;
  color: var(--fg-muted, var(--boot-fg, #6c707e));
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
  animation: splash-in 240ms ease-out 120ms both;
  transition: opacity 160ms ease-out;
}
.splash.splash-out {
  opacity: 0;
  pointer-events: none;
}
:root[data-theme^="dark"] .splash {
  color: var(--fg-muted, var(--boot-fg, #8c8f95));
}
.splash-logo {
  width: var(--splash-logo-size, 56px);
  height: var(--splash-logo-size, 56px);
}
/* 15px Inter: 2048 units per em, the line box from ascender to descender. */
.splash-wordmark {
  width: 73.2px;
  height: 18.15px;
}
.splash-bar {
  width: var(--splash-bar-width, 120px);
  height: var(--splash-bar-height, 2px);
  border-radius: 1px;
  overflow: hidden;
  background: rgb(127 127 127 / 0.18);
}
/* Fake progress: eases towards ~90% over the 4 s cap; hideSplash() fills it before fading out.
   The remembered accent comes first: tokens.css brings the theme's default --accent before
   settings restore a custom one, which would flash the default mid-load. */
.splash-bar > i {
  display: block;
  height: 100%;
  background: var(--boot-accent, var(--accent, #3871e1));
  transform-origin: left;
  animation: splash-fill var(--splash-progress-duration, 4s)
    var(--splash-progress-easing, cubic-bezier(0.1, 0.7, 0.3, 1)) both;
}
/* Settings window: a dialog, not a launch. Only the bar, and only if loading takes a while. */
:root[data-window="settings"] .splash:not(.boot-error) {
  animation-delay: 400ms;
}
:root[data-window="settings"] .splash:not(.boot-error) > :not(.splash-bar) {
  display: none;
}
@keyframes splash-in {
  from {
    opacity: 0;
  }
}
@keyframes splash-fill {
  from {
    transform: scaleX(0.04);
  }
  to {
    transform: scaleX(0.92);
  }
}
/* The fill stays: it grows in place, which reduced motion allows. */
@media (prefers-reduced-motion: reduce) {
  .splash {
    animation: none;
  }
}

.splash.boot-error {
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  padding: 32px max(24px, calc((100vw - 560px) / 2));
  overflow: auto;
  animation: none;
  font: var(--fs-ui, 13px) / 1.5 var(--font-ui, system-ui, sans-serif);
  -webkit-user-select: text;
  user-select: text;
}
.boot-error h1 {
  margin: 0;
  color: var(--fg, inherit);
  font-size: 20px;
  font-weight: 600;
}
.boot-error p {
  margin: 0;
}
.boot-error textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 140px;
  height: 180px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--border-strong, currentColor);
  border-radius: var(--radius-control, 4px);
  background: var(--bg-input, transparent);
  color: inherit;
  font: 12px / 1.5 var(--font-mono, monospace);
}
.boot-error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.boot-error button {
  padding: 6px 12px;
  border: 1px solid var(--border-strong, currentColor);
  border-radius: var(--radius-control, 4px);
  background: var(--bg-elev, transparent);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.boot-error button:hover {
  background: var(--bg-hover, transparent);
}
.boot-error a {
  color: var(--link, inherit);
  text-underline-offset: 3px;
}
.boot-error :is(button, a, textarea):focus-visible {
  outline: 2px solid var(--focus-ring, var(--boot-accent, currentColor));
  outline-offset: 2px;
}