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

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

Closed
t-hamano opened this issue Jan 18, 2024 Discussed in #57921 · 2 comments
Closed
Labels
[Block] Details Affects the Details Block - used to display content which can be shown/hidden [Type] Enhancement A suggestion for improvement.

Comments

@t-hamano
Copy link
Contributor

Discussed in #57921

Originally posted by kohheepeace January 17, 2024

Problem

As shown in the following video, changes to the font weight of the details block apply to the entire details block, both <summary> part and paragraph part.

2024-01-17.22.54.58.mp4

Question

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

*P.S.
I also want to change font-size of only <summary> part.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Details Affects the Details Block - used to display content which can be shown/hidden labels Jan 18, 2024
@eric-michel
Copy link

Quite late to the party here, but @t-hamano you can accomplish what you're looking for like this:

  • Set the styling you want for your summary element to the overall block (font weight, font size, etc).
  • Add a group block into the "This is a paragraph part..." section
  • Use that group block to override the font weight and font size settings that were set on the parent block

It's a bit clunky because the <summary> element is not its own block despite being its own tag, so the styling is set on the overall <details> element itself (and thus that styling then gets applied to all content within the <details> tag, not just the <summary> tag). A group block lets you override that styling.

@t-hamano
Copy link
Contributor Author

@eric-michel Thanks for the reply.

I found that you submitted #59384 suggesting splitting the summary element. Therefore, let's close this issue and focus the discussion on #59384.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Details Affects the Details Block - used to display content which can be shown/hidden [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants