{"id":58,"date":"2025-09-26T08:50:57","date_gmt":"2025-09-26T08:50:57","guid":{"rendered":"https:\/\/ska-blocks.com\/docs\/2025\/09\/26\/getting-started\/"},"modified":"2025-09-26T09:37:39","modified_gmt":"2025-09-26T09:37:39","slug":"getting-started-with-ska-blocks","status":"publish","type":"post","link":"https:\/\/ska-blocks.com\/docs\/getting-started-with-ska-blocks\/","title":{"rendered":"Getting started"},"content":{"rendered":"\n<p class=\"lead\"><strong>ska-blocks<\/strong> is a free <a href=\"https:\/\/wordpress.org\/plugins\/ska-blocks\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress plugin<\/a> that adds the ability to add <strong>Tailwind CSS<\/strong> classes to all Block Editor blocks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"basics\">Basics<\/h2>\n\n\n\n<p>The plugin will add an input field to the block inspector controls sidebar:<\/p>\n\n\n\n<img loading=\"lazy\" decoding=\"sync\" class=\"ring-1 ring-site-border wp-block-ska-image image\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-7.png\" alt=\"Input for Tailwind CSS classes in the WordPress block editor's Paragraph block\" width=\"280\" height=\"349\"\/>\n\n\n\n<p>Using the input field Tailwind classes can be added directly, by inputting, for example, <code>m-4<\/code> and pressing enter. The value will then be reflected below:<\/p>\n\n\n\n<img loading=\"lazy\" decoding=\"sync\" class=\"ring-1 ring-site-border wp-block-ska-image image\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-6.png\" alt=\"m-4 Tailwind class applied to a block using ska-blocks controls\" width=\"280\" height=\"227\"\/>\n\n\n\n<p>The value can then be modified by clicking on it:<\/p>\n\n\n\n<a aria-label=\"View image in full screen\" data-pswp-height=\"287\" data-pswp-width=\"950\" data-ska-pswp=\"ska-pswp-1\" href=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-8.png\" class=\"ring-1 ring-site-border wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-8.png\" alt=\"User interface for editing a Tailwind class in the WordPress editor\" width=\"950\" height=\"287\" loading=\"lazy\"\/><\/a>\n\n\n\n<p>Alternatively you can search for Tailwind features and add them this way:<\/p>\n\n\n\n<img decoding=\"async\" class=\"ring-1 ring-site-border wp-block-ska-image image\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-9.png\" alt=\"Automatic suggestions for adding Tailwind classes\" width=\"280\" height=\"344\" loading=\"lazy\"\/>\n\n\n\n<a aria-label=\"View image in full screen\" data-pswp-height=\"342\" data-pswp-width=\"944\" data-ska-pswp=\"ska-pswp-2\" href=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-10.png\" class=\"ring-1 ring-site-border wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-10.png\" alt=\"User interface for choosing a value for a class\" width=\"944\" height=\"342\" loading=\"lazy\"\/><\/a>\n\n\n\n<p>Meaning you don&#8217;t necessarily need to remember all the possible Tailwind features and their option variations. When you add new values to the Tailwind configuration, they will also show up in the UI. Entering a custom value in the <code>[ ]<\/code> field can produce an arbitrary value that is only visible for the current block.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"variants\">Variants<\/h2>\n\n\n\n<p>The UI also supports adding different variants and selecting separate values for them:<\/p>\n\n\n\n<a aria-label=\"View image in full screen\" data-pswp-height=\"664\" data-pswp-width=\"973\" data-ska-pswp=\"ska-pswp-3\" href=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-11.png\" class=\"ring-1 ring-site-border wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-11.png\" alt=\"Default and sm variants of a padding value\" width=\"973\" height=\"664\" loading=\"lazy\"\/><\/a>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"css\">CSS<\/h2>\n\n\n\n<p>The plugin will collect all the Tailwind classes of a block and compile them to produce CSS.<\/p>\n\n\n\n<p>The CSS is then stored in the block attributes so that it can be rendered in the block editor to give you a <strong>real-time preview<\/strong> of what the Tailwind classes are doing.<\/p>\n\n\n\n<p>The CSS is also rendered on the <strong>front end<\/strong>. When you have multiple blocks on the same page that use the same Tailwind classes they are <strong>tree-shaken<\/strong>, meaning every Tailwind class&#8217; CSS is only rendered once.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"blocks\">Blocks<\/h2>\n\n\n\n<p>The <strong>ska-blocks<\/strong> plugin also comes with a handful of blocks. Most notable of which are the <a href=\"https:\/\/ska-blocks.com\/docs\/ska-blocks\/element-block\/\" data-type=\"post\" data-id=\"203\">Element<\/a> and <a href=\"https:\/\/ska-blocks.com\/docs\/ska-blocks\/text-block\/\" data-type=\"post\" data-id=\"213\">Text<\/a> blocks.<\/p>\n\n\n\n<p>The <strong>Element<\/strong> block produces an HTML element that can contain children (e.g. <code>div<\/code>, <code>ul<\/code>, <code>section<\/code>), the <strong>Text<\/strong> block produces an HTML element that can contain text (e.g. <code>span<\/code>, <code>p<\/code>, <code>a<\/code>).<\/p>\n\n\n\n<p>Both of the blocks have the ability to assume any HTML <strong>tag name<\/strong> as well as to have any HTML <strong>attributes<\/strong>. Combined with Tailwind CSS classes, this unlocks the ability produce virtually any design directly in the WordPress Block Editor. The <strong>ska-theme<\/strong> also comes with <a href=\"https:\/\/alpinejs.dev\/\">Alpine.js<\/a> which allows for interactivity as well.<\/p>\n\n\n\n<h2 class=\"[&amp;_a]:font-[weight:inherit] wp-block-heading ska-preset--ska-theme--links\" id=\"usage-without-ska-theme\">Usage without <a href=\"https:\/\/ska-blocks.com\/docs\/ska-theme\/getting-started-with-ska-theme\/\" data-type=\"post\" data-id=\"124\">ska-theme<\/a><\/h2>\n\n\n\n<p>When using ska-blocks without ska-theme, loading of <strong>Tailwind preflight<\/strong> is disabled by default as it may conflict with your existing theme styles.<\/p>\n\n\n\n<p>The preflight can be toggled from <strong>ska-blocks -&gt; General -&gt; Tailwind global styles<\/strong> setting.<\/p>\n\n\n\n<div role=\"figure\" class=\"inline-block p-2 ring-1 ring-site-border wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/02\/image-12.png\" alt=\"ska-blocks option allowing to select which parts of Tailwind CSS to enqueue\" width=\"218\" height=\"121\" loading=\"lazy\"\/><\/div>\n\n\n\n<p>When using Tailwind without the preflight, some classes may not work properly, such as instead of using <code>border<\/code> to add a border, you would need to add <code>border border-solid<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"usage-with-classic-theme\">Usage with a classic theme<\/h2>\n\n\n\n<p>When using ska-blocks without a Full Site Editing theme, you&#8217;ll probably run into issues with additional (unwanted) styles being applied to blocks in the block editor. Using <code>m-0!<\/code> and <code>*:m-0!<\/code> classes can be used to reset most of the margins when needed, but you&#8217;ll really need to know what you&#8217;re doing and probably need to open the browser dev tools a lot to see which CSS rules are coming from where and use <code>!<\/code> a lot.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ska-blocks is a free WordPress plugin that adds the ability to add Tailwind CSS classes to all Block Editor blocks. Basics The plugin will add an input field to the block inspector controls sidebar: Using the input field Tailwind classes can be added directly, by inputting, for example, m-4 and pressing enter. The value will&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-ska-blocks"],"_links":{"self":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":1,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":182,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/58\/revisions\/182"}],"wp:attachment":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}