Skip to content

fix(core): Added missing inheritance support for text css properties #10699

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

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/core/ui/text-base/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ export const formattedTextProperty: Property<TextBase, FormattedString>;
export const maxLinesProperty: InheritedCssProperty<Style, number>;
export const textAlignmentProperty: InheritedCssProperty<Style, CoreTypes.TextAlignmentType>;
export const textDecorationProperty: CssProperty<Style, CoreTypes.TextDecorationType>;
export const textTransformProperty: CssProperty<Style, CoreTypes.TextTransformType>;
export const textShadowProperty: CssProperty<Style, ShadowCSSValues>;
export const textStrokeProperty: CssProperty<Style, StrokeCSSValues>;
export const whiteSpaceProperty: CssProperty<Style, CoreTypes.WhiteSpaceType>;
export const textTransformProperty: InheritedCssProperty<Style, CoreTypes.TextTransformType>;
export const textShadowProperty: InheritedCssProperty<Style, ShadowCSSValues>;
export const textStrokeProperty: InheritedCssProperty<Style, StrokeCSSValues>;
export const whiteSpaceProperty: InheritedCssProperty<Style, CoreTypes.WhiteSpaceType>;
export const textOverflowProperty: CssProperty<Style, CoreTypes.TextOverflowType>;
export const letterSpacingProperty: CssProperty<Style, number>;
export const lineHeightProperty: CssProperty<Style, number>;
export const letterSpacingProperty: InheritedCssProperty<Style, number>;
export const lineHeightProperty: InheritedCssProperty<Style, number>;

//Used by tab view
// Used by tab view
export function getTransformedText(text: string, textTransform: CoreTypes.TextTransformType): string;

export const resetSymbol: symbol;
8 changes: 4 additions & 4 deletions packages/core/ui/text-base/text-base-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ export const textAlignmentProperty = new InheritedCssProperty<Style, CoreTypes.T
textAlignmentProperty.register(Style);

const textTransformConverter = makeParser<CoreTypes.TextTransformType>(makeValidator<CoreTypes.TextTransformType>('initial', 'none', 'capitalize', 'uppercase', 'lowercase'));
export const textTransformProperty = new CssProperty<Style, CoreTypes.TextTransformType>({
export const textTransformProperty = new InheritedCssProperty<Style, CoreTypes.TextTransformType>({
name: 'textTransform',
cssName: 'text-transform',
defaultValue: 'initial',
valueConverter: textTransformConverter,
});
textTransformProperty.register(Style);

export const textShadowProperty = new CssProperty<Style, string | ShadowCSSValues>({
export const textShadowProperty = new InheritedCssProperty<Style, string | ShadowCSSValues>({
name: 'textShadow',
cssName: 'text-shadow',
affectsLayout: __APPLE__,
Expand All @@ -308,7 +308,7 @@ export const textShadowProperty = new CssProperty<Style, string | ShadowCSSValue
});
textShadowProperty.register(Style);

export const textStrokeProperty = new CssProperty<Style, string | StrokeCSSValues>({
export const textStrokeProperty = new InheritedCssProperty<Style, string | StrokeCSSValues>({
name: 'textStroke',
cssName: 'text-stroke',
affectsLayout: __APPLE__,
Expand All @@ -319,7 +319,7 @@ export const textStrokeProperty = new CssProperty<Style, string | StrokeCSSValue
textStrokeProperty.register(Style);

const whiteSpaceConverter = makeParser<CoreTypes.WhiteSpaceType>(makeValidator<CoreTypes.WhiteSpaceType>('initial', 'normal', 'nowrap'));
export const whiteSpaceProperty = new CssProperty<Style, CoreTypes.WhiteSpaceType>({
export const whiteSpaceProperty = new InheritedCssProperty<Style, CoreTypes.WhiteSpaceType>({
name: 'whiteSpace',
cssName: 'white-space',
defaultValue: 'initial',
Expand Down
Loading