MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / stripDefaultTextStyles

Function stripDefaultTextStyles

packages/extension/utils/css.ts:1112–1122  ·  view source on GitHub ↗
(style: Record<string, string>)

Source from the content-addressed store, hash-verified

1110)
1111
1112export function stripDefaultTextStyles(style: Record<string, string>): Record<string, string> {
1113 const cleaned: Record<string, string> = {}
1114 Object.entries(style).forEach(([key, value]) => {
1115 const defaultValue = TEXT_STYLE_DEFAULTS.get(key)
1116 if (defaultValue && canonicalizeValue(key, defaultValue) === canonicalizeValue(key, value)) {
1117 return
1118 }
1119 cleaned[key] = value
1120 })
1121 return cleaned
1122}
1123
1124export function pruneInheritedTextStyles(
1125 style: Record<string, string>,

Callers 4

css.test.tsFile · 0.90
renderNodeFunction · 0.90
renderTextSegmentsFunction · 0.90
buildInlineTreeFunction · 0.90

Calls 2

canonicalizeValueFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected