Skip to content

Conversation

@im3dabasia
Copy link
Contributor

@im3dabasia im3dabasia commented May 29, 2025

What?

Closes #70256

Reduces the specificity of the default block's CSS being applied to the Pullquote block, We are reducing it to 0,1,0 to keep it in par with the theme.json CSS (if applied) so that it can be over-riden by the theme developers.

Why?

To allow override of the CSS styles from theme.json

How?

Reduced the specifity of CSS applied by default to 0,1,0

Testing Instructions

  1. Activate the Emptytheme and update the theme.json using the following definition:
{
	"$schema": "../../schemas/json/theme.json",
	"version": 3,
	"settings": {
		"appearanceTools": true,
		"layout": {
			"contentSize": "840px",
			"wideSize": "1100px"
		}
	},
	"styles": {
		"blocks": {
			"core/pullquote": {
				"elements": {
					"cite": {
						"color": {
							"text": "#ff0000"
						},
						"typography": {
							"fontSize": "30px",
							"textTransform": "lowercase",
							"fontStyle": "italic"
						}
					}
				}
			}
		}
	}
}
  1. Insert a Pullquote block.
  2. Confirm that the cite style has changed.

Screenshots

Editor

image

Frontend

image

@im3dabasia im3dabasia changed the title PULLQUOTE: Reduce CSS specificity for the default cite element. [Pullquote Block]: Reduce CSS specificity for the default cite element. May 29, 2025
}

.wp-block-pullquote .wp-block-pullquote__citation {
.wp-block-pullquote__citation {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduced specificity from 0,2,0 to 0,1,0 to match theme CSS for expected styling

@t-hamano
Copy link
Contributor

@im3dabasia Thanks for the PR, but I would like to close this PR and move on to #70260.

@im3dabasia im3dabasia closed this May 29, 2025
@im3dabasia im3dabasia reopened this May 29, 2025
@im3dabasia im3dabasia closed this May 29, 2025
@im3dabasia im3dabasia deleted the fix/theme-default-css-override branch May 29, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pullquote block: Cannot override cite element style via theme.json

2 participants