<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>For developers &#8211; Marcos Rego</title>
	<atom:link href="https://marcosrego.com/tag/for-developers/feed/" rel="self" type="application/rss+xml" />
	<link>https://marcosrego.com</link>
	<description>Web Development</description>
	<lastBuildDate>Sat, 03 Feb 2024 16:45:20 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
	<item>
		<title>Create custom utility classes and breakpoints for Mr.Utils</title>
		<link>https://marcosrego.com/blog/custom-utility-classes-breakpoints/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Sat, 27 Jan 2024 19:13:33 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Mr.Dev.'s Framework]]></category>
		<category><![CDATA[Mr.Utils]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=3083</guid>

					<description><![CDATA[Mr.Utils includes a good preset of utility classes, for spacing, colors, sizes, components and much more. And when using it on WordPress, you and other users can even select them via the block editor. But there might be occasions, that you need to have your own custom classes, and you might want them to be [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-3083"></span>
<!--noteaser-->



<p>Mr.Utils includes a good preset of utility classes, for spacing, colors, sizes, components and much more. And when using it on WordPress, you and other users can even select them via the block editor.</p>



<p>But there might be occasions, that you need to have your own custom classes, and you might want them to be available on the editor also.</p>



<p>And maybe you want to use those custom classes on specific breakpoints: The 4 preset breakpoints might not be enough for you, if that&#8217;s the case, you can also create custom breakpoints.</p>



<p>On this tutorial, you will learn how you can add your own custom utility classes and breakpoints to Mr.Utils. There are two ways to do it:</p>



<ul class="wp-block-list">
<li><strong>Using Mr.Dev.&#8217;s Framework</strong> &#8211; is the easiest way on WordPress.</li>



<li><strong>Manual implementation on Mr.Utils</strong></li>
</ul>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png" alt="Mr.Utils Opengraph Image" class="wp-image-1029" title="mrutils marcosrego opengraph - Create custom utility classes and breakpoints for Mr.Utils" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph.png 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="  has-main-text-color-color has-text-color"><strong><a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a></strong> gives you a set of classes with a clear syntax, such as <em><strong>mr-phone-hide</strong></em> clearly saying to hide an element on a phone, <strong><em>mr-marginright</em></strong> to add a margin on the right side of an element and <strong><a rel="noreferrer noopener" href="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" data-type="URL" data-id="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" target="_blank">so much more</a></strong>&#8230;</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/client-area/downloads/?product=mrutils"><strong>Get it now (free)</strong></a></div>
</div>
</div></section>
</div></aside>



<h2 class="wp-block-heading" id="using-mr-dev-s-framework-on-wordpress"><strong>Using Mr.Dev.&#8217;s Framework on WordPress</strong></h2>



<h3 class="  wp-block-heading" id="create-custom-utility-classes-using-mr-dev-s-framework"><strong>Create custom utility classes using Mr.Dev.&#8217;s Framework</strong></h3>



<ol class="  wp-block-list">
<li>Once on WordPress, go to &#8220;Settings&#8221; &gt; &#8220;Mr.Dev.&#8221; (or your website name, depending of the configuration).</li>



<li>Go to the &#8220;Utilities&#8221; tab (If the tab is not available, you&#8217;ll need to enable the option on the &#8220;Configuration&#8221; tab, at &#8220;Utilities configuration&#8221;).</li>



<li>On &#8220;Default options&#8221; click on &#8220;Choose available features&#8221; and select &#8220;Custom&#8221; on each breakpoint where you&#8217;ll want your custom classes to be available.</li>



<li>Below on &#8220;Custom Utilities&#8221;, click on + to add the first class.</li>



<li>Choose the class name (the class will be generated from this name).</li>



<li>Choose the CSS property (A list of some properties will appear while you write, those properties can be used for the block editor. You can still use any CSS property you want, even the ones not listed, the only downside is those might not appear on the block editor, you&#8217;ll need to copy &amp; paste the class).</li>



<li>Choose the CSS variable / value (If you have the &#8220;Styles&#8221; tab enabled, you can create the variables there, they will appear in here after. And you don&#8217;t have to use variables, you can also write the intended values directly here if you prefer.)</li>
</ol>



<p>Tip: If you want a class to have multiple properties, you can do it, by having the same class name repeated multiple times.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img decoding="async" width="1024" height="538" data-id="3104" src="https://marcosrego.com/wp-content/uploads/2024/01/mrdev-framework_mr-utils_custom-classes-1024x538.jpg" alt="custom utility classes on Mr.Utils with Mr.Dev.&#039;s Framework" class="wp-image-3104" title="mrdev framework mr utils custom classes - Create custom utility classes and breakpoints for Mr.Utils" srcset="https://marcosrego.com/wp-content/uploads/2024/01/mrdev-framework_mr-utils_custom-classes-1024x538.jpg 1024w, https://marcosrego.com/wp-content/uploads/2024/01/mrdev-framework_mr-utils_custom-classes-300x158.jpg 300w, https://marcosrego.com/wp-content/uploads/2024/01/mrdev-framework_mr-utils_custom-classes-768x403.jpg 768w, https://marcosrego.com/wp-content/uploads/2024/01/mrdev-framework_mr-utils_custom-classes.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</figure>



<h4 class="  wp-block-heading" id="using-the-custom-utility-classes"><strong>Using the custom utility classes</strong></h4>



<p>Once you create the custom utility classes, you will see inputs showing how the class looks for each breakpoint (that you selected on the 3rd step). You can click on the input to copy the class and then paste into your HTML, CSS, etc. </p>



<p>If the option &#8220;Show utilities on the block editor&#8221; is active, you can use the block editor to use the custom classes, for options related to spacing, coloring and sizes.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img decoding="async" width="772" height="250" data-id="2289" src="https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1.png" alt="Mr.Utils options on WordPress block editor" class="wp-image-2289" title="banner 772x250 1 - Create custom utility classes and breakpoints for Mr.Utils" srcset="https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1.png 772w, https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1-300x97.png 300w, https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1-768x249.png 768w" sizes="(max-width: 772px) 100vw, 772px" /><figcaption class="wp-element-caption">Mr.Utils options on WordPress block editor</figcaption></figure>
</figure>



<h3 class="  wp-block-heading" id="add-custom-breakpoints-using-mr-dev-s-framework"><strong>Add custom breakpoints using Mr.Dev.&#8217;s Framework</strong></h3>



<ol class="  wp-block-list">
<li>Once on WordPress, go to &#8220;Settings&#8221; &gt; &#8220;Mr.Dev.&#8221; (or your website name, depending of the configuration).</li>



<li>Go to the &#8220;Styles&#8221; tab (If the tab is not available, you&#8217;ll need to enable the option on the &#8220;Configuration&#8221; tab, at &#8220;Styles configuration&#8221;).</li>



<li>Scroll down to the &#8220;Breakpoints&#8221; section, where you will find 4 preset breakpoints already created, that you can change the values.</li>



<li>Click on &#8220;+&#8221; on &#8220;Number of Breakpoints&#8221; to add a custom breakpoint.</li>



<li>Choose the name for the breakpoint and define the min/max &#8211; width/height. </li>
</ol>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img loading="lazy" decoding="async" width="951" height="963" data-id="2687" src="https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints.jpg" alt="ressanogarciaarq styles base breakpoints" class="wp-image-2687" title="ressanogarciaarq styles base breakpoints - Create custom utility classes and breakpoints for Mr.Utils" srcset="https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints.jpg 951w, https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints-296x300.jpg 296w, https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints-768x778.jpg 768w" sizes="auto, (max-width: 951px) 100vw, 951px" /><figcaption class="wp-element-caption">Example of using custom breakpoints on <a href="https://marcosrego.com/websites/ressanogarcia/" data-type="post" data-id="1795">Ressano Garcia Aquitectos website</a>.</figcaption></figure>
</figure>



<h4 class="  wp-block-heading" id="using-the-custom-breakpoints"><strong>Using the custom breakpoints</strong></h4>



<p>Once you create the custom breakpoints, you can select them on the &#8220;Utilities&#8221; tab or/and on the &#8220;Files / Media&#8221; tab. </p>



<p>On the &#8220;Files/Media&#8221; tab, you can choose on which breakpoints each spreadsheet should load (In production, do not forget to use a cache plugin with minifying options, to combine these spreadsheets, while keeping the breakpoints and their media queries).</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="693" data-id="956" src="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-1024x693.jpg" alt="Mr.Dev.&#039;s Framework - Files page" class="wp-image-956" title="mrdev framework files - Create custom utility classes and breakpoints for Mr.Utils" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-1024x693.jpg 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-300x203.jpg 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-768x520.jpg 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files.jpg 1342w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">On the Files / Media tab you can decide on which breakpoints a stylesheet should load.</figcaption></figure>
</figure>



<h2 class="wp-block-heading" id="manual-implementation-on-mr-utils"><strong>Manual implementation on Mr.Utils</strong></h2>



<h3 class="  wp-block-heading" id="create-custom-utility-classes"><strong>Create custom utility classes</strong></h3>



<ol class="  wp-block-list">
<li><a href="https://marcosrego.com/client-area/downloads/?product=mrutils" target="_blank" data-type="link" data-id="https://marcosrego.com/client-area/downloads/?product=mrutils" rel="noreferrer noopener">Download Mr.Utils.</a></li>



<li>Go to &#8220;dev/css&#8221;. Each folder located in here corresponds to one breakpoint (except for &#8220;utils&#8221; that is global).</li>



<li>Go to each folder/breakpoint where you want your custom classes to be available and create a utils_<em>breakpoint</em>_custom.css file on each one.</li>



<li>Open all the created files and add a class, following the utilities rules. Example: &#8220;<code>.mr-<em>breakpoint</em>-fontsize10 { }</code>&#8220;.</li>



<li>Add the intended CSS properties to each class. Example: &#8220;<code>font-size: var(--font-size-10,60px);</code>&#8220;.</li>



<li>Once you created all classes on all utils_custom.css, go to the main file on each folder/breakpoint, titled &#8220;utils_<em>breakpoint</em>.css&#8221;.</li>



<li>Add the following line: <code>@import url("utils_<em>breakpoint</em>_custom.css"); </code>Replacing &#8220;breakpoint&#8221; with the actual breakpoint name.</li>



<li><strong>For development</strong>, you can load each of the main &#8220;dev/css/utils_<em>breakpoint</em>/utils_<em>breakpoint</em>.css&#8221; files, with media queries. <br><strong>For production,</strong> you should use your favourite compiler, to compile the main files into the main &#8220;css&#8221; folder (located in the root folder). Use media queries to load all files inside that folder and then, use a page/html minifier to join all those media queried files into one.</li>
</ol>



<h3 class="  wp-block-heading" id="add-custom-breakpoints"><strong>Add custom breakpoints</strong></h3>



<p>With more files you can add more breakpoint names and media queries:</p>



<ol class="  wp-block-list">
<li>Start by copying one of the given breakpoint files. For this example, copy the file &#8216;utils_desktop.css&#8217;.</li>



<li>Change the file name to the name of your breakpoint. For this example rename it &#8216;utils_notmobile.css&#8217; .</li>



<li>Use your favorite code editor to find and replace all instances of &#8216;-desktop-&#8216; with &#8216;-notmobile-&#8216;.</li>



<li>Save the file next to other breakpoints and load it with your own media query. For this example, the easiest would be to add the following to the&nbsp;<code>&lt;head&gt;</code>&nbsp;section:<br><code>&lt;link rel='stylesheet' href='mr-utils/css/utils_notmobile.css' media='(min-width: 768px)' /&gt;</code></li>
</ol>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to easily transfer emails to a different service/host</title>
		<link>https://marcosrego.com/blog/transfer-emails-automatically/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Sat, 05 Aug 2023 17:35:58 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[For clients and authors]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=2963</guid>

					<description><![CDATA[Are you changing your emails to a different service/provider (server, host or domain) but want to keep all data as is? You don&#8217;t have to do it manually! The problems of exporting and importing emails manually Forget about exporting and importing trough webmail, many times those have limits. You might end exporting without being able [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-2963"></span>
<!--noteaser-->



<p>Are you changing your emails to a different service/provider (server, host or domain) but want to keep all data as is?<strong> You don&#8217;t have to do it manually!</strong></p>



<h2 class="mr-paddingtop  wp-block-heading"><strong>The problems of exporting and importing emails manually</strong></h2>



<p>Forget about exporting and importing trough webmail, many times those have limits.</p>



<p>You might end exporting without being able to import after (and a backup is no good if you can&#8217;t later import it, right?). Dividing an export into many different files, to avoid limits, it&#8217;s also a lot of work and can lead to mistakes.</p>



<p>You might even remember to export the &#8220;Inbox folder&#8221;, but what about others, such as &#8220;Sent&#8221; or custom ones.</p>



<p>That&#8217;s why on this post, I want to share with you a very handy on-line tool, properly called <strong><a href="https://imapsync.lamiral.info/X/" data-type="URL" data-id="https://imapsync.lamiral.info/X/" target="_blank" rel="noreferrer noopener">Mailbox Imapsync Online</a></strong>.</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   wp-block-heading has-main-text-color-color has-text-color"><strong>Do you need a website?</strong></h3>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-1024x538.png" alt="Marcos Rego Store Opengraph Image" class="wp-image-1021" title="store marcosrego opengraph - How to easily transfer emails to a different service/host" srcset="https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="  has-main-text-color-color has-text-color">If you need a <strong>website</strong>, you can check the <strong><a href="https://marcosrego.com/client-area/shop/" data-type="post" data-id="673">Shop</a></strong> on the <strong><a href="https://marcosrego.com/./client-area/" data-type="category" data-id="52">Client Area</a></strong> and get an estimation of the development cost. <strong>Pay only 20%</strong>, until the website is ready.</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background wp-element-button" href="https://marcosrego.com/client-area/shop/"><strong>go to THE SHOP</strong></a></div>
</div>
</div></section>
</div></aside>



<h2 class="mr-paddingtop  wp-block-heading"><strong>How to use Mailbox Imapsync Online to transfer emails automatically</strong></h2>



<p>Using <a href="https://imapsync.lamiral.info/X/" target="_blank" data-type="URL" data-id="https://imapsync.lamiral.info/X/" rel="noreferrer noopener">Mailbox Imapsync Online</a> couldn&#8217;t be simpler:</p>



<p>First, be sure that you have the credentials of the two email addresses.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-full"><img loading="lazy" decoding="async" width="1200" height="630" data-id="2977" src="https://marcosrego.com/wp-content/uploads/2023/08/transfer-emails-mailbox-imapsync-online-opengraph.jpg" alt="Transfer emails with Mailbox Imapsync Online" class="wp-image-2977" title="transfer emails mailbox imapsync online opengraph - How to easily transfer emails to a different service/host" srcset="https://marcosrego.com/wp-content/uploads/2023/08/transfer-emails-mailbox-imapsync-online-opengraph.jpg 1200w, https://marcosrego.com/wp-content/uploads/2023/08/transfer-emails-mailbox-imapsync-online-opengraph-300x158.jpg 300w, https://marcosrego.com/wp-content/uploads/2023/08/transfer-emails-mailbox-imapsync-online-opengraph-1024x538.jpg 1024w, https://marcosrego.com/wp-content/uploads/2023/08/transfer-emails-mailbox-imapsync-online-opengraph-768x403.jpg 768w" sizes="auto, (max-width: 1200px) 100vw, 1200px" /></figure>
</figure>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<h3 class="  wp-block-heading"><strong>Source email</strong></h3>



<p class="mr-nomarginbottom ">On the left side, you will find &#8220;IMAP source Mailbox&#8221;. You will put there the credentials of the source email address, the one that you want to transfer emails from. You can get the correct &#8220;IMAP server hostname&#8221; on your hosting service or by checking to where the MX records were pointing at (Can also be an IP, in fact might be better if you already made changes to you Domain Name Server).</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<h3 class="  wp-block-heading"><strong>Destination email</strong></h3>



<p class="mr-nomarginbottom ">On the right side, you will put the credentials of the new email address. Be sure to create the email first on the new provider. You must get the correct &#8220;IMAP server hostname&#8221; on your new hosting service (or new server) or by checking to where the MX records are/should be pointing at (Can also be an IP).</p>
</div>
</div>



<h3 class="  wp-block-heading"><strong>Extra parameters</strong></h3>



<p>If you want, you can also automatically delete the source emails that get transferred &#8211; Click on &#8220;Show/hide extra parameters&#8221; and you&#8217;ll see the new option &#8220;Move sync&#8221; appearing on the left side. This can be useful to avoid the 3GB limit that the tool currently has, on the free version.</p>



<h3 class="  wp-block-heading"><strong>Click sync to automatically transfer emails</strong></h3>



<p>Then you simply click the green button &#8220;Sync or resync&#8221;! Keep the window opened and check the console log to be sure that everything is going smoothly. If something breaks, do not worry, simply click again the green button and the process will continue as &#8220;Resync&#8221; suggests.</p>



<h2 class="mr-paddingtop  wp-block-heading"><strong>Besides automatically transfer emails, there&#8217;s more to Mailbox Imapsync Online</strong></h2>



<h3 class="  wp-block-heading"><strong>Sync between different email addresses</strong></h3>



<p>If you look closer to all options, you are not limited to transfer emails between the same email addresses. <br>So let&#8217;s say there&#8217;s a new employee in <em>yourcompany</em> called <em>Lucy</em> working in content marketing, her email is <em>lucy.copy@yourcompany.org</em>, the old content marketer was <em>Lauren</em> and her email was <em>lauren.writter@yourcompany.org</em>. <br>With <a href="https://imapsync.lamiral.info/X/" target="_blank" data-type="URL" data-id="https://imapsync.lamiral.info/X/" rel="noreferrer noopener">Mailbox Imapsync Online</a>, you can transfer all of those work related emails, about content marketing, to the new employee.</p>



<h3 class="  wp-block-heading"><strong>Just create folders</strong></h3>



<p>If you don&#8217;t want to transfer all the emails, but want to keep the same structure of another email address, you actually have a checkbox to &#8220;Just create folders&#8221; during the sync.</p>



<p class="mr-paddingtop "><strong>Did you know about this tool before? Was this helpful?</strong> </p>



<p>Let me know in the comments section below. </p>



<p>I remember searching for something free like this in the past and it wasn&#8217;t easy. Until an old hosting provider mentioned it to me, during support. They were more life savers then I care to admit, I hope for you too. </p>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to style a datalist and its options?</title>
		<link>https://marcosrego.com/blog/style-datalist-options/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Tue, 27 Dec 2022 20:10:17 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mr.Utils]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=2875</guid>

					<description><![CDATA[If you ever tried to change the look and feel of a HTML5 datalist but couldn’t, then this post might be your (delayed) Christmas present 🎄🎁 (I hope you had a great one and close to the ones you love the most)! What’s the problem of styling a HTML5 datalist? At the moment of writing, [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-2875"></span>
<!--noteaser-->



<p>If you ever tried to change the look and feel of a HTML5 datalist but couldn’t, then this post might be your (delayed) Christmas present 🎄🎁 (I hope you had a great one and close to the ones you love the most)!</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png" alt="Mr.Utils Opengraph Image" class="wp-image-1029" title="mrutils marcosrego opengraph - How to style a datalist and its options?" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="  has-main-text-color-color has-text-color"><strong><a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a></strong> gives you a set of classes with a clear syntax, such as <em><strong>mr-phone-hide</strong></em> clearly saying to hide an element on a phone, <strong><em>mr-marginright</em></strong> to add a margin on the right side of an element and <strong><a rel="noreferrer noopener" href="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" data-type="URL" data-id="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" target="_blank">so much more</a></strong>&#8230;</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/client-area/downloads/?product=mrutils"><strong>Get it now (free)</strong></a></div>
</div>
</div></section>
</div></aside>



<h2 class="wp-block-heading"><strong>What’s the problem of styling a HTML5 datalist?</strong></h2>



<p>At the moment of writing, it’s not possible to style a datalist directly.</p>



<p>Hopefully in the future, we will be able to simply use normal CSS like this:</p>



<pre class="wp-block-code"><code>.mr-datalist &gt; * {
    background-color: var(--dark);
    color: var(--light);
}</code></pre>



<p>For now, if you still want to use datalist, there are two ways to do it:</p>



<ul class="wp-block-list">
<li><a href="#the_easiest_way_to_style_a_datalist" data-type="internal" data-id="#the_easiest_way_to_style_a_datalist">An easy way, using a class from a front-end toolkit.</a></li>



<li><a href="#style_a_datalist_with_code">A more manual way, using Vanilla JavaScript.</a></li>
</ul>



<p>The CSS code above will work after implementing any of those 2 options.</p>



<p>Some things that might be important to you:&nbsp;</p>



<ul class="wp-block-list">
<li>These methods might not work on iOS versions prior to the 13th. On those devices, the datalist will not change, working as it does by default.</li>



<li>Both methods should be future-proof. When HTML5 data lists become easier to style, you can remove the front-end toolkit or the JavaScript code. Just keep the classes and the CSS as is.</li>
</ul>



<p>With that aside, let’s move on with this tutorial…</p>



<h2 class="wp-block-heading"><strong>The easiest way to style a datalist</strong></h2>



<p>You can use a front-end toolkit such as <strong><a href="https://marcosrego.com/development/mr-utils/" target="_blank" data-type="post" data-id="473" rel="noreferrer noopener">Mr.Utils</a></strong>.</p>



<p>All you have to do is, make sure you are adding the global JavaScript file <em>js/utils.js</em> in your page (or if you don’t want to load the entire toolkit, you can individually add <em>dev/js/utils/utils_components.js</em>).</p>



<p>After that, you need to add the correct class <strong>.mr-datalist</strong> to your datalist <em>(not to the input)</em> and it will magically transform it into a “search” component.</p>



<p>You can then style it with a <a href="#whats_the_problem_of_styling_a_html5_datalist">CSS code similar to the one shown before</a>.</p>



<h2 class="wp-block-heading"><strong>Style a datalist with code</strong></h2>



<p>I mentioned that the easiest way of implementation works like magic, but of course there’s no magic behind it at all, just the correct JavaScript code.</p>



<p>In this post, I’ll share a simplified version of that code with you.</p>



<p>You can either follow the steps or <strong><a href="#gist_full_code_on_how_to_style_a_datalist">jump directly to the Gist full code</a></strong>.</p>



<p>Feel free to change it to your specific needs.</p>



<h3 class="  wp-block-heading"><strong>1- Transform the datalist into an element that can be styled.</strong></h3>



<pre class="wp-block-code"><code>document.addEventListener("DOMContentLoaded", function () {
  const mrDataLists = document.querySelectorAll(".mr-datalist");
  for (let id = 0; id &lt; mrDataLists.length; id++) {
    let mrDataList = mrDataLists&#91;id];
    let mrDataListUL = "";
    let mrDataListClone = "";
 
    mrDataListClone =
      mrDataList
        .cloneNode(true)
        .innerHTML.replaceAll("&lt;option", "&lt;li")
        .replaceAll("&lt;/option&gt;", "&lt;/li&gt;");
    mrDataListUL = document.createElement("ul");
    mrDataListUL.id = mrDataList.id;
    mrDataListUL.className = mrDataList.className;
    mrDataListUL.innerHTML = mrDataListClone;
 
    mrDataList.replaceWith(mrDataListUL);
  }
}
</code></pre>



<p>In this first step, we grab all data lists that have the class <em>.mr-datalist, </em>but you can change it to your own.</p>



<p>You can even grab all data lists without exception, by replacing the class <em>.mr-datalist</em> with the property <em>datalist, </em>on the <em>querySelectorAll </em>(Don’t forget to change the CSS code accordingly at the end).</p>



<p>In this example, we transform the datalist into an unordered list. You can change that if you wish, but it should be an element with direct children. Each direct child will be a datalist option.</p>



<p>The <em>replaceWith </em>at the end finishes the transformation, but we are not done yet.</p>



<p>We need to create a similar “search” functionality to the one the HTML5 datalist has.</p>



<h3 class="  wp-block-heading"><strong>2- Make the input find content on the element.</strong></h3>



<pre class="wp-block-code"><code>document.addEventListener("keyup", function (e) {
  let mrDataListID = "mr-datalist";
  if (e.target.matches('input&#91;list="'+mrDataListID+'"]')) {
    mrSearch(document.getElementById(mrDataListID), e.target);
  }
  e.stopPropagation();
});
</code></pre>



<p>In here, I’m assuming we know the ID of the datalist, and that we have it on the input “list” attribute. I’m assuming that because those are needed for the original datalist to work.<br>In this example, the ID is <em>mr-datalist,</em> set on the mrDataListID variable.</p>



<p>If for some reason you don’t know the ID, there are alternative ways to do it. On Mr.Utils for example, the “Search” component removes the original input, creates a new one and uses <em>nextElementSibling</em>. It does that for a reason, you can check that on the <a href="https://github.com/marcosrego-web/mr-utils/blob/master/dev/js/utils/utils_components.js" target="_blank" rel="noreferrer noopener nofollow">GitHub repository</a>.</p>



<p>As you might notice, we are calling the function <em>mrSearch</em>, which will do the heavy work.&nbsp;</p>



<p>Here is the function simplified, feel free to rename it to anything you want:</p>



<pre class="wp-block-code"><code>function mrSearch(t, e) {
  //t = Datalist
  //e = Input with list attribute
  let mrSearchChildren = t.children;
  if (mrSearchChildren) {
    if (e.value !== "") {
      t.style.removeProperty("display");
      for (let id = 0; id &lt; mrSearchChildren.length; id++) {
        let mrSearchChild = mrSearchChildren&#91;id];
        if (mrSearchChild.hasAttribute("value")) {
          //If the child does not contain any text, show the value as text.
          if (!mrSearchChild.innerText) {
            mrSearchChild.innerText = mrSearchChild.getAttribute("value");
          }
 
          //Change the input value when clicking on the child.
          mrSearchChild.addEventListener("click", function () {
            e.value = mrSearchChild.getAttribute("value");
          });
        }
        mrSearchChild.style.display = "none";
 
        //Checking the child outerHTML because I want to search text also inside the value attribute. Convert in lowercase to not be case sensitive.
        if (
          mrSearchChild.outerHTML
            .toLowerCase()
            .replace(/&#91;^a-zA-Z0-9 ]/g, "")
            .includes(e.value.toLowerCase().replace(/&#91;^a-zA-Z0-9 ]/g, ""))
        ) {
          mrSearchChild.style.removeProperty("display");
        }
      }
    } else {
      t.style.display = "none";
    }
  }
}

</code></pre>



<p>Here we changed the Input value when clicking on the element child <em>(the datalist option that we transformed)</em> and we’ll make the search case-insensitive.</p>



<p>Check the comments inside the code to better understand which parts replicate which datalist “search” feature.</p>



<p>Extra: If you have full control over the original datalist, you probably added a value and text to each option. If you don’t have, then this code as you covered, it copies the value into the text when no text is found.</p>



<p><strong>And that’s it! </strong>Now you replicated most datalists’ functionalities and can start styling the element, with a <a href="#whats_the_problem_of_styling_a_html5_datalist">CSS code similar to the one shown before</a>.</p>



<h3 class="  wp-block-heading"><strong>3- Take it to the next level (Optional and Advanced)</strong></h3>



<p>If you feel inspired, now that you have full control over the code, you can add extra features! Features that not even the original datalist has.</p>



<p>For example:</p>



<ul class="wp-block-list">
<li>Show a message when no result is found.</li>



<li>Bold the text while it is found on the results.</li>



<li>If no exact match is found, search by each keyword instead <em>(You can also show a message in that situation)</em>.</li>



<li>Show results only after a minimum number of characters <em>(This is a good idea to avoid connection words and code properties)</em>.</li>
</ul>



<p>I did many of those features for <strong>Mr.Utils</strong>, <strong><a href="https://github.com/marcosrego-web/mr-utils/blob/master/dev/js/utils/utils_components.js#L356" target="_blank" rel="noreferrer noopener nofollow">you can check the part of the code here</a></strong>.</p>



<p>Might also be a good idea, to track pressing keyboard arrow keys, to select the results and improve accessibility.</p>



<h3 class="  wp-block-heading"><strong>Gist full code on how to style a datalist</strong></h3>



<script src="https://gist.github.com/marcosrego-web/943e82bbd6243e8f38af4ff5ce081dc6.js"></script>



<h2 class="wp-block-heading"><strong>Working example of styling datalists</strong></h2>



<p>I did something very similar to the methods explained above for <strong><a href="https://www.rydoo.com/compliance/" target="_blank" data-type="URL" data-id="https://www.rydoo.com/compliance/" rel="noreferrer noopener nofollow">Rydoo’s Compliance Centre</a></strong> and <strong><a href="https://www.rydoo.com/marketplace/" data-type="URL" data-id="https://www.rydoo.com/marketplace/" target="_blank" rel="noreferrer noopener nofollow">Marketplace</a></strong>.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><a href="https://www.rydoo.com/compliance/" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="1024" height="522" data-id="2727" src="https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Compliance_Centre-1024x522.png" alt="Rydoo-Compliance_Centre" class="wp-image-2727" title="Rydoo Compliance Centre - How to style a datalist and its options?" srcset="https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Compliance_Centre-1024x522.png 1024w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Compliance_Centre-300x153.png 300w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Compliance_Centre-768x391.png 768w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Compliance_Centre-1536x783.png 1536w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Compliance_Centre.png 1902w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Rydoo&#8217;s Compliance Centre</figcaption></figure>



<figure class="     wp-block-image size-large"><a href="https://www.rydoo.com/marketplace/" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="1024" height="522" data-id="2724" src="https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Marketplace-1024x522.png" alt="Rydoo-Marketplace" class="wp-image-2724" title="Rydoo Marketplace - How to style a datalist and its options?" srcset="https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Marketplace-1024x522.png 1024w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Marketplace-300x153.png 300w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Marketplace-768x391.png 768w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Marketplace-1536x783.png 1536w, https://marcosrego.com/wp-content/uploads/2021/08/Rydoo-Marketplace.png 1902w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Rydoo&#8217;s Marketplace</figcaption></figure>
</figure>



<p>I hope you enjoyed this post! I&#8217;m not sure that I will be writing something more on the blog before entering the new year, so enjoy the celebrations and <strong>let&#8217;s enter 2023 with the right footer!!</strong> 🥂🎆🥳</p>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Please avoid these variables! Better practices&#8230;</title>
		<link>https://marcosrego.com/blog/variables-to-avoid/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Mon, 24 Oct 2022 21:00:14 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sass]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=2744</guid>

					<description><![CDATA[What is a variable? Variables are very handy strings that, as the name suggests, can vary or change one day. They can be called from many places and in many ways to be used and reused (depending on the coding language). What makes them handy is: When you need to change one, you only need [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-2744"></span>
<!--noteaser-->



<h2 class="wp-block-heading"><strong>What is a variable?</strong></h2>



<p>Variables are very handy strings that, as the name suggests, can vary or change one day. They can be called from many places and in many ways to be used and reused (depending on the coding language).</p>



<p>What makes them handy is: When you need to change one, you only need to change its value in one place, the new value will then pass to every location where you called the variable, by its name.</p>



<figure class="  wp-block-table is-style-stripes"><table><thead><tr><th class="has-text-align-center" data-align="center">Coding language</th><th class="has-text-align-center" data-align="center">Variable construction</th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center">CSS</td><td class="has-text-align-center" data-align="center">var(&#8211;name)</td></tr><tr><td class="has-text-align-center" data-align="center">SCSS &amp; PHP</td><td class="has-text-align-center" data-align="center">$name</td></tr><tr><td class="has-text-align-center" data-align="center">JavaScript</td><td class="has-text-align-center" data-align="center">var name<br>const name<br>let name</td></tr></tbody></table><figcaption class="wp-element-caption"><a href="https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(basic_instructions)#Variable_and_constant_declarations" target="_blank" rel="noreferrer noopener">Here you&#8217;ll find</a> how to create and call variables on more coding languages.</figcaption></figure>



<div style="height:25px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>What to avoid in a variable name?</strong></h2>



<p>Even if a variable suggests a change, I see many times developers using names such as $white in SCSS or var(&#8211;white) in CSS. This for me doesn&#8217;t make any sense&#8230; How am I supposed to change to a value other than white? </p>



<p>Even if we can change the colour value, and it visually applies as expected, the code will be illegible. It will be read &#8220;white&#8221; when it isn&#8217;t. For example, it doesn&#8217;t make sense to have a #cecece on a $white variable.</p>



<p>It stops being a real variable.</p>



<p>It would be much better to call it $light, so it could be changed to any light colour on future design system changes. You might think this would still limit to a certain type of colour, and you are right, but at least it can vary as the name suggests. </p>



<p>And we could always take this to another level, call it $secondary_colour or $colourTertiary, so we could use any colour, making it future-proof as long as it&#8217;s not confused with the main/primary one.</p>



<p>We will recap with more examples below&#8230;</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   wp-block-heading has-main-text-color-color has-text-color"><strong>Do you need a website?</strong></h3>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-1024x538.png" alt="Marcos Rego Store Opengraph Image" class="wp-image-1021" title="store marcosrego opengraph - Please avoid these variables! Better practices..." srcset="https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/07/store-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="  has-main-text-color-color has-text-color">If you need a <strong>website</strong>, you can check the <strong><a href="https://marcosrego.com/client-area/shop/" data-type="post" data-id="673">Shop</a></strong> on the <strong><a href="https://marcosrego.com/./client-area/" data-type="category" data-id="52">Client Area</a></strong> and get an estimation of the development cost. <strong>Pay only 20%</strong>, until the website is ready.</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background wp-element-button" href="https://marcosrego.com/client-area/shop/"><strong>go to THE SHOP</strong></a></div>
</div>
</div></section>
</div></aside>



<div style="height:25px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>Use a standard method on the names</strong></h2>



<p>Be consistent when giving a name, stick to one method on all your coding or, at least, depending on the code language.</p>



<p>On PHP, it is typical to use <strong>underscores</strong> on variables with two or more words, on JavaScript the <strong>camel case</strong> method is more typical and on CSS the hyphen.</p>



<p>But if you can stick with only one method on all coding languages, it&#8217;s even better, I would say.</p>



<p>My favourite nowadays is camel case, so something like this: $colourPrimary.</p>



<div style="height:25px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>Make it scalable with a convention!</strong></h2>



<p>Another tip, but very optional, is to set a <strong>convention</strong> to make the variables more <strong>scalable</strong>.</p>



<p>For instance, start the name with the property type and only then the actual name in camel case. In this situation, you can even combine underscores with camel cases. Here&#8217;s what I mean: </p>



<ul class="wp-block-list">
<li>$colour_PrimaryLight.</li>



<li>$size_Spacing2 (don&#8217;t use &#8220;margin&#8221; on the name, that way you can reuse that size on paddings and font-sizes).</li>



<li>$size_font_TitleBig (create another &#8220;layer&#8221; to say that this specific size is to be used only for text).</li>
</ul>



<p>This will avoid conflicts, mistakes and make certain variables easier to find when you have a lot of them.</p>



<div style="height:25px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>Quick recap</strong></h2>



<figure class="  wp-block-table is-style-stripes"><table><thead><tr><th class="has-text-align-center" data-align="center">Avoid</th><th class="has-text-align-center" data-align="center">Regular name</th><th class="has-text-align-center" data-align="center">Better name <br>(future-proof)</th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center"><s>white</s></td><td class="has-text-align-center" data-align="center">light</td><td class="has-text-align-center" data-align="center">colour_TertiaryLight</td></tr><tr><td class="has-text-align-center" data-align="center"><s>margin150</s></td><td class="has-text-align-center" data-align="center">margin2</td><td class="has-text-align-center" data-align="center">size_Spacing2</td></tr></tbody></table></figure>



<div style="height:25px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>5 cool extras from Mr.Dev&#8217;s Framework that you should know</title>
		<link>https://marcosrego.com/blog/mrdev-framework-extras/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Fri, 05 Aug 2022 18:39:56 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Mr.Dev.]]></category>
		<category><![CDATA[Mr.Dev.'s Framework]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=2668</guid>

					<description><![CDATA[Besides the usual tasks, the framework brings some handy extra features such as white labelling WordPress, block editor on WooCommerce, dequeue CSS and JS files, changing the backend style, setting CSS root variables and more&#8230; In this post, I&#8217;ll be focusing on those useful extras. Whitelabel WordPress and Mr.Dev. for a more friendly and professional [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Besides <a href="https://marcosrego.com/development/mrdev-framework/#features" data-type="post" target="_blank" rel="noreferrer noopener">the usual tasks</a>, the framework brings some handy extra features such as white labelling WordPress, block editor on WooCommerce, dequeue CSS and JS files, changing the backend style, setting CSS root variables and more&#8230;</p>



<span id="more-2668"></span>



<p>In this post, I&#8217;ll be focusing on those useful extras.</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><a href="https://marcosrego.com/development/mrdev-framework/"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-1024x538.png" alt="Mr.Dev.&#039;s Framework Opengraph Image" class="wp-image-1026" title="mrdevframework marcosrego opengraph - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="  has-main-text-color-color has-text-color">When <strong>Mr.Dev.</strong> sells his <strong>framework</strong>, <strong>one unique payment</strong> gives you <strong>updates forever</strong> and for <strong>unlimited websites</strong>!</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/development/mrdev-framework/"><strong>Know more</strong></a></div>
</div>
</div></section>
</div></aside>



<h2 class="wp-block-heading"><strong>Whitelabel WordPress and Mr.Dev. for a more friendly and professional look</strong></h2>



<h3 class="  wp-block-heading"><strong>Whitelabel WordPress and Mr.Dev. titles and logos</strong></h3>



<p>Mr.Dev&#8217;s Framework can replace the main instances of WordPress title and logo with the site&#8217;s name and favicon, this will better personalize the backend and login page to you or your client. Giving that extra friendly and professional touch shows that you care and leaves a good impression on your client.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><a href="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-whitelabel-backend-login.jpg"><img loading="lazy" decoding="async" width="1024" height="518" data-id="2685" src="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-whitelabel-backend-login-1024x518.jpg" alt="itemzero whitelabel backend login" class="wp-image-2685" title="itemzero whitelabel backend login - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-whitelabel-backend-login-1024x518.jpg 1024w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-whitelabel-backend-login-300x152.jpg 300w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-whitelabel-backend-login-768x389.jpg 768w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-whitelabel-backend-login-1536x777.jpg 1536w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-whitelabel-backend-login.jpg 1749w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Replace the WordPress logo on the login page with your own.</figcaption></figure>
</figure>



<p>Mr.Dev.&#8217;s Framework can also replace its own title and logo, that way your client can easily find where the framework settings and make changes. It&#8217;s much easier for you to explain and for your client to remember that he/she needs to &#8220;go to <em>Settings &gt; Website name &gt; Styles, </em>to change the colours<em>&#8220;</em> compared to saying &#8220;Settings &gt; Mr.Dev.&#8217;s Framework &gt; Styles&#8221;.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-8 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><a href="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-mrdev-whitelabel-backend.jpg"><img loading="lazy" decoding="async" width="1901" height="963" data-id="2684" src="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-mrdev-whitelabel-backend.jpg" alt="itemzero mrdev whitelabel backend" class="wp-image-2684" title="itemzero mrdev whitelabel backend - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-mrdev-whitelabel-backend.jpg 1901w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-mrdev-whitelabel-backend-300x152.jpg 300w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-mrdev-whitelabel-backend-1024x519.jpg 1024w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-mrdev-whitelabel-backend-768x389.jpg 768w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-mrdev-whitelabel-backend-1536x778.jpg 1536w" sizes="auto, (max-width: 1901px) 100vw, 1901px" /></a><figcaption class="wp-element-caption">Replace WordPress&#8217; and Mr.Dev.&#8217;s name and logo with your website name and favicon.</figcaption></figure>
</figure>



<h3 class="  wp-block-heading"><strong>Whitelabel WordPress active theme</strong></h3>



<p>If you are using a theme that changes looks over time, or it uses a name that does not match the website, it can also be friendly and looks professional, to change the look of the active theme on WordPress theme list, to show the current look and name of the website.</p>



<p>By enabling the &#8220;Active theme&#8221; white label, the active theme will always show a screenshot and the name of the website, as shown on the image below.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-9 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><a href="https://marcosrego.com/wp-content/uploads/2022/08/giftncraft-active-theme-whitelabel.jpg"><img loading="lazy" decoding="async" width="1920" height="954" data-id="2698" src="https://marcosrego.com/wp-content/uploads/2022/08/giftncraft-active-theme-whitelabel.jpg" alt="Giftncraft active theme whitelabel" class="wp-image-2698" title="giftncraft active theme whitelabel - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2022/08/giftncraft-active-theme-whitelabel.jpg 1920w, https://marcosrego.com/wp-content/uploads/2022/08/giftncraft-active-theme-whitelabel-300x149.jpg 300w, https://marcosrego.com/wp-content/uploads/2022/08/giftncraft-active-theme-whitelabel-1024x509.jpg 1024w, https://marcosrego.com/wp-content/uploads/2022/08/giftncraft-active-theme-whitelabel-768x382.jpg 768w, https://marcosrego.com/wp-content/uploads/2022/08/giftncraft-active-theme-whitelabel-1536x763.jpg 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">On the left side the list of themes without whitelabel, on the right side the list with the active theme whitelabel with site name and screenshot. (From <a href="https://marcosrego.com/websites/giftncraft/" target="_blank" data-type="post" data-id="120" rel="noreferrer noopener">Gift &amp; Craft website</a>)</figcaption></figure>
</figure>



<h3 class="  wp-block-heading"><strong>Change WordPress backend styling</strong></h3>



<p>With some themes, you can find the option to style the backend in the Configuration tab of the Framework. By enabling it, the styles configured on the styles tab will be automatically applied on the backend.</p>



<p>Currently, the Mr.Dev_s theme shows that option if you have Beta Test enabled.</p>



<p>If your theme does not give you that option, all you need to do is to create a file named <em>style-admin.css</em> on the root folder. Edit the file to add styles accordingly <em>(you can use the variables you set on the Framework)</em> and enable the option to see the results on the backend.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-10 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><a href="https://marcosrego.com/wp-content/uploads/2022/08/marcosrego-backend-style-mrdev.jpg"><img loading="lazy" decoding="async" width="1920" height="964" data-id="2686" src="https://marcosrego.com/wp-content/uploads/2022/08/marcosrego-backend-style-mrdev.jpg" alt="marcosrego backend style mrdev" class="wp-image-2686" title="marcosrego backend style mrdev - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2022/08/marcosrego-backend-style-mrdev.jpg 1920w, https://marcosrego.com/wp-content/uploads/2022/08/marcosrego-backend-style-mrdev-300x151.jpg 300w, https://marcosrego.com/wp-content/uploads/2022/08/marcosrego-backend-style-mrdev-1024x514.jpg 1024w, https://marcosrego.com/wp-content/uploads/2022/08/marcosrego-backend-style-mrdev-768x386.jpg 768w, https://marcosrego.com/wp-content/uploads/2022/08/marcosrego-backend-style-mrdev-1536x771.jpg 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">Style the backend with the variables set on Mr.Dev.&#8217;s Framework</figcaption></figure>
</figure>



<h2 class="wp-block-heading"><strong>Dequeue CSS and JS files from WordPress or plugins</strong></h2>



<p>Another cool and handy feature on Mr.Dev&#8217;s Framework is the File Manager, not only it allows adding new styles and scripts, it also allows to dequeue files that were already loaded, not only by the framework but also from other plugins or even WordPress itself.</p>



<p>To do this, go to the &#8220;Files&#8221; tab and increase the number of files (Styles or Scripts).</p>



<p>Then, for the new &#8220;File ID&#8221; field, you&#8217;ll grab the ID of the file that you want to dequeue, without -css or -js. </p>



<p>For example, if you wanted to dequeue the styles of the block editor, you would inspect the source of a page and find something like this:</p>



<pre class="wp-block-code"><code>&lt;link rel='stylesheet' id='wp-block-library-css'  href='/wp-includes/css/dist/block-library/style.min.css?ver=6.0.1' media='all' /&gt;</code></pre>



<p>The part &#8220;wp-block-library&#8221; is what you need to copy and paste on the &#8220;File ID&#8221; field.</p>



<p>Then, on the load part, you&#8217;ll choose &#8220;Do not load&#8221;.</p>



<p>Save and that&#8217;s it!</p>



<p>You don&#8217;t need to add the File URL in this situation.</p>



<p>Combine this with assignments if you want to remove a style or script from specific posts / categories / post-types&#8230;</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-11 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="693" data-id="956" src="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-1024x693.jpg" alt="Mr.Dev.&#039;s Framework - Files page" class="wp-image-956" title="mrdev framework files - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-1024x693.jpg 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-300x203.jpg 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files-768x520.jpg 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_files.jpg 1342w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Add files or external urls, choose when to load each one and edit them directly in WordPress with the default plugins editor.</figcaption></figure>
</figure>



<h2 class="wp-block-heading"><strong>How to set the base for rem sizes</strong></h2>



<p>If you are using rem sizes on your CSS variables, you might want to set the base size for rem and change it depending on the breakpoints.</p>



<p>It&#8217;s really easy to do it with Mr.Dev.&#8217;s Framework, just set one variable name to &#8220;base&#8221; and save. Once you save, you&#8217;ll notice that also the breakpoints now have the option to change the base value accordingly.</p>



<p>On the back side of things, Mr.Dev.&#8217;s Framework adds the font-size to the html element once it recognizes the &#8220;base&#8221; variable, on the same stylesheet.</p>



<h2 class="wp-block-heading"><strong>Add root variables instead of body for styling</strong></h2>



<p>Most times, adding CSS variables to the <em>body</em> is the way to go if you want to make them available to use anywhere on your pages (for example: WordPress block editor and FSE [Full site editor] do exactly that), that&#8217;s why Mr.Dev.&#8217;s Framework does it.</p>



<p>But there are specific situations, that you might want to have the variables available to elements before the body. For example: setting a value for <em>scroll-padding-top</em> (to have a scroll offset) with a variable can only be done on the html or on the root element.</p>



<p>Those are very specific situations, so the way to do it might not be very obvious, but it&#8217;s very easy. All you have to do on the framework is to include one of the following words on your variable name/slug:<br>&#8220;<strong>base</strong>&#8220;, &#8220;<strong>root</strong>&#8221; or &#8220;<strong>offset</strong>&#8220;.</p>



<p>By doing that, the framework will add those variables to the root element when creating the <em>vars.css</em> file.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-12 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><a href="https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints.jpg"><img loading="lazy" decoding="async" width="951" height="963" data-id="2687" src="https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints.jpg" alt="ressanogarciaarq styles base breakpoints" class="wp-image-2687" title="ressanogarciaarq styles base breakpoints - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints.jpg 951w, https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints-296x300.jpg 296w, https://marcosrego.com/wp-content/uploads/2022/08/ressanogarciaarq-styles-base-breakpoints-768x778.jpg 768w" sizes="auto, (max-width: 951px) 100vw, 951px" /></a><figcaption class="wp-element-caption">Example of using offset and base on Mr.Dev.&#8217;s Framework Styles (example from <a href="https://marcosrego.com/websites/ressanogarcia/" target="_blank" data-type="post" data-id="1795" rel="noreferrer noopener">Ressano Garcia Arquitectos</a>).</figcaption></figure>
</figure>



<h2 class="wp-block-heading"><strong>Enable the block editor on WooCommerce product pages and remove WooCommerce default styles</strong></h2>



<p>If you have WooCommerce enabled, you will find options for it on the Configuration tab of Mr.Dev.&#8217;s Framework.</p>



<p>One option allows removing all WooCommerce default styles, this is very helpful if you want to style WooCommerce from scratch.</p>



<p>Another option is to enable the block editor on WooCommerce product pages. This option is currently only visible when the Beta test option is enabled, but it&#8217;s already on a stable status. It&#8217;s totally safe to enable beta test to use this feature. The only reason this is not yet on the master build is because I&#8217;m still considering whether to create or not a &#8220;post type manager &amp; builder&#8221;, if so this option will move to that feature.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-13 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><a href="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-example-using-woocommerce-block-editor.jpg"><img loading="lazy" decoding="async" width="1920" height="918" data-id="2689" src="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-example-using-woocommerce-block-editor.jpg" alt="itemzero example using the block editor on woocommerce" class="wp-image-2689" title="itemzero example using woocommerce block editor - 5 cool extras from Mr.Dev&#039;s Framework that you should know" srcset="https://marcosrego.com/wp-content/uploads/2022/08/itemzero-example-using-woocommerce-block-editor.jpg 1920w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-example-using-woocommerce-block-editor-300x143.jpg 300w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-example-using-woocommerce-block-editor-1024x490.jpg 1024w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-example-using-woocommerce-block-editor-768x367.jpg 768w, https://marcosrego.com/wp-content/uploads/2022/08/itemzero-example-using-woocommerce-block-editor-1536x734.jpg 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">Using the block editor on WooCommerce Product page (example from <a href="https://marcosrego.com/websites/itemzero/" target="_blank" data-type="post" data-id="1" rel="noreferrer noopener">itemzero&#8217;s shop</a>)</figcaption></figure>
</figure>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to avoid (CLS) Layout Shift when using JS Components</title>
		<link>https://marcosrego.com/blog/avoid-layout-shift-mrutils/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Mon, 06 Jun 2022 22:26:37 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Mr.Utils]]></category>
		<category><![CDATA[Toolkit]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=2627</guid>

					<description><![CDATA[When using components that are based on JavaScript, you might notice a layout shift on your content (CLS), especially if you delay the start of JavaScript in some way. In that situation, you&#8217;ll see the initial look of the elements until JavaScript kicks in. But of course, delaying JavaScript until user interaction or after some [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-2627"></span>
<!--noteaser-->



<p>When using components that are based on JavaScript, you might notice a layout shift on your content (CLS), especially if you delay the start of JavaScript in some way. In that situation, you&#8217;ll see the initial look of the elements until JavaScript kicks in.</p>



<p>But of course, delaying JavaScript until user interaction or after some seconds it&#8217;s a good practice and a good trick to increase the score of a website on<a href="https://pagespeed.web.dev/" data-type="URL" data-id="https://pagespeed.web.dev/" target="_blank" rel="noreferrer noopener"> pagespeed insights</a>. So the better option is to find ways to avoid layout shifts, fortunately it is not that complicated.</p>



<p>For this tutorial, I&#8217;ll be focusing on <a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a> JS components, but the same logic applies to other tools.</p>



<div style="height:40px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>Understand how general JS Components work</strong></h2>



<p>The way Mr.Utils JavaScript components work is by adding the necessary CSS inline properties to the element after page load, but only if the element doesn&#8217;t have a utility class that already uses some of those properties.</p>



<p>And as you might know, HTML classes don&#8217;t rely on JavaScript to apply the style of CSS properties. We&#8217;ll use that fact to our benefit, to avoid the layout shift when delaying JavaScript in this situation.</p>



<h2 class="wp-block-heading"><strong>Fixing the Content Layout Shift</strong></h2>



<h3 class="  wp-block-heading"><strong>Fix CLS for components that add properties</strong></h3>



<p>Components such as <strong>Mr.Utils Swipe component</strong> add the following inline properties to the element:</p>



<pre class="wp-block-code"><code>display: -webkit-inline-box;
flex-wrap: unset !important;
overflow-x: scroll !important;
-webkit-overflow-scrolling: touch !important;
overflow-y: hidden;</code></pre>



<p>But there&#8217;s one utility class that does the exact same thing, so all you need to do is to add the following utility class after adding the swipe class:</p>



<pre class="wp-block-code"><code>mr-horizontalscroll</code></pre>



<p>If you are using Mr.Utils as a plugin: Instead of adding the class, you can select the option at Misc &gt; Scroll &gt; Horizontal Scroll.</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png" alt="Mr.Utils Opengraph Image" class="wp-image-1029" title="mrutils marcosrego opengraph - How to avoid (CLS) Layout Shift when using JS Components" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="  has-main-text-color-color has-text-color"><strong><a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a></strong> can be installed as a <strong>WordPress plugin</strong>.<br>Give to the <strong>block editor</strong> super-powers such as <strong>pagination or components</strong> and apply changes <strong>depending of the device</strong>!</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/client-area/downloads/?product=mrutils"><strong>Get it now (free)</strong></a></div>
</div>
</div></section>
</div></aside>



<p>In the end, you&#8217;ll have the following classes on your element:</p>



<pre class="wp-block-code"><code>mr-swipe mr-horizontalscroll</code></pre>



<p>By doing this, the properties will be added before JavaScript runs, and you&#8217;ll be avoiding the layout shift, without losing the benefits of the swipe component (such as the ability to drag with a mouse).</p>



<h3 class="  wp-block-heading"><strong>Fix CLS for components that create new elements</strong></h3>



<p>Components such as <strong>Tabs </strong>and navigation options on <strong>Pagination (Radio, Arrows, Dropdown)</strong> add new elements to the page if those elements do not exist yet. So, the way to avoid layout shifting when JavaScript starts on this situation, is to create the elements manually, let&#8217;s take a look at that:</p>



<p>If you want to use the exact same elements that Mr.Utils&#8217; JavaScript would create, you can use the below HTML Codes after the element <em>(or before when using <a href="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes#components" target="_blank" rel="noopener">the proper class</a>)</em>.</p>



<p><strong>Pagination Arrows</strong></p>



<pre class="wp-block-code"><code>&lt;div class="mr-pagination"&gt;
&lt;button class="mr-arrows mr-prev"&gt;⇦&lt;/button&gt;
&lt;button class="mr-arrows mr-next"&gt;⇨&lt;/button&gt;
&lt;/div&gt;</code></pre>



<p><strong>Pagination Radio Buttons</strong></p>



<p><em>Duplicate the last &#8220;mr-radio&#8221; to match the number of pages</em>.</p>



<pre class="wp-block-code"><code>&lt;div class="mr-pagination"&gt;
&lt;span class="mr-radios"&gt;
&lt;input name="mr-radio" title="1/2" class="mr-radio" type="radio" value="1" checked="checked"&gt;
&lt;input name="mr-radio" title="2/2" class="mr-radio" type="radio" value="2"&gt;
&lt;/span&gt;
&lt;/div&gt;</code></pre>



<p><strong>Pagination Dropdown</strong></p>



<p><em>Duplicate the last &#8220;option&#8221; to match the number of pages</em>.</p>



<pre class="wp-block-code"><code>&lt;div class="mr-pagination"&gt;
&lt;select class="mr-pageselect" title="/2"&gt;
&lt;option value="1"&gt;1&lt;/option&gt;
&lt;option value="2"&gt;2&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;</code></pre>



<p><strong>Tabs</strong></p>



<p><em>Duplicate the last &#8220;mr-tab&#8221; to match the number of pages</em>.</p>



<pre class="wp-block-code"><code>&lt;div class="mr-tabsnav mr-horizontalscroll"&gt;
&lt;button class="mr-tab mr-active"&gt;Tab 01&lt;/button&gt;
&lt;button class="mr-tab"&gt;Tab 02&lt;/button&gt;
&lt;/div&gt;</code></pre>



<p>If you want a bit more control or if you use site-builders, you can also create those new elements differently, as long as the main/parent element uses the class <em>mr-pagination</em> or <em>mr-tabsnav</em>.</p>



<p>If you are using Mr.Utils as a plugin on WordPress, you can use the block editor to create buttons for the Tabs component. Then, by selecting the buttons&#8217; container, on Utilities choose Components &gt; Tabs Navigation.</p>



<h2 class="wp-block-heading"><strong>Live example of fixing Tabs CLS</strong></h2>



<p>A good live example of this is on <a href="https://shop.itemzero.com/" data-type="URL" data-id="https://shop.itemzero.com/" target="_blank" rel="noreferrer noopener">Itemzero&#8217;s Shop</a>, the tabs were created using the block editor and Mr.Utils.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-14 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="572" data-id="1611" src="https://marcosrego.com/wp-content/uploads/2021/04/itemzero-mrdev_widget-tabs-1024x572.jpg" alt="Itemzero&#039;s shop uses tabs" class="wp-image-1611" title="itemzero mrdev widget tabs - How to avoid (CLS) Layout Shift when using JS Components" srcset="https://marcosrego.com/wp-content/uploads/2021/04/itemzero-mrdev_widget-tabs-1024x572.jpg 1024w, https://marcosrego.com/wp-content/uploads/2021/04/itemzero-mrdev_widget-tabs-300x168.jpg 300w, https://marcosrego.com/wp-content/uploads/2021/04/itemzero-mrdev_widget-tabs-768x429.jpg 768w, https://marcosrego.com/wp-content/uploads/2021/04/itemzero-mrdev_widget-tabs-1536x858.jpg 1536w, https://marcosrego.com/wp-content/uploads/2021/04/itemzero-mrdev_widget-tabs.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Itemzero&#8217;s shop uses tabs from Mr.Utils components.</figcaption></figure>
</figure>



<div style="height:40px" aria-hidden="true" class="  wp-block-spacer"></div>



<p>And that&#8217;s it! Those are some ways to avoid layout shift when using JS Components.</p>



<div style="height:40px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to create block patterns in WordPress</title>
		<link>https://marcosrego.com/blog/create-block-patterns/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Sun, 27 Feb 2022 15:47:54 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Block editor]]></category>
		<category><![CDATA[For clients and authors]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=2515</guid>

					<description><![CDATA[At the moment of writing, WordPress does not yet give an interface for editors to create block patterns. But that doesn&#8217;t mean it&#8217;s difficult to create them without an interface. On this post, I&#8217;ll guide you on how you can create patterns, and I&#8217;ll try to make it as friendly as possible. Create a block [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-2515"></span>
<!--noteaser-->



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><a href="https://marcosrego.com/development/mrdev-framework/"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-1024x538.png" alt="Mr.Dev.&#039;s Framework Opengraph Image" class="wp-image-1026" title="mrdevframework marcosrego opengraph - How to create block patterns in Wordpress" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="  has-main-text-color-color has-text-color">When <strong>Mr.Dev.</strong> sells his <strong>framework</strong>, <strong>one unique payment</strong> gives you <strong>updates forever</strong> and for <strong>unlimited websites</strong>!</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/development/mrdev-framework/"><strong>Know more</strong></a></div>
</div>
</div></section>
</div></aside>



<p>At the moment of writing, WordPress does not yet give an interface for editors to create block patterns. But that doesn&#8217;t mean it&#8217;s difficult to create them without an interface. On this post, I&#8217;ll guide you on how you can create patterns, and I&#8217;ll try to make it as friendly as possible.</p>



<h2 class="wp-block-heading"><strong>Create a block pattern with Mr.Dev.&#8217;s Framework</strong></h2>



<p>Currently, there&#8217;s no graphic user interface to create block patterns. <a href="https://marcosrego.com/development/mrdev-framework/" data-type="post" data-id="403">Mr.Dev.&#8217;s Framework</a> only adds options that WordPress does not have by default, and I&#8217;m expecting WordPress to create that default interface very soon. For that reason, I&#8217;ll not add a specific interface for this functionality<em> (this might change if WordPress takes too much time to do it)</em>.</p>



<p>But if you can&#8217;t wait for that to happen, Mr.Dev.&#8217;s Framework can still help you on the process&#8230;</p>



<h2 class="wp-block-heading"><strong>Preparing a file for a <strong>WordPress</strong></strong> <strong>code snippet</strong></h2>



<h3 class="  wp-block-heading"><strong>Prepare it using Mr.Dev.&#8217;s Framework</strong></h3>



<ul class="wp-block-list">
<li>If you have Mr.Dev.&#8217;s Framework, check if the option to control files is enabled: If you see the tab <em>Files / Media</em> that means it is, if not then you can enable it on the <em>Configuration</em> tab on the <em>Files &amp; Media Manager</em> section.</li>



<li>Go to the <em>Files / Media</em> tab , there you can find the section <em>Server-side scripts</em>. Click on the pencil icon to open the file.<br>This is the file where you&#8217;ll add a <a href="#block_patterns_code_snippet">short code snippet</a>.</li>
</ul>



<p></p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-2 wp-block-columns-is-layout-flex">
<div class="  wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:57%">
<figure class="    wp-block-image size-full"><a href="https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-enable-files-control.jpg"><img loading="lazy" decoding="async" width="906" height="313" src="https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-enable-files-control.jpg" alt="Mr.Dev.&#039;s Framework - Enable Files Control" class="wp-image-2539" title="mrdev framework enable files control - How to create block patterns in Wordpress" srcset="https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-enable-files-control.jpg 906w, https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-enable-files-control-300x104.jpg 300w, https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-enable-files-control-768x265.jpg 768w" sizes="auto, (max-width: 906px) 100vw, 906px" /></a><figcaption class="wp-element-caption">Mr.Dev.&#8217;s Framework &#8211; Enable Files Control</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="    wp-block-image size-full"><a href="https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-files-control-php.jpg"><img loading="lazy" decoding="async" width="533" height="248" src="https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-files-control-php.jpg" alt="Mr.Dev.&#039;s Framework - Adding/editing PHP servser-sides cripts" class="wp-image-2541" title="mrdev framework files control php - How to create block patterns in Wordpress" srcset="https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-files-control-php.jpg 533w, https://marcosrego.com/wp-content/uploads/2022/02/mrdev-framework-files-control-php-300x140.jpg 300w" sizes="auto, (max-width: 533px) 100vw, 533px" /></a><figcaption class="wp-element-caption">Mr.Dev.&#8217;s Framework &#8211; Adding/editing PHP servser-sides cripts</figcaption></figure>
</div>
</div>



<h3 class="  wp-block-heading"><strong>Prepare it using a custom PHP file</strong></h3>



<p>If you don&#8217;t have Mr.Dev.&#8217;s Framework and already have a way to add PHP code snippets to your website, you can skip directly to add the <a href="#block_patterns_code_snippet">code snippet</a>.</p>



<p>Otherwise, you can <a href="https://marcosrego.com/development/mrdev-framework/" data-type="post" data-id="403">get the framework</a> or <a href="#block_patterns_code_snippet">add the code</a> into the <em>functions.php</em> file of your theme.</p>



<h2 class="wp-block-heading"><strong>Block patterns code snippet</strong></h2>



<ul class="wp-block-list">
<li>Copy the code snippet below and paste it into the file you previously created/selected. Do not save yet because we still need to create the actual pattern.</li>
</ul>



<pre class="mr-fontsize2  wp-block-code mr-fontsize2"><code>//START BLOCK PATTERNS
function custom_site_init() {
	register_block_pattern_category(
		'custom-site',
		array( 'label' =&gt; get_bloginfo() )
	);
	
	register_block_pattern(
		'custom-site/project-list',
		array(
			'title'       =&gt; __( 'Pattern 1', 'custom-site' ),
			'description' =&gt; _x( '', 'Block pattern description', 'custom-site' ),
			'keywords' =&gt; &#91;'pattern'],
			'categories' =&gt; &#91;'custom-site'],
			'content'     =&gt; 'PATTERN CONTENT',
		)
	); 
}
add_action( 'init', 'custom_site_init' );
//END BLOCK PATTERNS</code></pre>



<h3 class="  wp-block-heading"><strong>Understanding the code</strong> (optional)</h3>



<p>The code above can be reused on as many websites as you want.</p>



<p>It will automatically create a pattern&#8217;s category with the same name as the website using <em>get_bloginfo()</em> <em>(behind the scenes the slug will be &#8220;custom-site&#8221;, and although you can change that, it is more scalable this way)</em>.</p>



<p>The pattern name will be &#8220;Pattern 1&#8221;, this part you can change to whatever you want, depending on the project or the actual pattern.</p>



<p>You can also add a pattern description and add/replace keywords <em>(The keywords are utilized when a user is using the search input to find blocks)</em>.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-15 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img loading="lazy" decoding="async" width="1717" height="756" data-id="2540" src="https://marcosrego.com/wp-content/uploads/2022/02/create-block-patterns-01.jpg" alt="Code snippet to create block patterns" class="wp-image-2540" title="create block patterns 01 - How to create block patterns in Wordpress" srcset="https://marcosrego.com/wp-content/uploads/2022/02/create-block-patterns-01.jpg 1717w, https://marcosrego.com/wp-content/uploads/2022/02/create-block-patterns-01-300x132.jpg 300w, https://marcosrego.com/wp-content/uploads/2022/02/create-block-patterns-01-1024x451.jpg 1024w, https://marcosrego.com/wp-content/uploads/2022/02/create-block-patterns-01-768x338.jpg 768w, https://marcosrego.com/wp-content/uploads/2022/02/create-block-patterns-01-1536x676.jpg 1536w" sizes="auto, (max-width: 1717px) 100vw, 1717px" /><figcaption class="wp-element-caption">Code snippet to create block patterns</figcaption></figure>
</figure>



<h2 class="wp-block-heading"><strong>Create the block pattern with the editor</strong></h2>



<p>Now that we have prepared the code snippet, we can use the block editor to create the content for the pattern.</p>



<ul class="wp-block-list">
<li>On a different tab, go to <em>Pages &gt; Add New</em>.</li>



<li>Create the content for the patterns, using any type of blocks you want.</li>



<li>In the top right corner, click on the 3 dots.</li>



<li>Click on &#8220;Copy all content&#8221;.</li>



<li>Go back to the PHP file you previously created/selected.</li>



<li>Replace <em>PATTERN CONTENT</em> with the content you just copied.</li>



<li>Save the file.</li>
</ul>



<p></p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-3 wp-block-columns-is-layout-flex">
<div class="  wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-16 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="337" height="677" src="https://marcosrego.com/wp-content/uploads/2022/02/block-editor-copy-all-content.png" alt="Block editor - Copy all content - Option location" class="wp-image-2546" title="block editor copy all content - How to create block patterns in Wordpress" srcset="https://marcosrego.com/wp-content/uploads/2022/02/block-editor-copy-all-content.png 337w, https://marcosrego.com/wp-content/uploads/2022/02/block-editor-copy-all-content-149x300.png 149w" sizes="auto, (max-width: 337px) 100vw, 337px" /><figcaption class="wp-element-caption">Block editor &#8211; Copy all content &#8211; Option location</figcaption></figure>
</figure>
</div>
</div>



<h2 class="wp-block-heading"><strong>Add more block patterns</strong></h2>



<p>To create multiple block patterns, duplicate the function <em>register_block_pattern</em> from the code snippet above and repeat the same steps.</p>



<h2 class="wp-block-heading"><strong>Extra: Remove core block patterns from WordPress</strong></h2>



<p>Now that you added your own custom patterns, chances are you don&#8217;t want to show the default/core block patterns. </p>



<p>To do that, if you have Mr.Dev.&#8217;s Framework, you can simply enable <em>Styles Control</em> on the <em>Configuration tab</em>. Otherwise, you can add the following code on the previous code snippet, inside the main <em>custom_site_init</em> function:</p>



<pre class="mr-fontsize2  wp-block-code mr-fontsize2"><code>remove_theme_support( 'core-block-patterns' );</code></pre>



<h2 class="wp-block-heading"><strong>Will block patterns be on the interface?</strong></h2>



<p>Hopefully WordPress will soon add a good way to do this via the full site editor. There are some interesting discussions on which will be the best way, you can follow them:</p>



<ul class="wp-block-list">
<li><a href="https://github.com/WordPress/gutenberg/issues/31298" target="_blank" rel="noreferrer noopener">Patterns: Create a pattern similarly to how we create a Reusable block. · Issue #31298 · WordPress/Gutenberg (github.com)</a></li>



<li><a href="https://github.com/WordPress/gutenberg/issues/35305" target="_blank" rel="noopener">Selecting multiple blocks &#8211; Save as Pattern or Reusable block. · Issue #35305 · WordPress/gutenberg (github.com)</a></li>



<li><a href="https://github.com/WordPress/gutenberg/issues/38529" target="_blank" rel="noopener">Building with Patterns · Issue #38529 · WordPress/gutenberg (github.com)</a></li>
</ul>



<p>And that&#8217;s it! I hope the steps were clear and easy to follow. If not, feel free to comment below or <a href="https://marcosrego.com/client-area/contact/" data-type="post" data-id="678">contact me</a> if you prefer to talk about it privately.</p>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Get 5 official block editor features with any theme</title>
		<link>https://marcosrego.com/blog/block-editor-features-theme/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Mon, 01 Nov 2021 10:00:00 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Block editor]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Mr.Dev.'s Framework]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=2106</guid>

					<description><![CDATA[The block editor (aka Gutenberg) is the default site builder of WordPress but some handy features might be hidden, waiting for your theme to declare support. Which block editor features can be enabled? Features such as creation of block templates, responsive embeds, wide alignments for images, custom line-heights and custom spacing usually must be enabled [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-2106"></span>
<!--noteaser-->



<p class="">The block editor (aka Gutenberg) is the default site builder of WordPress but some handy features might be hidden, waiting for your theme to declare support.</p>



<h2 class="wp-block-heading"><strong>Which block editor features can be enabled?</strong></h2>



<p class="">Features such as <strong>creation of block templates, responsive embeds, wide alignments for images, custom line-heights and custom spacing</strong> usually must be enabled by <a href="https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/" target="_blank" data-type="URL" data-id="https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/" rel="noreferrer noopener">adding some code snippets into your theme</a>.</p>



<p class="">But what if you don&#8217;t have control over your theme code? What if you want to always have those features despite the theme you use?</p>



<p class="">Since the version 0.9.492 of <a href="https://marcosrego.com/development/mrdev-framework/" data-type="post" data-id="403">Mr.Dev.&#8217;s Framework</a>, that you can enable all those features without touching any code.</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><a href="https://marcosrego.com/development/mrdev-framework/"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-1024x538.png" alt="Mr.Dev.&#039;s Framework Opengraph Image" class="wp-image-1026" title="mrdevframework marcosrego opengraph - Get 5 official block editor features with any theme" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="  has-main-text-color-color has-text-color">When <strong>Mr.Dev.</strong> sells his <strong>framework</strong>, <strong>one unique payment</strong> gives you <strong>updates forever</strong> and for <strong>unlimited websites</strong>!</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/development/mrdev-framework/"><strong>Know more</strong></a></div>
</div>
</div></section>
</div></aside>



<h2 class="wp-block-heading"><strong>How to get those block editor features?</strong></h2>



<p class="">On the <strong>Configuration tab</strong> of <strong><a href="https://marcosrego.com/development/mrdev-framework/" data-type="post" data-id="403">Mr.Dev.&#8217;s Framework</a></strong>, located in <strong>Settings > Mr.Dev.</strong> <em>(Instead of Mr.Dev. you might see your site name, depending of the whitelabel configuration)</em>, you can find the section <strong>Styles Configuration</strong> with the dropdown <strong>Blocks Styles Picker</strong> and also the section <strong>Layout configuration</strong> with the dropdown <strong>Layout Control</strong>.</p>



<figure class="  wp-block-gallery columns-1 is-cropped wp-block-gallery-17 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://marcosrego.com/wp-content/uploads/2021/10/mrdev-framework-block-features.png"><img loading="lazy" decoding="async" width="1008" height="611" src="https://marcosrego.com/wp-content/uploads/2021/10/mrdev-framework-block-features.png" alt="Mr.Dev.&#039;s Framework - Block Features" data-id="2137" data-full-url="https://marcosrego.com/wp-content/uploads/2021/10/mrdev-framework-block-features.png" data-link="https://marcosrego.com/blog/block-editor-features-theme/attachment/mrdev-framework-block-features/" class="wp-image-2137" title="mrdev framework block features - Get 5 official block editor features with any theme" srcset="https://marcosrego.com/wp-content/uploads/2021/10/mrdev-framework-block-features.png 1008w, https://marcosrego.com/wp-content/uploads/2021/10/mrdev-framework-block-features-300x182.png 300w, https://marcosrego.com/wp-content/uploads/2021/10/mrdev-framework-block-features-768x466.png 768w" sizes="auto, (max-width: 1008px) 100vw, 1008px" /></a><figcaption class="blocks-gallery-item__caption">Block Styles Picker also allows to enable extra features of the block editor (aka Gutenberg).<br>(Screenshot taken on October 2021)</figcaption></figure></li></ul></figure>



<p class="">Depending of the option you choose on those dropdowns, different features will be enabled:</p>



<h3 class="  wp-block-heading"><strong>Block templates</strong></h3>



<p class="">If your theme already enables block templates, you can leave the dropdown <strong>Layout Control</strong> with the option &#8220;Disabled / Theme Controlled&#8221;, otherwise you can select &#8220;Enable block templates (Recommended)&#8221;.</p>



<p class="">You&#8217;ll also need to have WordPress 5.8 or above. </p>



<p class="">The <strong>Block templates</strong> feature, allows to add blocks inside template parts such as header and footer. All changes you do on a block inside a template part will apply to all pages using that template.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-4 wp-block-columns-is-layout-flex">
<div class=" mr-phone-hide  wp-block-column mr-phone-hide is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:16%">
<figure class="    wp-block-image size-full"><img loading="lazy" decoding="async" width="298" height="688" src="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-option.png" alt="block editor template option - Get 5 official block editor features with any theme" class="wp-image-2145" title="block editor template option - Get 5 official block editor features with any theme" srcset="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-option.png 298w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-option-130x300.png 130w" sizes="auto, (max-width: 298px) 100vw, 298px" /></figure>
</div>



<div class="  wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:78%">
<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="482" src="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-editor-1024x482.png" alt="Block editor template editor" class="wp-image-2146" title="block editor template editor - Get 5 official block editor features with any theme" srcset="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-editor-1024x482.png 1024w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-editor-300x141.png 300w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-editor-768x362.png 768w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-editor-1536x724.png 1536w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-template-editor.png 1908w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>
</div>



<div style="height:20px" aria-hidden="true" class="  wp-block-spacer"></div>



<h3 class="  wp-block-heading"><strong>Responsive embeds</strong></h3>



<p class="">This block editor feature will be enabled if you select one of this options:</p>



<ul class="wp-block-list"><li><strong>Disabled but with extra block features</strong> &#8211; It will not show the colors and sizes created using the framework (or the customizer) inside the block editor.</li><li><strong>Enabled with extra block features and allow custom styles</strong></li><li><strong>Enabled with extra block features</strong></li></ul>



<p class="">The <strong>Responsive embeds</strong> feature, automatically applies styles to embedded content to reflect the aspect ratio of content that is embedded in an iFrame, using the class <em>wp-embed-responsive</em> on the &lt;body&gt;.</p>



<div style="height:20px" aria-hidden="true" class="  wp-block-spacer"></div>



<h3 class="  wp-block-heading"><strong>Wide Alignment</strong></h3>



<p class="">This block editor feature will be enabled if you select one of this options:</p>



<ul class="wp-block-list"><li><strong>Disabled but with extra block features</strong> &#8211; It will not show the colors and sizes created using the framework (or the customizer) inside the block editor.</li><li><strong>Enabled with extra block features and allow custom styles</strong></li><li><strong>Enabled with extra block features</strong></li></ul>



<p class="">The <strong>Wide Alignment </strong>feature, gives the possibility of defining &#8220;wide&#8221; and &#8220;full&#8221; alignments to certain blocks, such as the image block.</p>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="578" src="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-wide-alignment-1024x578.png" alt="Block editor wide alignment" class="wp-image-2152" title="block editor wide alignment - Get 5 official block editor features with any theme" srcset="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-wide-alignment-1024x578.png 1024w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-wide-alignment-300x169.png 300w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-wide-alignment-768x433.png 768w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-wide-alignment.png 1453w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<div style="height:20px" aria-hidden="true" class="  wp-block-spacer"></div>



<h3 class="  wp-block-heading"><strong>Custom Line-Height</strong></h3>



<p class="">This block editor feature will be enabled if you select one of this options:</p>



<ul class="wp-block-list"><li><strong style="color: var(--main-text-color) ; font-family: var(--text-font, &quot;Arial,Helvetica Neue,Helvetica&quot;); background-color: var(--main-background-color, #dfdfd0);">Enabled with extra block features and allow custom styles</strong></li><li><strong><strong>Enabled and allow custom styles per block</strong></strong></li></ul>



<p class="">The <strong>Custom Line-Height</strong> feature, allows to customize the line height of certain blocks, such as the paragraph and headings.</p>



<figure class="    wp-block-image size-full"><img loading="lazy" decoding="async" width="776" height="280" src="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-paragraph-line-height.png" alt="Block editor paragraph line-height" class="wp-image-2153" title="block editor paragraph line height - Get 5 official block editor features with any theme" srcset="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-paragraph-line-height.png 776w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-paragraph-line-height-300x108.png 300w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-paragraph-line-height-768x277.png 768w" sizes="auto, (max-width: 776px) 100vw, 776px" /></figure>



<div style="height:20px" aria-hidden="true" class="  wp-block-spacer"></div>



<h3 class="  wp-block-heading"><strong>Custom Spacing</strong></h3>



<p class="">This block editor feature will be enabled if you select one of this options:</p>



<ul class="wp-block-list"><li><strong style="color: var(--main-text-color) ; font-family: var(--text-font, &quot;Arial,Helvetica Neue,Helvetica&quot;); background-color: var(--main-background-color, #dfdfd0);">Enabled with extra block features and allow custom styles</strong></li><li><strong><strong>Enabled and allow custom styles per block</strong></strong></li></ul>



<p class="">The <strong>Custom Spacing</strong> feature, will show padding controls in certain blocks, such as the column block. You can change the value for individual sides or keep the same for all sides.</p>



<figure class="    wp-block-image size-full"><img loading="lazy" decoding="async" width="774" height="599" src="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-padding-spacing.png" alt="Block editor padding spacing" class="wp-image-2156" title="block editor padding spacing - Get 5 official block editor features with any theme" srcset="https://marcosrego.com/wp-content/uploads/2021/10/block-editor-padding-spacing.png 774w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-padding-spacing-300x232.png 300w, https://marcosrego.com/wp-content/uploads/2021/10/block-editor-padding-spacing-768x594.png 768w" sizes="auto, (max-width: 774px) 100vw, 774px" /></figure>



<div style="height:20px" aria-hidden="true" class="  wp-block-spacer"></div>



<p class=""><strong><span style="color: var(--main-text-color) ; font-family: var(--text-font, &quot;Arial,Helvetica Neue,Helvetica&quot;); background-color: var(--main-background-color, #dfdfd0);">And the </span><em>Enabled</em><span style="color: var(--main-text-color) ; font-family: var(--text-font, &quot;Arial,Helvetica Neue,Helvetica&quot;); background-color: var(--main-background-color, #dfdfd0);"> option on the dropdown?</span></strong></p>



<p class="">It&#8217;s not part of this post&#8217;s topic, but if you prefer to let your theme/plugins decide most of the available features, but still want to show the colors and sizes created using the framework (or the customizer) on the block editor, then that option is for you.</p>



<div style="height:20px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>Getting Mr.Dev.&#8217;s Framework</strong></h2>



<p class="">If this easy method to enable block editor features despite the theme sounds good to you, but you don&#8217;t have this framework yet, then you can know more about it and get it anytime:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/client-area/downloads/?product=mrdevs-framework">Get it now</a></div>



<div class="   wp-block-button"><a class="wp-block-button__link has-main-background-color-color has-main-text-color-background-color has-text-color has-background" href="https://marcosrego.com/development/mrdev-framework/">Know more</a></div>
</div>



<div style="height:20px" aria-hidden="true" class="  wp-block-spacer"></div>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Mr.Utils enhances the block editor with 8 extra features</title>
		<link>https://marcosrego.com/blog/mr-utils-block-editor-features/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Wed, 13 Oct 2021 23:11:57 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Block editor]]></category>
		<category><![CDATA[For clients and authors]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Mr.Utils]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=1997</guid>

					<description><![CDATA[On this post, I&#8217;ll guide you on how to use my front-end toolkit Mr.Utils, to scale and get features on the block editor of WordPress. As explained on the previous post, a front-end toolkit might be the best future-proof and optimized solution to this site builder that is still growing. Depending of your website and [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class=""> On this post, I&#8217;ll guide you on how to use my front-end toolkit <strong><a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a></strong>, to scale and get features on the block editor of <a href="https://marcosrego.com/tag/wordpress/" data-type="post_tag" data-id="23">WordPress</a>.</p>



<span id="more-1997"></span>



<p class="">As explained on the <a href="https://marcosrego.com/blog/solve-block-editor-toolkit/" data-type="post" data-id="1878">previous post</a>, a front-end toolkit might be the best future-proof and optimized solution to this site builder that is still growing.</p>



<p class="">Depending of your website and theme configuration, you might already be able to use the editor to change things such as the font-size, margins and paddings. But those changes would be made on each block individually, there&#8217;s currently at the moment of writing, no way to change those properties globally. <strong>Mr.Utils</strong> gives you a way to do that.</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png" alt="Mr.Utils Opengraph Image" class="wp-image-1029" title="mrutils marcosrego opengraph - Mr.Utils enhances the block editor with 8 extra features" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="  has-main-text-color-color has-text-color"><strong><a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a></strong> gives you a set of classes with a clear syntax, such as <em><strong>mr-phone-hide</strong></em> clearly saying to hide an element on a phone, <strong><em>mr-marginright</em></strong> to add a margin on the right side of an element and <strong><a rel="noreferrer noopener" href="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" data-type="URL" data-id="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" target="_blank">so much more</a></strong>&#8230;</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/client-area/downloads/?product=mrutils"><strong>Get it now (free)</strong></a></div>
</div>
</div></section>
</div></aside>



<h2 class="wp-block-heading"><strong>Installing Mr.Utils to use on the block editor</strong></h2>



<p class="">On  the<strong> <a href="https://github.com/marcosrego-web/mr-utils/wiki#installation" target="_blank" rel="noreferrer noopener">documentation</a></strong> you&#8217;ll find a short and easy explanation on three methods to install <a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a>, by using Mr.Dev.&#8217;s Framework, by installing as a plugin or via manual installation. The most optimized method is using the framework because it allows you to select the type of utilities you want to use, combine and minify them.</p>



<p class=""></p>



<h3 class="  wp-block-heading"><strong>Preview Mr.Utils changes on the block editor (Optional)</strong></h3>



<p class="">Because the block editor is a very visual editor that closely resembles the front-end, you might want to see the changes that Mr.Utils will apply to your blocks, before actually saving the post.</p>



<p class="">If you did the installation as a plugin you don&#8217;t need to do anything else and you can skip to &#8220;<em><a href="#how_to_use_mrutils_features_on_the_block_editor">How to use Mr.Utils features on the block editor</a></em>&#8220;.</p>



<p class="">Otherwise, you can configure it easily by using <a href="https://marcosrego.com/development/mrdev-framework/" data-type="post" data-id="403">Mr.Dev.&#8217;s Framework</a>, or manually if that&#8217;s your thing.</p>



<div style="height:15px" aria-hidden="true" class="  wp-block-spacer"></div>



<h4 class="  wp-block-heading"><strong>Preview changes using Mr.Dev.&#8217;s Framework</strong></h4>



<p class="">On the plugin settings on the configuration tab, you will find the <em>CSS Utilities</em> section. Check the box <strong>Utils Backend</strong>, and you are ready to go.</p>



<p class="">If you want to use utilities on breakpoints, simply select the ones you want on the same group of checkboxes.</p>



<div style="height:15px" aria-hidden="true" class="  wp-block-spacer"></div>



<h4 class="  wp-block-heading"><strong>Manually configuration of the preview</strong></h4>



<p class="">Add the below code into the functions.php file or into a custom plugin.</p>



<pre class="wp-block-code"><code>add_action( 'admin_enqueue_scripts', 'mrutils_admin_styles' );
function mrutils_admin_styles() {
    wp_enqueue_style( 'mrutils_admin', 'https://raw.githubusercontent.com/marcosrego-web/mr-utils/master/css/utils.css', false, '1.0.0' );
    wp_enqueue_style( 'mrutils_admin_backend', 'https://raw.githubusercontent.com/marcosrego-web/mr-utils/master/css/utils_backend.css', false, '1.0.0' );
}</code></pre>



<p class="">If you want to add breakpoints you need to add more &#8220;wp_enqueue_style&#8221; to the above, between the first and last one, this time also indicating the intended media query, like this:</p>



<pre class="wp-block-code"><code>wp_enqueue_style( 'mrutils_admin_phone', 'https://raw.githubusercontent.com/marcosrego-web/mr-utils/master/css/utils_phone.css', false, '1.0.0','(max-width: 768px)' );</code></pre>



<p class="">If you want to avoid external requests:</p>



<ol class="  wp-block-list"><li><a href="https://marcosrego.com/client-area/downloads/?product=mrutils">Download Mr.Utils <em>(free)</em></a> </li><li>Unzip into your website. </li><li>Replace the link on the code above, with the location where you unzipped the folder.</li></ol>



<p class=""></p>



<h2 class="wp-block-heading"><strong>How to use Mr.Utils features on the block editor</strong></h2>



<p class="">If you installed Mr.Utils as a plugin, you&#8217;ll now see the option &#8220;Utilities&#8221; when selecting a block. By using that interface you don&#8217;t need to know the methods explained below.</p>



<figure class="    wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-18 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-full"><a href="https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1.png"><img loading="lazy" decoding="async" width="772" height="250" data-id="2289" src="https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1.png" alt="Mr.Utils options on WordPress block editor" class="wp-image-2289" title="banner 772x250 1 - Mr.Utils enhances the block editor with 8 extra features" srcset="https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1.png 772w, https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1-300x97.png 300w, https://marcosrego.com/wp-content/uploads/2021/10/banner-772x250-1-768x249.png 768w" sizes="auto, (max-width: 772px) 100vw, 772px" /></a><figcaption>Mr.Utils options on WordPress block editor</figcaption></figure>
</figure>



<p class="">If you didn&#8217;t install Mr.Utils as a plugin, most of the methods shown below, will work by adding specific classes into <strong>Advanced > Additional CSS Class(es)</strong> on any block:</p>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-with-frontedn-toolkit-1024x538.png" alt="Block editor with frontend toolkit" class="wp-image-1946" title="block editor with frontedn toolkit - Mr.Utils enhances the block editor with 8 extra features" srcset="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-with-frontedn-toolkit-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-with-frontedn-toolkit-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-with-frontedn-toolkit-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-with-frontedn-toolkit.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="  wp-block-heading"><strong>Global font-sizes</strong></h3>



<p class="">With Mr.Utils you have <strong>7 global font-sizes</strong> and it&#8217;s <strong>possible to change</strong> their values.</p>



<p class="">For example, add the class <strong>mr-fontsize5</strong> into <strong>Advanced &gt; Additional CSS Class(es)</strong> on any block that has text and see it changing sizes.</p>



<p class="">You can also use different sizes depending of the device/breakpoint joining multiple classes, for example:<br><strong>mr-fontsize5 mr-phone-fontsize4</strong><br><strong>mr-desktop-fontsize7 mr-tablet-fontsize5 mr-phone-fontsize6</strong></p>



<p class="">If you want to change the values for the 7 sizes, you can <a href="https://github.com/marcosrego-web/mr-utils/wiki/Variables#how-to-do" target="_blank" data-type="URL" data-id="https://github.com/marcosrego-web/mr-utils/wiki/Variables#how-to-do" rel="noreferrer noopener"><strong>check the documentation explaining how to change variables</strong></a>. It explains how to do it manually or using the Mr.Dev.&#8217;s Framework.</p>



<h3 class="  wp-block-heading"><strong>Global colors</strong> (Mr.Dev.&#8217;s Framework)</h3>



<p class="">For this one feature, Mr.Utils is currently not enough, you&#8217;ll want to use Mr.Dev.&#8217;s Framework to define which will be the global colors that appear on the block editor.</p>



<p class="">Being a global color means that if you select a color and then decide to change the value, all blocks using it will automatically have their colors changed to the new value.</p>



<figure class="  wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-19 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="     wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="693" data-id="958" src="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_styles-1024x693.jpg" alt="Mr.Dev.&#039;s Framework - Styles" class="wp-image-958" title="mrdev framework styles - Mr.Utils enhances the block editor with 8 extra features" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_styles-1024x693.jpg 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_styles-300x203.jpg 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_styles-768x520.jpg 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_styles.jpg 1342w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Use the plugin settings, or optionally use the customizer and block editor, to add global colors, typography, sizes and breakpoints.</figcaption></figure>
</figure>



<h3 class="  wp-block-heading"><strong>Remove margins and paddings of blocks</strong></h3>



<p class="">Removing margins and paddings can be very useful because currently at the moment of writing, some blocks have default margins or paddings that you might not want. It&#8217;s much easier to add a class instead of changing via CSS.</p>



<p class="">With Mr.Utils you can choose the side you want to remove the margin/padding or remove on all sides. Simply add the correspondent class into <strong>Advanced &gt; Additional CSS Class(es</strong>):</p>



<figure class="wp-block-table"><table><tbody><tr><td>mr-nomargin</td><td>mr-nopadding</td></tr><tr><td>mr-nomargintop</td><td>mr-nopaddingtop</td></tr><tr><td> mr-nomarginright</td><td> mr-nopaddingright</td></tr><tr><td> mr-nomarginbottom</td><td> mr-nopaddingbottom</td></tr><tr><td> mr-nomarginleft</td><td> mr-nopaddingleft</td></tr></tbody></table></figure>



<p class="">And you can also remove the margin/padding only on specific devices/breakpoints, for example:</p>



<p class=""><strong>mr-desktop-nomargin<br>mr-phone-nopaddingright</strong></p>



<h3 class="  wp-block-heading"><strong>Add global margins and paddings</strong></h3>



<p class="">Mr.Utils brings the classes <strong>mr-margin</strong> and <strong>mr-padding</strong>, that can also point to specific sides of the block:</p>



<figure class="wp-block-table"><table><tbody><tr><td>mr-margin</td><td>mr-padding</td></tr><tr><td>mr-margintop</td><td>mr-paddingtop</td></tr><tr><td> mr-marginright</td><td> mr-paddingright</td></tr><tr><td> mr-marginbottom</td><td> mr-paddingbottom</td></tr><tr><td> mr-marginleft</td><td> mr-paddingleft</td></tr></tbody></table></figure>



<p class="">And you can also use the margin/padding only on specific devices/breakpoints, for example:</p>



<p class=""><strong>mr-desktop-margin<br>mr-phone-paddingright</strong></p>



<p class="">If you want to change the values for the global margins and paddings, you can <a href="https://github.com/marcosrego-web/mr-utils/wiki/Variables#how-to-do" data-type="URL" data-id="https://github.com/marcosrego-web/mr-utils/wiki/Variables#how-to-do" target="_blank" rel="noreferrer noopener"><strong>check the documentation explaining how to change variables</strong></a>. It explains how to do it manually <strong>or using the Mr.Dev.&#8217;s Framework</strong>.</p>



<h3 class="  wp-block-heading"><strong>Change visibility of a block depending of the device</strong></h3>



<p class="">To show or hide a block, you can use the classes <strong>mr-show</strong> and <strong>mr-hide</strong> respectively.</p>



<p class="">To point to specific devices/breakpoints, all you have to do is to add the device name between the prefix and action. Here are some examples:</p>



<figure class="  wp-block-table is-style-regular"><table><tbody><tr><td class="has-text-align-left" data-align="left">Show on phone only:</td><td><strong>mr-hide mr-phone-show</strong></td></tr><tr><td class="has-text-align-left" data-align="left">Hide on phone:</td><td><strong>mr-phone-hide</strong></td></tr><tr><td class="has-text-align-left" data-align="left">Show on portrait devices:</td><td><strong>mr-landscape-hide</strong></td></tr><tr><td class="has-text-align-left" data-align="left">Hide on desktop and laptop:</td><td><strong>mr-desktop-hide mr-laptop-hide</strong></td></tr></tbody></table></figure>



<figure class="    wp-block-image size-large"><a href="https://marcosrego.com/websites/itemzero/"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/04/marcosrego-itemzero-open-graph-1024x538.png" alt="Itemzero Open Graph Image" class="wp-image-1012" title="marcosrego itemzero open graph - Mr.Utils enhances the block editor with 8 extra features" srcset="https://marcosrego.com/wp-content/uploads/2021/04/marcosrego-itemzero-open-graph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/04/marcosrego-itemzero-open-graph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/04/marcosrego-itemzero-open-graph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/04/marcosrego-itemzero-open-graph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption> The <a href="https://marcosrego.com/websites/itemzero/" data-type="post" data-id="1">Itemzero Shop</a> has some good examples of showing content depending of the device/breakpoint using <a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a>. </figcaption></figure>



<h3 class="  wp-block-heading"><strong>Change how Columns blocks display on mobile</strong></h3>



<p class="">By default when you set the number of columns on the Columns block, that number will apply on desktop. On mobile the columns will be automatically stacked below each other.</p>



<p class="">But if you only have images or you don&#8217;t have a lot of text in the columns, it could look better with 2 columns on each line.</p>



<p class="">You can do that with Mr.Utils, you can add classes such as <strong>mr-phone-2perline</strong> into <strong>Advanced &gt; Additional Class(es)</strong>.</p>



<p class="">If you installed the toolkit as a plugin it&#8217;s even more friendly: Click on &#8220;Utilities&#8221;, on the phone icon and then on layout you choose 2 as the number of items per line.</p>



<p class=""></p>



<h3 class="  wp-block-heading"><strong>Change the order of blocks depending of the device</strong></h3>



<p class="">Changing the order of blocks is easy with drag and drop but if you want to change the order depending of the device/breakpoint, you&#8217;ll need something more:</p>



<ol class="  wp-block-list"><li><strong>Select all the blocks that will be reordered</strong> and then select the option &#8220;<strong>Group</strong>&#8220;.</li><li>On the <strong>Group Block</strong> go to <strong>Advanced &gt; Additional CSS Class(es)</strong> and add the class <strong>mr-1perline</strong> (You can replace 1 with any number between 0 [infinite] and 12, this would be similar to using columns).</li><li>Then select the first block you want to reorder and on <strong>Advanced &gt; Additional CSS Class(es)</strong> section, add the class <strong>mr-<em>breakpoint</em>-order</strong> followed by a number between -1 and 12 and replacing <em>breakpoint</em> with the device name (desktop, laptop, tablet, phone or another custom breakpoint that exists). Example: <strong>mr-phone-order2</strong>. Do the same for each block inside the group (Repeated numbers are allowed).</li></ol>



<p class=""></p>



<h3 class="  wp-block-heading"><strong>Horizontal scroll list of posts</strong></h3>



<p class="">Using the block &#8220;Latest Posts&#8221;, or any other block that works as a list, you can add the class <strong>mr-swipecontent</strong> or <strong>mr-horizontalscrollcontent</strong> into <strong style="color: var(--main-text-color) ; font-family: var(--text-font, &quot;Arial,Helvetica Neue,Helvetica&quot;); font-size: revert; background-color: var(--main-background-color, #dfdfd0);">Advanced &gt; Additional CSS Class(es)</strong>, to make that list flow horizontally and become scrollable when the amount of items is big.</p>



<figure class="    wp-block-image size-large"><a href="https://marcosrego.com/websites/ressanogarcia/"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/04/ressanogarciaarquitectos-marcosrego-site-opengraph-1024x538.png" alt="Ressano Garcia Arquitectos Open Graph Image" class="wp-image-1813" title="ressanogarciaarquitectos marcosrego site opengraph - Mr.Utils enhances the block editor with 8 extra features" srcset="https://marcosrego.com/wp-content/uploads/2021/04/ressanogarciaarquitectos-marcosrego-site-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/04/ressanogarciaarquitectos-marcosrego-site-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/04/ressanogarciaarquitectos-marcosrego-site-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/04/ressanogarciaarquitectos-marcosrego-site-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption>The website <strong><a href="https://marcosrego.com/websites/ressanogarcia/">Ressano Garcia Arquitectos</a></strong> is a good example of horizontal scrolling lists of posts using <a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a>.</figcaption></figure>



<div style="height:15px" aria-hidden="true" class="  wp-block-spacer"></div>



<p class=""><strong>Those are the 8 features I wanted to share with you!</strong> I&#8217;ll update this post If I add more into <a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">this front-end toolkit</a>.</p>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The block editor with a front-end toolkit is still advised in 2021</title>
		<link>https://marcosrego.com/blog/solve-block-editor-toolkit/</link>
		
		<dc:creator><![CDATA[Marcos Rego]]></dc:creator>
		<pubDate>Wed, 29 Sep 2021 19:01:35 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Block editor]]></category>
		<category><![CDATA[For developers]]></category>
		<category><![CDATA[Mr.Utils]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://marcosrego.com/?p=1878</guid>

					<description><![CDATA[The block editor (aka Gutenberg) is the default site builder of WordPress and it&#8217;s the most optimized and performative you can have on this CMS. But it&#8217;s still growing and currently lacking some features. On this post, I&#8217;ll let you know why a front-end toolkit is currently the best future-proof solution to get some of [&#8230;]]]></description>
										<content:encoded><![CDATA[<span id="more-1878"></span>
<!--noteaser-->



<p class="">The block editor (aka Gutenberg) is the default site builder of WordPress and it&#8217;s the most optimized and performative you can have on this CMS. But it&#8217;s still growing and currently lacking some features.</p>



<p class="">On this post, I&#8217;ll let you know why a front-end toolkit is currently the best future-proof solution to get some of those lacking features right now.</p>



<aside class="  wp-block-group sidebar has-main-text-color-color has-aside-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<section class="wp-block-group has-main-text-color-color has-main-background-color-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h3 class="   has-main-text-color-color has-text-color wp-block-heading"><strong>Did you know?</strong></h3>



<figure class="    wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png" alt="Mr.Utils Opengraph Image" class="wp-image-1029" title="mrutils marcosrego opengraph - The block editor with a front-end toolkit is still advised in 2021" srcset="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-1024x538.png 1024w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-300x158.png 300w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph-768x403.png 768w, https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="  has-main-text-color-color has-text-color"><strong><a href="https://marcosrego.com/development/mr-utils/" data-type="post" data-id="473">Mr.Utils</a></strong> gives you a set of classes with a clear syntax, such as <em><strong>mr-phone-hide</strong></em> clearly saying to hide an element on a phone, <strong><em>mr-marginright</em></strong> to add a margin on the right side of an element and <strong><a rel="noreferrer noopener" href="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" data-type="URL" data-id="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" target="_blank">so much more</a></strong>&#8230;</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="   wp-block-button"><a class="wp-block-button__link has-invert-color-color has-link-color-background-color has-text-color has-background" href="https://marcosrego.com/client-area/downloads/?product=mrutils"><strong>Get it now (free)</strong></a></div>
</div>
</div></section>
</div></aside>



<h2 class="wp-block-heading"><strong>Some features might be hidden to you</strong></h2>



<p class="">Before I dive into the use of a front-end toolkit to add some of the lacking features, it&#8217;s best to make sure that they are actually lacking from the block editor.</p>



<p class="">Your theme or plugins might lock some of the new features and in some cases your theme could simply declare support with a short code snippet.</p>



<p class=""><a href="https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/" target="_blank" data-type="URL" data-id="https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/" rel="noreferrer noopener">On this page of the WordPress documentation</a>, you can find some of the features that are available but need the theme or <a href="https://marcosrego.com/blog/block-editor-features-theme/" data-type="post" data-id="2106">a plugin to declare support</a>.</p>



<p class="">If all the features you need are mentioned on that page, then <a href="https://marcosrego.com/blog/block-editor-features-theme/" data-type="post" data-id="2106">declaring support is in fact the best option</a> (You can use <a href="https://marcosrego.com/development/mrdev-framework/" data-type="post" data-id="403">Mr.Dev.&#8217;s Framework</a> to do that). If they are not, then you might find a better solution by continue to read this post.</p>



<figure class="  wp-block-gallery columns-1 is-cropped wp-block-gallery-20 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-hidden-features.jpg"><img loading="lazy" decoding="async" width="1024" height="437" src="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-hidden-features-1024x437.jpg" alt="block editor hidden features - The block editor with a front-end toolkit is still advised in 2021" data-id="1949" data-full-url="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-hidden-features.jpg" data-link="https://marcosrego.com/?attachment_id=1949" class="wp-image-1949" title="block editor hidden features - The block editor with a front-end toolkit is still advised in 2021" srcset="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-hidden-features-1024x437.jpg 1024w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-hidden-features-300x128.jpg 300w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-hidden-features-768x328.jpg 768w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-hidden-features.jpg 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="blocks-gallery-item__caption">Some block editor features might be hidden, such as patterns, and individual paddings, font-sizes, line-height and gradients.</figcaption></figure></li></ul></figure>



<p class=""></p>



<h2 class="wp-block-heading"><strong>You should not use plugins to extend the block editor</strong></h2>



<p class="">The easiest solution for the lacking features would be of course, to get them via a third-party plugin, <strong>but that doesn&#8217;t mean it&#8217;s the best or the most scalable option.</strong></p>



<p class="">Plugins such <a href="https://wordpress.org/plugins/editorplus/" target="_blank" data-type="URL" data-id="https://wordpress.org/plugins/editorplus/" rel="noreferrer noopener">Editor Plus by Extendify</a>, <a href="https://wordpress.org/plugins/kadence-blocks/" target="_blank" data-type="URL" data-id="https://wordpress.org/plugins/kadence-blocks/" rel="noreferrer noopener">Kadence Blocks</a>, <a href="https://wordpress.org/plugins/lazy-blocks/" target="_blank" data-type="URL" data-id="https://wordpress.org/plugins/lazy-blocks/" rel="noreferrer noopener">Lazy Blocks</a> and <a href="https://www.advancedcustomfields.com/resources/blocks/" target="_blank" data-type="URL" data-id="https://www.advancedcustomfields.com/resources/blocks/" rel="noreferrer noopener">ACF Blocks</a> are impressive for sure but a quick look at their changelogs and you&#8217;ll notice they are bloated with features or dependencies that you might not need or that will soon be available by default on the block editor.</p>



<p class="">That leaves a question with difficult answers:<br><strong>What will happen when those new features arrive to WordPress?</strong><br>Will the plugin developers find a way to transfer all the repeated features to the methods of Gutenberg Block Editor? Or will they force everyone to keep the plugin active so their own features keep working?<br>The latter is more likely and would force to have multiple ways to do the exact same things.</p>



<figure class="   wp-block-gallery columns-1 is-cropped wp-block-gallery-21 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-plugins-repeated-features.jpg"><img loading="lazy" decoding="async" width="1005" height="763" src="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-plugins-repeated-features.jpg" alt="Block editor plugins repeated features" data-id="1953" data-full-url="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-plugins-repeated-features.jpg" data-link="https://marcosrego.com/?attachment_id=1953" class="wp-image-1953" title="block editor plugins repeated features - The block editor with a front-end toolkit is still advised in 2021" srcset="https://marcosrego.com/wp-content/uploads/2021/09/block-editor-plugins-repeated-features.jpg 1005w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-plugins-repeated-features-300x228.jpg 300w, https://marcosrego.com/wp-content/uploads/2021/09/block-editor-plugins-repeated-features-768x583.jpg 768w" sizes="auto, (max-width: 1005px) 100vw, 1005px" /></a><figcaption class="blocks-gallery-item__caption">An example of the block editor adding a center alignment while an extra plugin adds a left alignment.</figcaption></figure></li></ul></figure>



<p class="">Doesn&#8217;t sound serious yet? What if I tell you that, having so many active options and plugins to do the same things will increase the amount of needed scripts, styles on your pages, <strong>decreasing your speed score</strong> that also affects SEO (Search Engine Optimization).</p>



<p class="">Another things to keep in mind are:</p>



<ul class="wp-block-list"><li>Some of those plugins also <strong>change the natural workflow of the editor</strong>: It&#8217;s difficult enough to force users to get used to a new way of working on their websites, imagine having multiple ways.<br>And I know WordPress always had that problem, but now that WordPress is trying to fix that with the block editor, it seems to me some of those plugins are not doing much better for the long-run.</li><li>Some of those plugins are <strong>based on old technologies and do requests to the server</strong>. The essence of the native blocks is the <strong>use of React and to do more on the client-side</strong>, that&#8217;s what makes the native blocks so well optimized compared to other site builders.</li></ul>



<p class="">Don&#8217;t you agree? Let me know in the comments section below.</p>



<p class="">If still you prefer to go with a plugin, choose one that lets you <strong>go back to the default values</strong> and/or that <strong>helps you transition back,</strong> when you don&#8217;t want to rely on that plugin anymore.</p>



<p class=""></p>



<h2 class="wp-block-heading"><strong>What you need on the block editor for now is a middle term solution!</strong></h2>



<h3 class="  wp-block-heading"><strong>Using a front-end toolkit</strong></h3>



<p class="">Get a lightweight and easy to use front-end toolkit, such as <strong><a href="https://marcosrego.com/development/mr-utils/">Mr.Utils</a></strong> (free). It includes classes that are friendly for everyone and can be added on each block &#8220;Advanced&#8221; section.</p>



<p class="">And if that&#8217;s not friendly enough for you or your clients, you can actually install Mr.Utils as a plugin for free. It adds an interface on the block editor that allows to add classes without actually knowing them. But of course, this starts to get closer to the plugins mentioned above, still lighter than them though!</p>



<h3 class="  wp-block-heading"><strong>Using a lightweight framework</strong></h3>



<p class="">Or get a lightweight framework such as <strong><a href="https://marcosrego.com/development/mrdev-framework/">Mr.Dev.&#8217;s Framework</a></strong>, that focus on new features, discontinues the repeated ones <em>(that are already available on the CMS)</em> and even helps you on the transition to the CMS method/feature.</p>



<p class="">The framework also has the option to use an interface on the block editor.</p>



<h3 class="  wp-block-heading"><strong>Solutions overview</strong></h3>



<p class="">Mr.Utils front-end toolkit, Mr.Utils as a plugin and Mr.Dev&#8217;s Framework are much lighter compared to the plugins mentioned above and much easier to scale and transition to future methods.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-5 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="  wp-block-video"><video controls muted poster="https://marcosrego.com/wp-content/uploads/2021/06/mrutils-marcosrego-opengraph.png" preload="none" src="https://marcosrego.com/wp-content/uploads/2021/06/mrutils_desktop.mp4" playsinline></video><figcaption>Video showing Mr.Utils classes and un-minified code for all breakpoints (on August 2021)</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="  wp-block-video"><video controls muted poster="https://marcosrego.com/wp-content/uploads/2021/06/mrdevframework-marcosrego-opengraph.png" preload="none" src="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_desktop.mp4" playsinline></video><figcaption>Video showing the available options on Mr.Dev.&#8217;s Framework (on August 2021)</figcaption></figure>
</div>
</div>



<h3 class="  wp-block-heading"><strong>What about other front-end toolkits?</strong></h3>



<p class="">Of course you can use other, specially if you already have another installed on your website.<br><a href="https://getbootstrap.com/" target="_blank" data-type="URL" data-id="https://getbootstrap.com/" rel="noreferrer noopener">Bootstrap</a> probably comes to mind, but I feel my <a href="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" target="_blank" data-type="URL" data-id="https://github.com/marcosrego-web/mr-utils/wiki/Utility-Classes" rel="noreferrer noopener">utility classes</a> are a bit more straightforward and more friendly to explain to non-tech users. They always work the same way <em>prefix-breakpoint-action</em>, such as <em>mr-phone-hide</em> or <em>mr-desktop-nomargin</em> <em>(mr-nomargin for actions on all breakpoints)</em>.</p>



<p class=""></p>



<h2 class="wp-block-heading"><strong>Getting 8 of the lacking features on the block editor</strong></h2>



<p class="">What Mr.Utils / Mr.Dev.&#8217;s Framework add to the block editor is a way to: </p>



<ol class="  wp-block-list"><li><strong>Change to a global font-size.</strong></li><li><strong>Change global color.</strong></li><li><strong>Remove margins and paddings of blocks.</strong></li><li><strong>Add global margins and paddings.</strong></li><li><strong>Change visibility of a block depending of the device.</strong></li><li><strong>Change how Columns blocks display on mobile</strong></li><li><strong>Change order of blocks depending of the device.</strong></li><li><strong>Horizontal scroll list of posts.</strong></li></ol>



<p class=""><a href="https://marcosrego.com/blog/mr-utils-block-editor-features/" data-type="post" data-id="1997"><strong>Check the next post</strong></a> where I go deeper on how to do those <em>actions</em>.</p>



<h2><b>Comments</b></h2>
<div id="disqus_thread"></div>
<script>
if(mrGetCookie('cookielawinfo-checkbox-functional') == 'yes') {
    var disqus_config = function () {
        this.page.url = (location.protocol+'//'+location.host+location.pathname).replace("/account/", "/");
        this.page.identifier = document.querySelector("article").id.replace("post-", "");
    };
    
    (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://marcosrego-web.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
} else {
    document.querySelector('#disqus_thread').innerHTML = 'You cannot view or add comments because you did not consent to the use of functional cookies: <a class="  cli_manage_current_consent" style="cursor:pointer;">Manage your consent.</a>';
}
</script>
]]></content:encoded>
					
		
		<enclosure url="https://marcosrego.com/wp-content/uploads/2021/06/mrutils_desktop.mp4" length="6043294" type="video/mp4" />
<enclosure url="https://marcosrego.com/wp-content/uploads/2021/06/mrdev-framework_desktop.mp4" length="2424924" type="video/mp4" />

			</item>
	</channel>
</rss>
