mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
19c7c2929b
Reverts facebook/react#26631 This got specced: https://github.com/w3c/csswg-drafts/pull/9699 I left msZoom because it seems plausible someone will still be using it for backwards compat.
89 lines
1.8 KiB
JavaScript
89 lines
1.8 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
/**
|
|
* CSS properties which accept numbers but are not in units of "px".
|
|
*/
|
|
const unitlessNumbers = new Set([
|
|
'animationIterationCount',
|
|
'aspectRatio',
|
|
'borderImageOutset',
|
|
'borderImageSlice',
|
|
'borderImageWidth',
|
|
'boxFlex',
|
|
'boxFlexGroup',
|
|
'boxOrdinalGroup',
|
|
'columnCount',
|
|
'columns',
|
|
'flex',
|
|
'flexGrow',
|
|
'flexPositive',
|
|
'flexShrink',
|
|
'flexNegative',
|
|
'flexOrder',
|
|
'gridArea',
|
|
'gridRow',
|
|
'gridRowEnd',
|
|
'gridRowSpan',
|
|
'gridRowStart',
|
|
'gridColumn',
|
|
'gridColumnEnd',
|
|
'gridColumnSpan',
|
|
'gridColumnStart',
|
|
'fontWeight',
|
|
'lineClamp',
|
|
'lineHeight',
|
|
'opacity',
|
|
'order',
|
|
'orphans',
|
|
'scale',
|
|
'tabSize',
|
|
'widows',
|
|
'zIndex',
|
|
'zoom',
|
|
'fillOpacity', // SVG-related properties
|
|
'floodOpacity',
|
|
'stopOpacity',
|
|
'strokeDasharray',
|
|
'strokeDashoffset',
|
|
'strokeMiterlimit',
|
|
'strokeOpacity',
|
|
'strokeWidth',
|
|
'MozAnimationIterationCount', // Known Prefixed Properties
|
|
'MozBoxFlex', // TODO: Remove these since they shouldn't be used in modern code
|
|
'MozBoxFlexGroup',
|
|
'MozLineClamp',
|
|
'msAnimationIterationCount',
|
|
'msFlex',
|
|
'msZoom',
|
|
'msFlexGrow',
|
|
'msFlexNegative',
|
|
'msFlexOrder',
|
|
'msFlexPositive',
|
|
'msFlexShrink',
|
|
'msGridColumn',
|
|
'msGridColumnSpan',
|
|
'msGridRow',
|
|
'msGridRowSpan',
|
|
'WebkitAnimationIterationCount',
|
|
'WebkitBoxFlex',
|
|
'WebKitBoxFlexGroup',
|
|
'WebkitBoxOrdinalGroup',
|
|
'WebkitColumnCount',
|
|
'WebkitColumns',
|
|
'WebkitFlex',
|
|
'WebkitFlexGrow',
|
|
'WebkitFlexPositive',
|
|
'WebkitFlexShrink',
|
|
'WebkitLineClamp',
|
|
]);
|
|
export default function (name: string): boolean {
|
|
return unitlessNumbers.has(name);
|
|
}
|