goku-css

中文文档
9.0.9发布于 2026/11/04MITCommonJS零依赖

CSS Framework

原始使用文档
文档目录5 节
  1. Getting started
  2. CDN
  3. Package manager
  4. Theming
  5. Development

Goku CSS framework

A small, class-light CSS framework. Styles plain HTML elements, adds a handful of components and utilities, and stays out of your way. ~5 KB gzipped for everything.

Getting started

CDN

No build step — this serves the pre-bundled, minified stylesheet in a single request:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/goku-css">

Package manager

Install with pnpm add goku-css (or npm / yarn), then pick one of:

// Everything, as source files — your bundler inlines the imports
import 'goku-css'

// Pre-bundled and minified, if you'd rather skip that step
import 'goku-css/bundle'

// Or cherry-pick only what you need
import 'goku-css/css/variables.css'
import 'goku-css/css/elements/button.css'

The bare goku-css entry resolves to the source css/goku.css so your bundler can tree-shake, minify, and apply your own PostCSS/Lightning CSS config. CDNs resolve the same package name to the pre-built docs/index.css instead, since a browser following a chain of @imports would otherwise pay for a request waterfall.

Theming

Everything is a custom property on :root. Override the ones you care about:

:root {
  --g-primary: #6d28d9;
  --g-primary-contrast: #fff;
  --g-border-radius: 4px;
}

Colours use light-dark(), so a single declaration covers both schemes. See css/variables.css for the full list.

Development

  • pnpm dev — docs site with hot reload
  • pnpm build — rebuild docs/
  • pnpm lint — stylelint

版本与发布记录

goku-css 共发布 173 个版本,首次发布于 2018/05/04;过去 12 个月发布了 16 个版本。

版本发布日期距今
9.0.9latest2026/11/04今天
9.0.82026/09/241 个月前
9.0.72026/09/032 个月前
9.0.62026/08/222 个月前
9.0.52026/08/212 个月前
9.0.42026/08/102 个月前

关于 goku-css 的常见问题

goku-css 是什么?

CSS框架

如何安装 goku-css?

在项目目录运行 npm install goku-css,或使用 pnpm add / yarn add / bun add。

goku-css 支持 TypeScript 吗?

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

goku-css 支持 ESM 还是 CommonJS?

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

goku-css 可以商用吗?

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

goku-css 还在维护吗?

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