Skip to content
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

Global Styles: Duplicate slugs aren't handled correctly #57733

Closed
ajlende opened this issue Jan 10, 2024 · 1 comment
Closed

Global Styles: Duplicate slugs aren't handled correctly #57733

ajlende opened this issue Jan 10, 2024 · 1 comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended

Comments

@ajlende
Copy link
Contributor

ajlende commented Jan 10, 2024

Taken from #56661 (comment).

#53558 may be related; however, that issue is dealing with duplicate "size" properties instead of duplicate "slug" properties that are being described here.

Description

Generating the global stylesheet doesn't filter out duplicates, so the later CSS overrides the earlier. This example shows the issue within a single theme.json settings.typography.fontSizes.

{
	"name": "Display xl2",
	"slug": "Display-xl",
	"size": "296px"
},
{
	"name": "Display xl",
	"slug": "Display-xl",
	"size": "96px"
},

duplicates overriding one another

The issue also extends to overriding defaults as well. You should be able to override default values because prevent_override is false in PRESETS_METADATA, but for some reason that doesn't work. The core defaults are shown and used instead when including these in the theme.json settings.typography.fontSizes presets.

{
	"name": "Override Small",
	"slug": "small",
	"size": "26px"
},
{
	"name": "Override Medium",
	"slug": "medium",
	"size": "40px"
},
{
	"name": "Override Large",
	"slug": "large",
	"size": "72px"
},
@ajlende ajlende added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jan 10, 2024
@jordesign jordesign added the Needs Testing Needs further testing to be confirmed. label Jan 10, 2024
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Feb 10, 2024
@ajlende ajlende closed this as completed Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended
Projects
Development

No branches or pull requests

2 participants