@glassesusa/dsm

中文文档
4.6.2发布于 2026/02/18ISCCommonJS近 30 天下载 5695

The full documentation for the system can be found at https://glassesusa.github.io/dsm-docs/

原始使用文档
文档目录7 节
  1. Documentation
  2. Installation
  3. Usage
  4. NPM
  5. Magento
  6. Contributing
  7. License

GlassesUSA - Design System

This is an adapted version of the React DSM for static HTML sites.

Documentation

The full documentation for the system can be found at https://glassesusa.github.io/dsm-docs/

Installation

Using the package manager npm to install it.

npm install @glassesusa/dsm

or

yarn add @glassesusa/dsm

Using a CDN to install it.

 <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/glassesUSA/dsm@latest/dist/styles.css">
 <script type="module" src="https://cdn.jsdelivr.net/gh/glassesUSA/dsm@latest/dist/dsm-effects.js"></script>

Usage

NPM

Styles

@import "@glassesusa/dsm/dist/styles.css";

Scripts

import { loadElements } from '@glassesusa/dsm/dist/dsm-effects'

Magento

Magento automatically deletes scripts so the script needs to be inserted using a script on page load.

 <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/glassesUSA/dsm@latest/dist/styles.css">
 <script>
     var insertScript = document.createElement("script");
     insertScript.src =
         'https://cdn.jsdelivr.net/gh/glassesUSA/dsm@latest/dist/dsm-effects.js'
     insertScript.type = 'module'
     document.head.appendChild(insertScript)
 </script>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

版本与发布记录

@glassesusa/dsm 共发布 85 个版本,首次发布于 2021/10/06;过去 12 个月发布了 3 个版本。

版本发布日期距今
4.6.2latest2026/02/188 个月前
4.6.12026/02/188 个月前
4.6.02026/02/178 个月前
4.5.92025/11/141 年前
4.5.82025/11/141 年前
4.5.72025/11/141 年前

关于 @glassesusa/dsm 的常见问题

@glassesusa/dsm 是什么?

The full documentation for the system can be found at https://glassesusa.github.io/dsm-docs/

如何安装 @glassesusa/dsm?

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

@glassesusa/dsm 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/glassesusa__dsm 是否存在。

@glassesusa/dsm 支持 ESM 还是 CommonJS?

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

@glassesusa/dsm 可以商用吗?

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

@glassesusa/dsm 的下载量有多少?

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

@glassesusa/dsm 还在维护吗?

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