nightshade-api 0.52.0

Procedural high level API for the nightshade game engine
Documentation
/* nightshade code surface: virtualized, foldable code viewer. */

.nightshade-code-surface-view {
  overflow: auto;
  border: 1px solid var(--nightshade-panel-border);
  border-radius: 9px;
  background: var(--nightshade-panel-2);
  font-family: var(--nightshade-mono);
  font-size: 13px;
  color: var(--nightshade-tok-plain);
}

.nightshade-code-surface-view .tok-keyword {
  color: var(--nightshade-tok-keyword);
}

.nightshade-code-surface-view .tok-string {
  color: var(--nightshade-tok-string);
}

.nightshade-code-surface-view .tok-number {
  color: var(--nightshade-tok-number);
}

.nightshade-code-surface-view .tok-comment {
  color: var(--nightshade-tok-comment);
  font-style: italic;
}

.nightshade-code-surface-view .tok-command {
  color: var(--nightshade-tok-command);
}

.nightshade-surface-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  white-space: pre;
}

.nightshade-surface-num {
  flex: 0 0 auto;
  width: 44px;
  text-align: right;
  color: var(--nightshade-text-dim);
  user-select: none;
}

.nightshade-surface-fold {
  flex: 0 0 auto;
  width: 12px;
  color: var(--nightshade-text-dim);
  cursor: pointer;
  user-select: none;
}

.nightshade-surface-fold.folded {
  transform: rotate(-90deg);
}

.nightshade-surface-fold-spacer {
  flex: 0 0 auto;
  width: 12px;
}

.nightshade-surface-text {
  flex: 1 1 auto;
}

.nightshade-surface-ellipsis {
  padding: 0 6px;
  color: var(--nightshade-text-dim);
}

/* multi-cursor editor */

.nightshade-ml {
  position: relative;
  overflow: auto;
  border: 1px solid var(--nightshade-panel-border);
  border-radius: 9px;
  background: var(--nightshade-panel-2);
  font-family: var(--nightshade-mono);
  font-size: 13px;
  color: var(--nightshade-tok-plain);
  outline: none;
  cursor: text;
}

.nightshade-ml:focus {
  border-color: var(--nightshade-accent);
}

.nightshade-ml .tok-keyword { color: var(--nightshade-tok-keyword); }
.nightshade-ml .tok-string { color: var(--nightshade-tok-string); }
.nightshade-ml .tok-number { color: var(--nightshade-tok-number); }
.nightshade-ml .tok-comment { color: var(--nightshade-tok-comment); font-style: italic; }
.nightshade-ml .tok-command { color: var(--nightshade-tok-command); }

.nightshade-ml-inner {
  position: relative;
  width: 100%;
}

.nightshade-ml-line {
  position: absolute;
  left: 0;
  right: 0;
  padding-left: 10px;
  white-space: pre;
  display: flex;
  align-items: center;
}

.nightshade-ml-caret {
  position: absolute;
  width: 2px;
  background: var(--nightshade-accent);
  animation: nightshade-ml-blink 1s step-end infinite;
}

@keyframes nightshade-ml-blink {
  50% { opacity: 0; }
}

.nightshade-ml-selection {
  position: absolute;
  background: var(--nightshade-accent-soft);
}

.nightshade-ml-ruler {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Hidden input sink: receives keystrokes, clipboard, and IME composition, so the
   editor gets native text input (including IME) while the visible layer is drawn
   by nightshade. Positioned at the primary caret so the IME candidate window follows. */
.nightshade-ml-sink {
  position: absolute;
  width: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  outline: none;
  resize: none;
  overflow: hidden;
  white-space: pre;
  font: inherit;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  opacity: 0;
}