Skip to content

UI Text: common.css overrides font size #76570

@simison

Description

@simison

When using Text component from UI package with semantic rendering tags, common.css of WordPress overrides styles set by variant prop.

Example:

<Text
	// eslint-disable-next-line jsx-a11y/heading-has-content -- content provided via render prop
	render={ <h2 /> }
	variant="heading-lg"
>
	Example
</Text>

Component styles for heading-lg (15px):

Image

Ends up looking bigger in reality when in wp-admin:

Image Image

The solution could be higher specificity styles, even by using a format like h2.component-class?

Metadata

Metadata

Assignees

Labels

[Package] UI/packages/ui[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions