Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(normalizaProp): support css variable as number #6636

Merged
merged 5 commits into from
Nov 8, 2022

Conversation

btea
Copy link
Contributor

@btea btea commented Sep 9, 2022

fix #6625

@LinusBorg LinusBorg added ready to merge The PR is ready to be merged. 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Sep 17, 2022
@@ -63,6 +63,7 @@ export const isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(
`grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
`grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
`line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
`-webkit-line-clamp,` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only adding this doesn't make sense, since every property here are non-prefixed standard properties. There are most likely other prefixed versions of some other properties that can be treated as numbers, and it is impractical for us to support all of them.

I think just supporting custom properties is good enough in this PR. Whether we want to support vendor-prefixed properties is a separate problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll remove it.

@yyx990803
Copy link
Member

I decided to remove the unit check altogether since due to vendor prefixes and custom properties, the check seems to be unnecessarily strict for little value (for the end user, the browser render result will be the same).

@yyx990803 yyx990803 merged commit 79e7c1e into vuejs:main Nov 8, 2022
@btea btea deleted the fix/ssr-render-css-var branch November 8, 2022 05:38
chrislone pushed a commit to chrislone/core that referenced this pull request Feb 4, 2023
Previously this prevented custom properties and vendor-prefixed properties to be rendered correctly.

fix vuejs#6625
zhangzhonghe pushed a commit to zhangzhonghe/core that referenced this pull request Apr 12, 2023
Previously this prevented custom properties and vendor-prefixed properties to be rendered correctly.

fix vuejs#6625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready to merge The PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Style attributes with numeric values are not rendered on server side
6 participants