admin管理员组文章数量:1130754
I am developing a block using block.json and I could load RTL CSS on backend using this code:
// Check if RTL mode is enabled
if (wp.i18n.isRTL()) {
// Import RTL stylesheet if RTL mode is enabled
import('./style-rtl.scss');
}
But I don’t know how can I load RTL CSS on frontend on RTL mode using block.json
I couldn’t find any documentation about this on WP site
Just need to load RTL CSS on frontend only when we use the block in the site
I know how to load CSS styles in PHP but I just need to know how to load RTL CSS using block.json for block editor development
I just found these two actions to load scripts for block editor:
enqueue_block_assets
enqueue_block_editor_assets
These things helps too much but I think there should be a better way to load CSS styles for RTL automatically when we use the specific block
I read in the documentations that CSS styles loads automatically for every blocks, But I don’t know how to load RTL CSS automatically using block.json
Appreciate for any help
本文标签: Load RTL CSS using blockjson for block development
版权声明:本文标题:Load RTL CSS using block.json for block development 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736758541a1951417.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论