Tailwind CSS
Required plugins:
CSS, Tailwind CSS - The plugins are bundled with GoLand and enabled by default.
GoLand integrates with the Tailwind CSS version 4 framework including completion for Tailwind classes in HTML files and completion suggestions for pseudo-class variants, preview of the resulting CSS on hovering over classes in HTML and CSS files or on autocompletion.
For earlier versions, GoLand recognizes tailwind.config.js files and provides completion based on customization you make to them.
Make sure you have Node.js on your computer.
Make sure the CSS and Tailwind CSS bundled plugins are enabled in the Installed tab of the Settings | Plugins page as described in Managing plugins.
note
The default supported version is Tailwind CSS 4. See Tailwind CSS upgrade guide to learn how to migrate your code to it.
You can install Tailwind CSS version 4 in several ways depending on the frameworks you are using in your application. Learn more from the Tailwind CSS official website.
Installing Tailwind CSS with Vite is recommended if you are going to use SvelteKit, React Router or Nuxt in your project.
Make sure you have installed and configured Vite as described in Install Vite in an empty project and Configure Vite in GoLand.
Open the embedded Terminal (AltF12) and type:
npm install tailwindcss @tailwindcss/vite
To configure the
@tailwindcss/vite
plugin, open the Vite configuration file and add the followingimport
statement to it:import tailwindcss from '@tailwindcss/vite'
Then add the following line under
plugins
:plugins: [ tailwindcss(), ]
Open the CSS file where you want to use Tailwind CSS and add the following
import
statement to it:@import "tailwindcss";
Open your HTML file and add a link to compiled CSS under the
<head>< /head>
tag, for example,<link href="/src/styles.css" rel="stylesheet">
Learn more from the Tailwind CSS official website.
Installing Tailwind CSS with PostCSS is recommended if you are using Next.js or Angular in your project.
Make sure you have Node.js on your computer. Configure a Node.js interpreter in your project as described in Configuring a local Node.js interpreter, or in Using Node.js on Windows Subsystem for Linux, or in Configuring remote Node.js interpreters.
Make sure the CSS and Tailwind CSS bundled plugins are enabled in the Installed tab of the Settings | Plugins page as described in Managing plugins.
Open the embedded Terminal (AltF12) and type:
npm install tailwindcss @tailwindcss/postcss postcss
To configure the
@tailwindcss/postcss
plugin, open the PostCSS configuration file and add the following line underplugins
:plugins: { "@tailwindcss/postcss": {}, }
Open the CSS file where you want to use Tailwind CSS and add the following
import
statement to it:@import "tailwindcss";
Open your HTML file and add a link to compiled CSS under the
<head>< /head>
tag, for example,<link href="/src/styles.css" rel="stylesheet">
Learn more from the Tailwind CSS official website.
Open the embedded Terminal (AltF12) .
To install Tailwind CSS, type:
npm install -D tailwindcss@3
To generate a configuration file, type:
npx tailwindcss init
As result, a tailwind.config.js configuration file is created in the root of your project.
Learn more from the Tailwind CSS version 3 official website.
Starting with GoLand 2024.3.2, the latest Tailwind CSS language server is provided out of the box.
For earlier versions, you have to configure the Tailwind CSS language server manually.
Install the latest version of the @tailwindcss/language-server package globally. To do that, open the embedded Terminal (AltF12) and type
npm install -g @tailwindcss/language-server
.Open the Settings dialog (CtrlAlt0S) , go to Settings | Languages & Frameworks | Style Sheets | Tailwind CSS and specify the path to the package in the Language Server field.
GoLand autocompletes Tailwind classes in HTML files and in CSS files after the @apply
directive.

GoLand suggests Tailwind classes for completion in JavaScript string literals.

Completion suggestions are also shown for pseudo-class variants.

GoLand can provide completion for Tailwind classes within Slim templates as well as in .haml, .jte, and .kte files.
Press CtrlAlt0S to open settings and then select Languages & Frameworks | Style Sheets | Tailwind CSS.
In the
includeLanguages
property, add contexts where you want to get completion for Tailwind classes. Use the following format:"slim": "slim"
"haml": "haml"
"jte": "html"
"kte": "html"
To enable Tailwind class completion in Slim templates and .haml files, set the
emmetCompletions
property totrue
.
When you hover over a Tailwind class in an HTML or CSS file, GoLand shows you a Documentation popup with the preview of the resulting CSS. To view the preview in a tool window, click and select Show in Documentation Tool Window.

The preview is also shown in the Documentation popup (Ctrl0Q) when you complete your code.

note
Starting with Tailwind CSS 4, no configuration file is required.
GoLand provides code completion based on the customization you make through your tailwind.config.js configuration files. For example, if you define a custom theme with new colors, newly generated classes with the name of the custom color will be shown in the completion popup.

You can also customize the default Tailwind configuration options. For example, you may want to tune the HTML attributes list for which to provide class completions or use an experimental regular expression format to specify additional places where completions should be triggered.
Open the Settings dialog (CtrlAlt0S) and go to Languages and Frameworks | Style Sheets | Tailwind CSS.
Update the properties to add configuration options.
Thanks for your feedback!