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

Expand a code block by default if it has the 'expanded' CSS class. #152

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

dd32
Copy link
Member

@dd32 dd32 commented Nov 17, 2022

Some pages and code blocks should be expanded by default, for readability, this might be because it's 1 line over the line limit, or perhaps because it's the last entry on the page.

Or, it could be a page where the majority of the content is the code block itself:
https://developer.wordpress.org/plugins/settings/custom-settings-page/

This PR simply auto-expands the block upon load if the CSS class is applied.

Copy link
Contributor

@ryelle ryelle left a comment

Choose a reason for hiding this comment

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

Looks good to me. Is expanded a class that the docs writers are already using?

@dd32
Copy link
Member Author

dd32 commented Nov 21, 2022

Is expanded a class that the docs writers are already using?

No it's not, it was a shortcut I took instead of attempting to add an option to the Code block (Is that possible without defining a new block?)

I added it to some existing blocks through the Additional CSS classes on some code blocks, such as the above page.

I've followed up with the Docs team in #docs: https://wordpress.slack.com/archives/C02RP4WU5/p1668992574358299

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.

2 participants