CSSPropertyOperations.js — react Source File
Architecture documentation for CSSPropertyOperations.js, a javascript file in the react codebase. 8 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR e3e314a2_4cee_1a10_2d68_791d5d66f89e["CSSPropertyOperations.js"] 7b18bdd9_5973_5784_e35a_5155f750387e["CSSShorthandProperty.js"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> 7b18bdd9_5973_5784_e35a_5155f750387e 3af39105_ac73_ac11_e339_aecf80d45947["hyphenateStyleName.js"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> 3af39105_ac73_ac11_e339_aecf80d45947 30c2463e_55b0_764b_3b35_078766f5cd6a["hyphenateStyleName"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> 30c2463e_55b0_764b_3b35_078766f5cd6a cfe6bc57_232a_91d7_3473_273355d04b5b["warnValidStyle.js"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> cfe6bc57_232a_91d7_3473_273355d04b5b a301cb19_309d_31b8_cdc3_598aa3af82be["warnValidStyle"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> a301cb19_309d_31b8_cdc3_598aa3af82be 200282dc_1ea2_631c_36a1_33723aacca7f["isUnitlessNumber.js"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> 200282dc_1ea2_631c_36a1_33723aacca7f 0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7["CheckStringCoercion"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> 0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7 25d84424_c947_b3a8_ce28_cc718040eca5["ReactFiberMutationTracking"] e3e314a2_4cee_1a10_2d68_791d5d66f89e --> 25d84424_c947_b3a8_ce28_cc718040eca5 1e990658_7cea_75be_1f24_2399bdf9f15b["ReactDOMComponent.js"] 1e990658_7cea_75be_1f24_2399bdf9f15b --> e3e314a2_4cee_1a10_2d68_791d5d66f89e style e3e314a2_4cee_1a10_2d68_791d5d66f89e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* 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.
*/
import {shorthandToLonghand} from './CSSShorthandProperty';
import hyphenateStyleName from '../shared/hyphenateStyleName';
import warnValidStyle from '../shared/warnValidStyle';
import isUnitlessNumber from '../shared/isUnitlessNumber';
import {checkCSSPropertyStringCoercion} from 'shared/CheckStringCoercion';
import {trackHostMutation} from 'react-reconciler/src/ReactFiberMutationTracking';
/**
* Operations for dealing with CSS properties.
*/
/**
* This creates a string that is expected to be equivalent to the style
* attribute generated by server-side rendering. It by-passes warnings and
* security checks so it's not safe to use this value for anything other than
* comparison. It is only used in DEV for SSR validation.
*/
export function createDangerousStringForStyles(styles) {
if (__DEV__) {
let serialized = '';
let delimiter = '';
for (const styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
const value = styles[styleName];
if (value != null && typeof value !== 'boolean' && value !== '') {
const isCustomProperty = styleName.indexOf('--') === 0;
if (isCustomProperty) {
if (__DEV__) {
checkCSSPropertyStringCoercion(value, styleName);
}
serialized += delimiter + styleName + ':' + ('' + value).trim();
} else {
if (
typeof value === 'number' &&
value !== 0 &&
!isUnitlessNumber(styleName)
) {
serialized +=
delimiter + hyphenateStyleName(styleName) + ':' + value + 'px';
} else {
if (__DEV__) {
checkCSSPropertyStringCoercion(value, styleName);
}
serialized +=
delimiter +
hyphenateStyleName(styleName) +
':' +
('' + value).trim();
}
}
// ... (200 more lines)
Domain
Subdomains
Functions
Dependencies
- CSSShorthandProperty.js
- CheckStringCoercion
- ReactFiberMutationTracking
- hyphenateStyleName
- hyphenateStyleName.js
- isUnitlessNumber.js
- warnValidStyle
- warnValidStyle.js
Source
Frequently Asked Questions
What does CSSPropertyOperations.js do?
CSSPropertyOperations.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in CSSPropertyOperations.js?
CSSPropertyOperations.js defines 6 function(s): createDangerousStringForStyles, expandShorthandMap, isValueEmpty, setValueForStyle, setValueForStyles, validateShorthandPropertyCollisionInDev.
What does CSSPropertyOperations.js depend on?
CSSPropertyOperations.js imports 8 module(s): CSSShorthandProperty.js, CheckStringCoercion, ReactFiberMutationTracking, hyphenateStyleName, hyphenateStyleName.js, isUnitlessNumber.js, warnValidStyle, warnValidStyle.js.
What files import CSSPropertyOperations.js?
CSSPropertyOperations.js is imported by 1 file(s): ReactDOMComponent.js.
Where is CSSPropertyOperations.js in the architecture?
CSSPropertyOperations.js is located at packages/react-dom-bindings/src/client/CSSPropertyOperations.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom-bindings/src/client).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free