Skip to content

Is there any way to change only the fontWeight of the <summary> part of the details block? #57921

Answered by t-hamano
kohheepeace asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, as far as I know, it is currently not possible to change the style of only the summary element through the block support user interfaces. How about resetting the child block's style instead?

Alternatively, the following approaches may be used:

Define custom css via theme.json

{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 2,
	"styles": {
		"blocks": {
			"core/details": {
				"css": "& > summary { font-weight: bold;}"
			}
		}
	}
}

Write CSS via the Global Styles

Site Editor > Global Styles > Blocks > Details > Advanced > Additional CSS

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@kohheepeace
Comment options

@t-hamano
Comment options

@kohheepeace
Comment options

Answer selected by kohheepeace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants