@atlasauth/design

中文文档
0.3.0发布于 2026/10/24MITTypeScriptCommonJS近 30 天下载 1850

The Atlas design system: the structured design schema, presets, resolver, safe CSS compiler, contrast helpers and curated font list shared by Atlas hosted pages and SDK components.

原始使用文档

@atlasauth/design

The Atlas design system: one structured description of how an Atlas sign-in surface looks, shared by the hosted pages and every Atlas SDK component.

npm install @atlasauth/design

You rarely need this package directly — @atlasauth/react, @atlasauth/vue, @atlasauth/svelte, @atlasauth/angular and @atlasauth/embed use it to apply your dashboard design and the appearance.preset / appearance.design you pass in code. Use it when you want the types, the preset list or the compiler itself (for example to theme your own markup with the same --atlas-* variables).

import { resolveDesign, compileDesignCss, designDataAttributes, PRESET_IDS } from '@atlasauth/design';

const design = resolveDesign({ preset: 'midnight', palette: { primary: '#7c3aed' } });
const css = compileDesignCss(design, { scope: '.my-auth' });
const attrs = designDataAttributes(design); // { 'data-atlas-card': 'solid', ... }
  • Settings only, never CSS. Every field is a closed enum, a bounded number, a #RRGGBB colour or a catalog id. Invalid input is rejected (or, in the SDKs, dropped with a development warning) — it can never reach a stylesheet.
  • Presets: minimal, atlas, glass, midnight, editorial, terminal, sunrise, forest, grape, slate, split-photo, bold.
  • Variables: DESIGN_CSS_VARIABLES lists every --atlas-* custom property the compiler emits, with its type and description.
  • Fonts: FONT_CATALOG is the curated font list. Web fonts are self-hosted by Atlas; a visitor's browser never contacts a third-party font host.
  • Contrast: contrastRatio, readableOn, readableInk and designWarnings (WCAG AA checks for a resolved design).

Two entries. @atlasauth/design is everything, including the zod schemas and the dashboard validators (validateDesign, applyDesignPatch). @atlasauth/design/runtime is the zod-free subset a renderer needs — presets, resolveDesign/layerDesign, the compiler, data attributes, fonts, contrast and the SDK composition helpers — with hand-written input guards that accept exactly what the schema accepts. Use it where bundle size matters.

Runtime dependency: zod (full entry only). Works in browsers, Node, Deno, Bun and edge runtimes.

MIT licensed.

版本与发布记录

@atlasauth/design 共发布 4 个版本,首次发布于 2026/10/14;过去 12 个月发布了 4 个版本。

版本发布日期距今
0.3.0latest2026/10/2414 天前
0.2.02026/10/1623 天前
0.1.02026/10/1425 天前
0.0.0-stage2026/10/1425 天前

关于 @atlasauth/design 的常见问题

@atlasauth/design 是什么?

The Atlas design system: the structured design schema, presets, resolver, safe CSS compiler, contrast helpers and curated font list shared by Atlas hosted pages and SDK components.

如何安装 @atlasauth/design?

在项目目录运行 npm install @atlasauth/design,或使用 pnpm add / yarn add / bun add。

@atlasauth/design 支持 TypeScript 吗?

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

@atlasauth/design 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@atlasauth/design 可以商用吗?

@atlasauth/design 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@atlasauth/design 的下载量有多少?

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

@atlasauth/design 还在维护吗?

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