cmccomas
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Gutenberg] Rendering arbitrary Tailwind CSS classes in blockThanks for the suggestions. It works every where else in the theme (header.php, single.php, in a custom shortcode, etc) except in the render.php file for our custom block.
We can’t use the escaped
>character because of the way Tailwind parses files and generates classes based on the text in the PHP files.I’ll keep digging, thanks again!
Forum: Plugins
In reply to: [Gutenberg] Rendering arbitrary Tailwind CSS classes in block@greenshady thanks for the response. This is the code in render.php:
<?php
/**
* @see https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#render
*/
?>
<div class="[&>[data-slot=icon]]:size-24">
<svg data-slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M160 0H384V160H544V512H256v0V418.1l5.9-.8L286 414l3.3-24.1 3.4-25.3L312.9 349l19.2-14.9L323 311.6 313.3 288l9.7-23.6 9.2-22.5L312.9 227l-20.2-15.6-3.4-25.3L286 161.9l-24.1-3.3-25.3-3.4L221 135.1l-14.9-19.2L183.6 125 160 134.7V0zm0 509.7l3.6 2.3H160v-2.3zM544 128H416V0L544 128zM124.3 154.6l5.6 2.3L160 169.3 190.1 157l5.6-2.3 3.7 4.8 19.9 25.7 32.2 4.4 6 .8 .8 6 4.4 32.2 25.7 19.9 4.8 3.7-2.3 5.6L278.7 288 291 318.1l2.3 5.6-4.8 3.7-25.7 19.9-4.4 32.2-.8 6-6 .8L224 390.2V512l-64-40L96 512V390.2l-27.6-3.8-6-.8-.8-6-4.4-32.2L31.5 327.4l-4.8-3.7 2.3-5.6L41.3 288 29 257.9l-2.3-5.6 4.8-3.7 25.7-19.9 4.4-32.2 .8-6 6-.8 32.2-4.4 19.9-25.7 3.7-4.8zM224 288c0-35.3-28.7-64-64-64s-64 28.7-64 64s28.7 64 64 64s64-28.7 64-64z"/></svg>
</div>
Viewing 2 replies - 1 through 2 (of 2 total)