-
Notifications
You must be signed in to change notification settings - Fork 342
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
Add body class for the theme variation #7034
Conversation
I really wish this could be fixed in Gutenberg / core. |
Dropping a link to a related Gutenberg issue: WordPress/gutenberg#43405 |
@merkushin Are there any testing instructions for this PR? In particular, when is it expected that Also, is it a fair statement to say that existing installs of the Course theme won't have the new styles applied that use this CSS selector until they save something in the site editor? |
@donnapep I added testing instruction to the description, thank you.
My mistake: it won't be fired. The post isn't deleted even if we delete the theme. I'll remove it from code to avoid confusion.
I don't think so. If the user switch back to the Course theme later, all their style changes remain the same as before switching the theme. WP keeps a
That's true. I think we can try to detect the variation. For users without custom changes it will work. However, in case they have some, we can't reliably detect the variation. Not sure if it is worth doing, so I don't do these changes now. If we decide to do it, it might worth to do in a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well!
As there is no reliable way to determine the variation on backend, we save the variation in an option at the moment it the global styles are saved.
Changes proposed in this Pull Request:
Testing instructions:
Appearance -> Themes
and activate the Course theme.Appearance -> Editor -> Templates -> Lesson (Learning Mode - Default)
(Not really important which template to select).Styles -> Browse Styles
, select one, clickSave
.<body>
tag has a class with the nameis-{lowercased-variation-title}
.is-default
CSS class.Related Issues: