Feat rn atomic css#1788
Open
CommanderXL wants to merge 190 commits into
Open
Conversation
…-atomic-css-upgrade
feat: upgrade unocss
hiyuki
reviewed
Mar 24, 2026
| @@ -0,0 +1,345 @@ | |||
| # 跨端输出基础 | |||
hiyuki
reviewed
Mar 24, 2026
|
|
||
| return { | ||
| mergeToLayer, | ||
| layerMap, |
hiyuki
reviewed
Mar 24, 2026
| if (Object.keys(classMapValue).length) { | ||
| const layerObj = layer ? { _layer: layer } : {} | ||
| if (key.endsWith('!')) { | ||
| layerObj._layer = '"important"' |
hiyuki
reviewed
May 6, 2026
| // set css layer | ||
| if (layer) { | ||
| if (key.endsWith('!')) layer = '"important"' | ||
| classMap[key]._layer = layer |
Collaborator
There was a problem hiding this comment.
统一成_important或者_layers额外属性进行处理吧,并且可以覆盖到内联style
hiyuki
reviewed
Jun 10, 2026
| mergeToLayer(l, v._inlineLayer[l]) | ||
| }) | ||
| } | ||
| isNativeStyle ? layer.push(v) : Object.assign(layer, v) |
Collaborator
There was a problem hiding this comment.
最终得到的样式对象中会包含_inlineLayer属性么?
hiyuki
reviewed
Jun 10, 2026
| const transformed = {} | ||
| Object.keys(styleObj).forEach((prop) => { | ||
| transformed[prop] = formatValue(styleObj[prop]) | ||
| const v = formatValue(styleObj[prop]) |
hiyuki
reviewed
Jun 10, 2026
| // | ||
| // 真正承载样式的 entry(如 `border-color: rgba(...) !important`)的 `!important` | ||
| // 后缀我们保持原样:mpx PostCSS pipeline 会基于 `decl.important` 读取并搬到 | ||
| // `_inlineLayer.important` 里,再由 `transformStyleObj` 通过 `endsWith('!important')` |
hiyuki
reviewed
Jun 10, 2026
| } | ||
| } | ||
|
|
||
| const mergeToLayer = (name, ...classObjs) => { |
hiyuki
reviewed
Jun 15, 2026
|
|
||
| const createLayer = (isNativeStyle) => { | ||
| const layerMap = { | ||
| preflight: isNativeStyle ? [] : {}, |
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.