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

Extend drop cap customizations with theme.json #36122

Open
colorful-tones opened this issue Nov 1, 2021 · 5 comments
Open

Extend drop cap customizations with theme.json #36122

colorful-tones opened this issue Nov 1, 2021 · 5 comments
Labels
[Block] Paragraph Affects the Paragraph Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Enhancement A suggestion for improvement.

Comments

@colorful-tones
Copy link
Member

What problem does this address?

While working on TwentyTwentyTwo - it was noted that the dropcap layout looked tight (bad line-height) or undesirable Drop cap needs attention/styling #180 on certain user's systems. Currently, it was agreed that dropcap support was not imperative for TwentyTwentyTwo.

Note: this is not imperative to WP 5.9 release or TwentyTwentyTwo progress at all.

However, it would be ideal to extend drop cap styling and support to allow for some theme.json settings to adjust things like: line-height, font-weight, and even color or margin.

What is your proposed solution?

Extend drop cap support and put additional mechanisms in place in theme.json to allow theme authors to declaratively define drop cap styling.

Possible related conversation and considerations: theme.json: whether or not to allow targetting settings that are specific to the block #35114

Is it the objective to be able to configure every option in core blocks through theme.json?
It would be so helpful to be able to preconfigure things like text alignment, vertical alignment, block alignment, block width, media position, and so on..

@colorful-tones colorful-tones added [Block] Paragraph Affects the Paragraph Block CSS Styling Related to editor and front end styles, CSS-specific issues. Developer Experience Ideas about improving block and theme developer experience and removed Developer Experience Ideas about improving block and theme developer experience labels Nov 1, 2021
@justintadlock
Copy link
Contributor

justintadlock commented Feb 7, 2022

Yep, I ended up having to basically create a whole set of drop-cap properties so that I could overwrite this in upcoming global styles variation .json files:

.has-drop-cap:not(:focus)::first-letter {
	font-family: var( --wp--custom--drop-cap--typography--font-family, inherit );
	font-size: var( --wp--custom--drop-cap--typography--font-size, 5.5em );
	font-weight: var( --wp--custom--drop-cap--typography--font-weight, 700 );
	font-style: var( --wp--custom--drop-cap--typography--font-style, normal );
	line-height: var( --wp--custom--drop-cap--typography--line-height, .85 );
	margin: var( --wp--custom--drop-cap--spacing--margin, 0.05em 0.1em 0 0 );
	padding: var( --wp--custom--drop-cap--spacing--paddig, 0 );
}

@kocjs
Copy link

kocjs commented Nov 26, 2022

@justintadlock

After enabling the drop cap support via theme.json, I added this properties to the styles.css of TT3, unfortunately i do not see any change in the drop cap. Could you please help me with it.

Any help is appreciated

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 14, 2023
@shoelaced
Copy link

Would love to see this incorporated, especially with the new font management functionality coming.

@justintadlock
Copy link
Contributor

One consideration is browser support for initial-letter, which has the potential to completely change any current solutions.

@ndiego
Copy link
Member

ndiego commented Sep 17, 2024

We are getting close to Beta 1 for 6.7. Has any work been started on this issue? If not, thoughts on punting to 6.8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Enhancement A suggestion for improvement.
Projects
Status: 🏈 Punted to 6.8
Development

No branches or pull requests

6 participants