Merged
Conversation
evvis
reviewed
Dec 24, 2025
| }; | ||
| } | ||
|
|
||
| presetTokens.semantic = { ...presetTokens.semantic, ...sizingBase }; |
There was a problem hiding this comment.
Как будто лучше избегать подобных мутаций
Collaborator
Author
There was a problem hiding this comment.
оригинальный объект нам не нужен. нас тут интересует только конечный набор токенов
evvis
reviewed
Dec 24, 2025
src/prime-preset/map-tokens.ts
Outdated
Comment on lines
29
to
33
| const semanticLink: any = presetTokens.semantic; | ||
|
|
||
| const sizingSmLink: any = sizingSm; | ||
| const sizingLgLink: any = sizingLg; | ||
| const sizingXlgLink: any = sizingXlg; |
Collaborator
Author
There was a problem hiding this comment.
расписывать всё многообразие токенов не вижу смысла. их там прям много... в самом прайме типизация есть для этих штук, но она не экспортируется...
evvis
reviewed
Dec 24, 2025
src/prime-preset/map-tokens.ts
Outdated
Comment on lines
35
to
51
| for (const key in sizingSm) { | ||
| if ((semanticLink)[key]) { | ||
| semanticLink[key].sm = sizingSmLink[key]?.root ? sizingSmLink[key].root : sizingSmLink[key]; | ||
| } | ||
| } | ||
|
|
||
| for (const key in sizingLg) { | ||
| if ((semanticLink)[key]) { | ||
| semanticLink[key].lg = sizingLgLink[key]?.root ? sizingLgLink[key].root : sizingLgLink[key]; | ||
| } | ||
| } | ||
|
|
||
| for (const key in sizingXlg) { | ||
| if ((semanticLink)[key]) { | ||
| semanticLink[key].xlg = sizingXlgLink[key]?.root ? sizingXlgLink[key].root : sizingXlgLink[key]; | ||
| } | ||
| } |
There was a problem hiding this comment.
Suggested change
| for (const key in sizingSm) { | |
| if ((semanticLink)[key]) { | |
| semanticLink[key].sm = sizingSmLink[key]?.root ? sizingSmLink[key].root : sizingSmLink[key]; | |
| } | |
| } | |
| for (const key in sizingLg) { | |
| if ((semanticLink)[key]) { | |
| semanticLink[key].lg = sizingLgLink[key]?.root ? sizingLgLink[key].root : sizingLgLink[key]; | |
| } | |
| } | |
| for (const key in sizingXlg) { | |
| if ((semanticLink)[key]) { | |
| semanticLink[key].xlg = sizingXlgLink[key]?.root ? sizingXlgLink[key].root : sizingXlgLink[key]; | |
| } | |
| } | |
| function applySizing( | |
| semantic: SemanticTokens, | |
| sizing: Record<string, any>, | |
| sizeKey: 'sm' | 'lg' | 'xlg' | |
| ) { | |
| Object.keys(sizing).forEach(key => { | |
| if (semantic[key]) { | |
| semantic[key][sizeKey] = | |
| sizing[key]?.root ?? sizing[key]; | |
| } | |
| }); | |
| }); | |
| for (const key in sizing) { | |
| if (semantic[key]) { | |
| semantic[key][sizeKey] = | |
| sizing[key]?.root ?? sizing[key]; | |
| } | |
| } | |
| } | |
| applySizing(semanticLink, sizingSm, 'sm'); | |
| applySizing(semanticLink, sizingLg, 'lg'); | |
| applySizing(semanticLink, sizingXlg, 'xlg'); |
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.
No description provided.