Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Enhance component API with responsive props, color propagation, and typography utilities

未关闭
#650 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
react, typescript
领域
design, frontend

调研方向

首先阅读现有的 layout、visual component、Text、Headline 和 Button API,以识别当前的 prop 和颜色模式。盘点受影响的组件,并根据所请求的响应式 props、间距简写、颜色传递、对比度行为、排版工具以及 Section 尺寸变体定义完成标准;该 issue 未指定具体文件或测试。

由索引模型根据 Issue 内容生成。

描述

global triage

Summary

Enhance Apsara's component-level APIs to improve developer experience, reduce boilerplate, and provide consistent patterns across the library.

1. Responsive Props on Layout Components

Add responsive object syntax to all layout prop values (gap, direction, padding, etc.):

<Flex gap={{ initial: "3", md: "5" }} direction={{ initial: "column", sm: "row" }}>

Support breakpoints: initial, sm, md, lg, xl.

2. Inline Spacing Props

Add shorthand padding/margin props (p, px, py, pt, pr, pb, pl, m, mx, my, mt, mr, mb, ml) to layout components that map to the space scale:

<Box p="4" mx="auto" mt="6">
3. Systematic color Prop

Extend the color prop to all visual components (Badge, Callout, Text, Avatar, Chip, etc.), not just Button. Color should propagate to children through nesting, automatically adjusting internal tokens.

4. highContrast Prop

Add a highContrast boolean to all components that accept a color prop. This shifts colors to steps 9–12 of the scale for better contrast against the page background.

5. Typography Utility Props

Add the following props to Text and Headline:

  • trim — remove leading/trailing whitespace for precise vertical alignment
  • truncate — single-line ellipsis truncation
  • wrap — control text wrapping (wrap, nowrap, balance, pretty)
  • align — text alignment (left, center, right)
  • Expand font weight options to 4 levels: light (300), regular (400), medium (500), bold (700)
6. Section Layout Component

Add a Section component for consistent vertical spacing between major page sections, with predefined size variants (small, medium, large).

主要语言
TypeScript
星标
70
派生
13
平均合并
8 天 56 分钟
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

raystack/apsara 的其他 Issue

查看 raystack/apsara 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。