Join the Webstudio community

Updated 7 months ago

use tailwind

At a glance

The community member who posted the original post discovered a way to use TailwindCSS by wrapping the Tailwind CDN inside an HTML Embed element and turning on "Run Scripts on Canvas". They wondered if there are any downsides to this method.

In the comments, other community members provided the following feedback:

- Using a link tag instead of a script tag is recommended, as the biggest downside is losing the ability to see the values in the style panel and with any custom CSS from the HTML Embed.

- Utility-based styling has the downside of having to repeat the same classes over and over, and a combination of semantic tokens and some utility tokens is recommended.

- The community members also mentioned that Webstudio has the ability to natively create utility-style tokens, and that a copy-paste feature to autoconvert to Tailwind is planned but not yet available.

Hello everyone,
I just found out that we can use TailwindCSS by wrapping Tailwind CDN inside the <script> tag, put it in "HTML Embed" element and turn on "Run Scripts on Canvas".
I can config tailwind and stuff but I wonder if there is any downside to this method.
O
H
8 comments
hi,
  1. you would use a link tag, not script
  2. biggest downside is you loose ability to see those values in the style panel
Same thing is with any custom css from html embed
last but not least - utility style tokens can be done natively with webstudio, somebody has to replicate the most popular tailwind namings and provide it as a style guide/project/template

I would accept this in the marketplace
generally this utility-based naming has a big downside - you have to repeat these things over and over on every instance
I would rather recommend a combination of semantic tokens and some utility tokens
going all in in either semantic or utility results in more work
I was trying to find a way to work around cause my other project style was built on top of Tailwind xD
Thank you for your response 🫶
we are planing on having also copy-paste with tailwind to autoconvert, but no promises when this will arrive
Add a reply
Sign up and join the conversation on Discord