@glimstone/core

中文文档
4.5.4发布于 2026/11/16AGPL-3.0-onlyTypeScriptES Module近 30 天下载 5423

GlimStone's tokens, glyphs and engines, without a framework

原始使用文档

@glimstone/core

The part of GlimStone that needs no framework: the tokens, the glyphs, and the logic of every engine and component. @glimstone/react and @glimstone/vue are thin wrappers around it, and a page without a framework, such as an Unraid plugin, uses it directly.

npm install @glimstone/core
  • tokens.css is the palette and every component class as CSS custom properties, where the shape, colour and motion engines resolve to values. Load it before the app's own stylesheet. tailwind-theme.css maps the tokens onto Tailwind v4 utilities for an app that uses Tailwind.
  • glyphs.json and glyphs.md are the glyph assortment: which mark means what, where each comes from, and the sizing rules that make them one set.
  • The engines: appearance (shape, accent, rainbow, motion), theme (OLED and whether dark is showing), contrast (the inks that hold 4.5:1), browserAccent (the browser as a source for the system accent), controls (the label engine and its width stages) and setStoragePrefix, which keeps an app's own names for what it stores.
  • What a component shows, as functions: buttonView, badgeClassName, the select's list model, the Info tile's version links and update check, the README button's classes, where a bubble goes, a dialog's keys and the toast queue.
  • What a text field and its row share: textFieldClass and fieldWidthClass say how a field looks and how wide it is, pressRowControl does what a click on a row's label does, treeRows and treeStep hold a tree's rows and keys, and tableCellClass says what a table's cell wears.
  • The sign-in card's flow: createSignInFlow keeps what was typed and which form shows while the app answers each step, signInTextEn holds the English words, and showRefusal shakes the button of a refused try and selects the refused field.
  • The fortress in the Instances tab: createFortressFlow runs the windows to join with the phrase, leave, remove an instance and show or change the phrase, enterWords spreads a pasted phrase over its twelve fields, qrCode draws the phrase as a QR code in one SVG path, appCardView says what another app's card shows, and fortressText(lang) hands out the words in every language of the glossary, each also a module of its own under fortressLocales/.
  • What windows and menus share: windowFoot adds the way out, stackWindow gives Escape and Tab to the window in front, and menu.ts holds the menu model with tidyMenu, menuRowView, placeMenu, menuMove, focusFirstMenuRow and claimMenu. menuIsOpen and windowIsOpen tell an app's own key handler to stand back.
  • What fields and bars share: meterView and progressView for a Meter and a ProgressBar, copyText with its fallback for plain http, and for the ColorPicker floatColorPicker, placeColorPicker and nearestColorName, which finds the closest name in OKLab in a list such as COLOR_NAMES_DE.
  • Where a dragged item goes: dropIndex places it among the others by its leading edge, along a row, down a column or line by line in a grid.
  • What runs without a framework: mountSelect, wireTooltips with infoIcon, openColorPickerPopover, attachNumberSteppers, enableSelectScroll and flagEmoji.

The whole language, with the reasons behind each rule, is in docs/design-language.md.

版本与发布记录

@glimstone/core 共发布 22 个版本,首次发布于 2026/11/04;过去 12 个月发布了 22 个版本。

版本发布日期距今
4.5.4latest2026/11/16今天
4.5.32026/11/16今天
4.5.22026/11/161 天前
4.5.12026/11/151 天前
4.5.02026/11/151 天前
4.4.12026/11/142 天前

关于 @glimstone/core 的常见问题

@glimstone/core 是什么?

GlimStone's tokens, glyphs and engines, without a framework

如何安装 @glimstone/core?

在项目目录运行 npm install @glimstone/core,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 glimstone-drift、glimstone-migrate,可以用 npx glimstone-drift 直接运行。

@glimstone/core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@glimstone/core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@glimstone/core 可以商用吗?

@glimstone/core 使用 AGPL-3.0-only 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@glimstone/core 的下载量有多少?

根据 npm 官方下载统计,@glimstone/core 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,423 次,日均约 181 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@glimstone/core 还在维护吗?

最新版本 4.5.4 发布于 2026/11/16(今天);至今共发布 22 个版本,其中过去 12 个月发布了 22 个;首次发布于 2026/11/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。