@cmsgov/design-system-core

中文文档
3.7.2发布于 2020/07/08SEE LICENSE IN LICENSE.mdCommonJS近 30 天下载 2501

Core Sass/CSS and React design system assets

此软件包已被标记为弃用

This package has been deprecated in favor of @cmsgov/design-system. See the CMSDS docs (https://design.cms.gov/startup/migrating-v2) for more information.

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Examples
  4. Bugs and contributions
  5. File Structure

This package contains the following design system assets:

  • Base styles
  • Utility classes
  • Sass/CSS and React components
  • Sass mixins and variables
  • Fonts and images

Installation

npm install --save @cmsgov/design-system-core

Usage

The source files included are written in Sass (.scss). You can add your node_modules directory to your Sass includePaths and import the file like this:

@import '@cmsgov/design-system-core/src/index';

or import the transpiled CSS:

@import '@cmsgov/design-system-core/dist/index.css';

Please view the documentation site for additional information.

Examples

Examples of the design system in use can be found in the examples directory on GitHub.

Bugs and contributions

Please submit an issue on GitHub for any bugs or feature requests.

You can also read our CONTRIBUTING.md document to learn about setting up a local development environment, contributing to the design system, and our coding guidelines.

File Structure

The design system follows a variation of ITCSS (Inverted Triangle architecture for CSS). The goal is to write CSS in specificity order.

├── dist                Compiled CSS and JS
├── fonts
├── images
└── src                 Non-compiled Sass and JSX
    ├── base            Base HTML styles
    ├── components      Sass and React components
    │   ├── Button
    │   └── etc...
    ├── generics        Far reaching selectors
    └── utilities       Functional CSS classes to apply individual traits

版本与发布记录

@cmsgov/design-system-core 共发布 81 个版本,首次发布于 2017/03/09;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.7.2latest2020/07/086 年前
3.7.12020/07/086 年前
3.7.02020/03/196 年前
3.6.12020/03/076 年前
3.6.02020/02/206 年前
3.5.12020/02/056 年前

其他发布通道:next → 1.17.2-beta.4。

关于 @cmsgov/design-system-core 的常见问题

@cmsgov/design-system-core 是什么?

Core Sass/CSS and React design system assets注意:该包已被作者标记为弃用——This package has been deprecated in favor of @cmsgov/design-system. See the CMSDS docs (https://design.cms.gov/startup/migrating-v2) for more information.

如何安装 @cmsgov/design-system-core?

在项目目录运行 npm install @cmsgov/design-system-core,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^15.0.0 || ^16.0.0)、react-dom(^15.0.0 || ^16.0.0)、prop-types(^15.0.0 || ^16.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cmsgov/design-system-core 支持 TypeScript 吗?

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

@cmsgov/design-system-core 支持 ESM 还是 CommonJS?

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

@cmsgov/design-system-core 可以商用吗?

@cmsgov/design-system-core 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@cmsgov/design-system-core 的下载量有多少?

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

@cmsgov/design-system-core 还在维护吗?

最新版本 3.7.2 发布于 2020/07/08(6 年前);至今共发布 81 个版本,其中过去 12 个月发布了 0 个;首次发布于 2017/03/09。作者已将其标记为弃用,新项目建议寻找替代方案。