fix(sheet): define variant-only colors, pick color schemes by name and check token names - #698
Merged
Merged
Conversation
…d check token names A color only one variant defines was never emitted, every non-default variant forced color-scheme:dark, typography dropped fontStyle and textTransform, $tokens with dashes broke into var(--text)-primary, dotted length and shadow names were declared with dots but referenced with dashes, and colliding or unreachable token names silently produced CSS the browser drops. Refs #685. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
21 tasks
Contributor
Changepacks@devup-ui/wasm@1.0.82 → 1.0.83 - bindings/devup-ui-wasm/package.jsonPatch
@devup-ui/bun-plugin@1.0.21 → 1.0.22 - packages/bun-plugin/package.jsonPatch
@devup-ui/components@0.1.59 → 0.1.60 - packages/components/package.jsonPatch
@devup-ui/next-plugin@1.0.89 → 1.0.90 - packages/next-plugin/package.jsonPatch
@devup-ui/plugin-utils@1.0.16 → 1.0.17 - packages/plugin-utils/package.jsonPatch
@devup-ui/rsbuild-plugin@1.0.66 → 1.0.67 - packages/rsbuild-plugin/package.jsonPatch
@devup-ui/vite-plugin@1.0.72 → 1.0.73 - packages/vite-plugin/package.jsonPatch
@devup-ui/webpack-plugin@1.0.70 → 1.0.71 - packages/webpack-plugin/package.jsonPatch
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
전수조사 #682의 작업 묶음 E(#685) 중 theme 출력 부분을 해결합니다: CSS-03, CSS-04, CSS-05, CSS-06, CSS-07, 그리고 조사 후 새로 찾은 버그 2건.
문제
default가 아닌 theme은 이름과 상관없이 모두color-scheme:dark였습니다.bluetheme을 켜면 폼과 스크롤바까지 어두워졌습니다.a-b와a.b처럼 같은 CSS 변수가 되는 token이 조용히 하나로 합쳐졌습니다.${bad}나a b처럼 브라우저가 버리는 token 이름을 그대로 출력했습니다.fontStyle,textTransform이 무시되었습니다. bindings 테스트 데이터의fontStyle: "normal"도 버려지고 있었습니다.$text-primary처럼 대시가 들어간 token이var(--text)-primary로 깨졌습니다.--len.only로 선언되는데 참조는var(--len-only)여서 어긋났습니다.변경
dark인 theme만 다크로 봅니다. 다른 이름은 devup.json의 새 설정theme.colorScheme({ "midnight": "dark" })으로 지정합니다.light-dark()사용 조건: "라이트 기본 + 다크 theme 하나"일 때만 씁니다. 그 밖의 조합은 theme별로 다른 값과 그 theme에만 있는 token을 출력합니다. 기존에 가장 흔한default+dark조합의 출력은 그대로입니다.$token문법으로 참조 가능한지 확인합니다. 문법은 영숫자나_로 시작하고 영숫자,-,_,.만 씁니다.theme.colors.<variant>: ...처럼 위치를 붙여registerTheme오류로 알립니다.[data-theme="high contrast"]처럼 따옴표로 감쌉니다.fontStyle과textTransform을 출력합니다(반응형 포함).VAR_RE:\$\w[\w.-]*로 바꿔 대시 token을 참조할 수 있게 했습니다.$-는 기존대로 token이 아닙니다.HashMap에서BTreeMap으로 바꿨습니다. native에서 실행마다 달라질 수 있던 변수 순서가 고정됩니다.DevupTheme에colorScheme,breakpoints,textTransform을 추가하고, colors 문서와 Patch changepack을 갱신했습니다.새로 생기는 오류
registerTheme: 참조할 수 없는 token 이름, 그리고 한 theme 안에서 같은 CSS 변수가 되는 두 token검증
cargo clippy --workspace --all-targets -D warnings,cargo test --workspace통과bun test5474개 통과(커버리지 100%)blue와solarized는 라이트, theme에만 있는 token이 정의됨,font-style과text-transform출력$text-primary는var(--text-primary)로, 점 표기 length는--len-only로 선언과 참조가 일치함