-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow inserting un-namespaced editor styles into the iframe #53473
Comments
You mean this? #46752 :) |
@ellatrix yes, but with this new approach everyone will be responsible for scoping their on editor styles into |
@andreiglingeanu No, there's no need to scope with the iframe, but we will keep scoping outside the iframe. |
@ellatrix I understand but it seems to me it doesn't cover the use case when someone wants to style Will it be possible with this new system? If yes, how exactly the selector would have to look like? |
When the editor is not iframed, |
@ellatrix even if editor is always iframed, styles are scoped to That's why I'm looking for a way to maybe enable such a thing: add_action(
'block_editor_settings_all',
function($settings) {
$settings['styles'][] = array(
'css' => 'html { --test: red; }',
'__unstableType' => 'theme',
'skipTransform' => true
);
return $settings;
}
); The editor is still not iframed on the desktop in lots of situations, for example when WooCommerce is active (they still seem to have some non-v3 blocks declared). |
No, that will go away with the PR I linked above. Regarding non iframed, I'd push block devs to update their blocks to v3 asap. |
I can confirm that — just tested your branch. This is amazing! If the above PR will land and the styles won't ever be scoped in the iframe, then this issue can be closed.
That would be very helpful. |
Yes, that PR should be in 6.4. Trying to get it reviewed. |
#46752 has been merged; so we can close the issue. thanks for reporting @andreiglingeanu |
What problem does this address?
This will allow styling the
html
element in the iframe element in some special situations like when thehtml
tag inherits thebody
background: https://stackoverflow.com/a/35388084/3220977What is your proposed solution?
We can already add custom editor styles by using the
block_editor_settings_all
filter:But they will always be namespaced, that is
:root|body|html
will be replaced with.editor-styles-wrapper
.The proposed solution is to skip bypassing of transforms for some of the styles here:
We could introduce a
skippedTransforms
flag to the style which will allow us to skip some of the transforms here:Related issues
.editor-styles-wrapper
#18571I'm happy to work on a PR with the proposed or an alternative solution.
The text was updated successfully, but these errors were encountered: