patternfly / patternfly/patternfly-react

Revamp react-tokens logic

未关闭
#10,212 9 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

PF Team Spike Stale
主要语言
TypeScript
星标
862
派生
392
平均合并
4 天 8 小时
30 天内合并 PR
9

描述

Describe the enhancement or change
Our token generation in the react-tokens package needs to be reworked as the logic we use to determine css var values doesn't match 1:1 with how that value will be determined in browser, this can lead to build breaking bugs with recursively defined values.

We've implemented a temporary fix for this, but it is still not optimal as differences in behavior could occur if a var is defined multiple times in a stylesheet. Ideally we should only parse the css within the root selector of the stylesheet.

Additionally, core currently has to add some variables to the root scope for the sole purpose of having the token created in react-tokens, ideally this will not be required in the future.


Jira Issue: PF-92

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先定位 react-tokens 包及其临时的 token 生成修复,然后检查 core 如何向根作用域添加变量。将该包对 CSS 变量的解析与浏览器行为进行比较,尤其要关注递归定义或重复定义的变量。完成的标准是根作用域解析与浏览器解析一致,并且 core 不再需要仅用于创建 token 的额外变量。

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

评估

技术栈
react, typescript
领域
build-system, frontend
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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