Skip to content

magento/magento2-page-builder#558: Developer can style content types … #30565

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

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="BlockContentSection">
<element name="TextArea" type="input" selector="#cms_block_form_content"/>
<element name="image" type="file" selector="#tinymce img"/>
<element name="image" type="file" selector=".mce-content-body img"/>
<element name="contentIframe" type="iframe" selector="cms_block_form_content_ifr"/>
</section>
</sections>
1 change: 1 addition & 0 deletions app/code/Magento/Theme/view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="default_head_blocks"/>
<body>
<attribute name="id" value="html-body"/>
Copy link
Contributor

@ihor-sviziev ihor-sviziev Oct 20, 2020

Choose a reason for hiding this comment

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

@hannahnida I don't see what exactly should be done in the task you mentioned - but adding an ID to the body is not really seems correct solution here. Could you explain why it's needed? Why can't we use class here for instance? Unfortunately it's not clear what the styling issue you have

Copy link
Contributor

Choose a reason for hiding this comment

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

@ihor-sviziev We need to add this id to have a higher level of CSS specificity over less styles. This work is going in the scope of Page Builder story to eliminate the usage of inline styles. Feel free to ask me for any details.

Copy link
Contributor

Choose a reason for hiding this comment

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

So why can't we use class here? I believe if you'll use body.some-class .my-style it should work approximately the same as #my-body-id .my-style

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, no. The class does not give enough specificity value. For more information, you could read https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity and visual specificity sheet https://specifishity.com/

<block name="require.js" class="Magento\Framework\View\Element\Template" template="Magento_Theme::page/js/require_js.phtml" />
<referenceContainer name="after.body.start">
<block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/>
Expand Down
1 change: 1 addition & 0 deletions lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ define([
plugins: this.config.tinymce4.plugins,
toolbar: this.config.tinymce4.toolbar,
adapter: this,
'body_id': 'html-body',

/**
* @param {Object} editor
Expand Down