Skip to content

Should particular 'fluid' setting of a font size preset work if the global typography.fluid setting isn't set or it's false? #64766

@matiasbenedetto

Description

@matiasbenedetto

Description

Should particular fluid settings of a font size preset work if settings.typography.fluid is false or not set in theme.json?

Let's consider these settings as example:

{
	"settings": {
		"typography": {
			"fontSizes": [
				{
					"fluid": {
						"max": "60px",
						"min": "30px"
					},
					"name": "Large",
					"size": "59px",
					"slug": "large"
				},
				{
					"name": "Small",
					"size": "1rem",
					"slug": "small"
				}
			]
		}
	},
	"version": 3,
	"$schema": "https://schemas.wp.org/trunk/theme.json"
}

In this case, the 'Large' font size preset fluid settings are ignored by the styles renderer because settings.typography.fluid isn't set. The same would happen if settings.typography.fluid is set to false. Fluid styles are only set if settings.typography.fluid is true.

Expected

If the particular font size preset has fluid settings defined, it should render the fluid styles because more specific settings take precedence over more general settings. In the case mentioned before, the global fluid setting is not even defined, so the more particular font size preset fluid settings should be used. What do you think?

If we think that the particular font size preset fluid settings should be respected if they are set explicitely we can close this another related issue because it won't be valid anymore: # 64765 Font size presets inconsistent with the global fluid typography setting
.

cc. @WordPress/gutenberg-design @WordPress/block-themers

Step-by-step reproduction instructions

  1. Use the theme.json settings of the example.
  2. Check that the 'Large' font size preset is not rendered as a fluid font size in CSS.

Screenshots, screen recording, code snippet

No response

Environment info

  • Gutenberg trunk
  • WordPress 6.6.1

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Metadata

Metadata

Assignees

Labels

Needs DecisionNeeds a decision to be actionable or relevant[Feature] TypographyFont and typography-related issues and PRs[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended[Type] QuestionQuestions about the design or development of the editor.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions