nightshade-api 0.52.0

Procedural high level API for the nightshade game engine
Documentation
/* nightshade code editor: a textarea over a synced highlight layer. */

.nightshade-code-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--nightshade-panel-border);
  border-radius: 9px;
  background: var(--nightshade-panel-2);
  overflow: hidden;
  font-family: var(--nightshade-mono);
  font-size: 13px;
  line-height: 1.55;
}

.nightshade-code-editor.fill {
  flex: 1 1 0%;
  min-height: 0;
}

.nightshade-code-columns {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}

.nightshade-code-surface {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.nightshade-code-find {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--nightshade-panel-border);
  background: var(--nightshade-panel);
  font-family: var(--nightshade-font);
}

.nightshade-code-find-input {
  padding: 4px 8px;
  border: 1px solid var(--nightshade-panel-border);
  border-radius: 6px;
  background: var(--nightshade-input-bg);
  color: var(--nightshade-text);
  font: inherit;
  font-size: 12px;
}

.nightshade-code-find-input:focus {
  outline: none;
  border-color: var(--nightshade-accent);
}

.nightshade-code-find .nightshade-button {
  padding: 4px 8px;
  font-size: 12px;
}

.nightshade-code-gutter {
  flex: 0 0 auto;
  padding: 12px 8px 12px 12px;
  overflow: hidden;
  text-align: right;
  color: var(--nightshade-text-dim);
  background: color-mix(in srgb, var(--nightshade-panel-2) 60%, var(--nightshade-bg));
  border-right: 1px solid var(--nightshade-panel-border);
  user-select: none;
}

.nightshade-code-gutter-line {
  font-variant-numeric: tabular-nums;
}

.nightshade-code-gutter-line.error {
  color: var(--nightshade-danger);
  font-weight: 600;
}

.nightshade-code-highlight,
.nightshade-code-textarea {
  margin: 0;
  padding: 12px 14px;
  border: 0;
  white-space: pre;
  overflow: auto;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  tab-size: 2;
}

.nightshade-code-highlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--nightshade-tok-plain);
}

.nightshade-code-textarea {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--nightshade-text);
}

.nightshade-code-textarea:focus {
  outline: none;
}

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

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

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

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

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

.nightshade-code-editor .tok-plain {
  color: var(--nightshade-tok-plain);
}

/* multi-document tabs */

.nightshade-code-tabs {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.nightshade-code-tabbar {
  display: flex;
  gap: 2px;
  padding: 4px 4px 0;
  border-bottom: 1px solid var(--nightshade-panel-border);
  overflow-x: auto;
}

.nightshade-code-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 10px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  color: var(--nightshade-text-dim);
}

.nightshade-code-tab.active {
  background: var(--nightshade-panel-2);
  border-color: var(--nightshade-panel-border);
  color: var(--nightshade-text);
}

.nightshade-code-tab-label {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nightshade-code-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--nightshade-text-dim);
  cursor: pointer;
}

.nightshade-code-tab-close:hover {
  background: var(--nightshade-hover);
  color: var(--nightshade-text);
}

.nightshade-code-tab-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  padding-top: 8px;
}

.nightshade-code-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nightshade-text-dim);
}