{"id":23,"date":"2025-09-26T08:50:46","date_gmt":"2025-09-26T08:50:46","guid":{"rendered":"https:\/\/ska-blocks.com\/docs\/2025\/09\/26\/variables\/"},"modified":"2025-09-26T09:43:58","modified_gmt":"2025-09-26T09:43:58","slug":"variables","status":"publish","type":"post","link":"https:\/\/ska-blocks.com\/docs\/variables\/","title":{"rendered":"Variables"},"content":{"rendered":"\n<p class=\"lead\">Variables allow creating arbitrary Tailwind classes that create CSS variables, such as <code>[--var:value]<\/code>.<\/p>\n\n\n\n<p>Adding a value prefixed with <code>--<\/code> to the Tailwind input allows to create a &#8220;variable&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/03\/image-91.png\" alt=\"\" class=\"wp-image-748\"\/><\/figure>\n\n\n\n<p>A variable value can be a raw value or a value of a specific type:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2024\/03\/image-92.png\" alt=\"\" class=\"wp-image-749\"\/><\/figure>\n\n\n\n<p>Variable name can also contain variants, such as <code>sm:--var<\/code>, which would create the variable starting from small screens only.<\/p>\n\n\n\n<p>In fact, it is not a requirement to create CSS variables with this feature, you can also create any CSS rule that Tailwind doesn&#8217;t support, such as <code>clip-path<\/code> with value <code>circle(40%)<\/code> would create the class <code>[clip-path:circle(40%)]<\/code> which would create the CSS:<\/p>\n\n\n\n<div class=\"wp-block-ska-code not-prose ska-preset--ska-theme--code\"><div class=\"content\"><pre class=\"code css language-css\"><code class=\"language-css\">.\\&#91;clip-path\\:circle\\(40\\%\\)\\] {\n\t-webkit-clip-path: circle(40%);\n\tclip-path: circle(40%);\n}<\/code><\/pre><\/div><\/div>\n\n\n\n<p>Just that to display the interface for creating variables you would first have to enter a value prefixed with <code>--<\/code>, but you can later change it to anything.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Variables allow creating arbitrary Tailwind classes that create CSS variables, such as [&#8211;var:value]. Adding a value prefixed with &#8212; to the Tailwind input allows to create a &#8220;variable&#8221;: A variable value can be a raw value or a value of a specific type: Variable name can also contain variants, such as sm:&#8211;var, which would create&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-23","post","type-post","status-publish","format-standard","hentry","category-ska-blocks"],"_links":{"self":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/23","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=23"}],"version-history":[{"count":1,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/23\/revisions\/227"}],"wp:attachment":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}