stavanger

stavanger

How to force the Tailwind CSS IntelliSense extension for VSCode work with .html.eex and .html.leex files?

I same tried add settings .html.eex and .html.leex for IntelliSense for CSS class names in HTML, but don’t work for me.

So I can see this extension support HTML (EEx): tailwindcss-intellisense/src/index.ts at f5dfe02f74ac9bd68529f1997ae875691b819833 · tailwindlabs/tailwindcss-intellisense · GitHub

Thanks for help.

Showing Posts 1 to 10

tme_317

tme_317

I had the same issue… and I think the line of code you referenced is recently committed to master but is still unreleased on the VSCode extension site. I tried cloning master and building/installing the .vsix file myself but for some reason it still didn’t work. Maybe the issue relates to recent capitalization changes in the file type (Eex vs EEx).

After wasting some time I ended up punting and just changing the VSCode file type (lower right hand corner of window) to HTML manually when editing tailwind classes which is annoying but does work.

stavanger

stavanger OP

It really works, I think that you’re right. I wrote report at issue on the GitHub: Not working for HTML-like files · Issue #58 · tailwindlabs/tailwindcss-intellisense · GitHub

Thank you for help! Will wait fix.

ps: So, I see that autor a long time don’t reply. I think that may be do a fork.

stavanger

stavanger OP

I found a solution, helped me this extantion GitHub - ecmel/vscode-html-css: Visual Studio Code Extension - CSS Intellisense for HTML · GitHub.
Thanks you so much Ecmel Ercan and @tme_317 for your thoughts!

But this extension not worked with HTML (EEx) files. I contributed to this. Until the author has merged pull-request, you can use my branch: https://github.com/reducio/vscode-html-css/tree/add-html-eex

git clone https://github.com/reducio/vscode-html-css/tree/add-html-eex
npm install
vsce package

# deps may be need, if you need hack this code
npm install -g typescript
npm install -g yo generator-code
npm install -g vsce
npm i -g @zeit/ncc

So, after run vsce package you get file vscode-html-css-0.2.3.vsix in root project folder.
Then you need install extension manually:

Don’t forget about settings of extension.
In settings.json add:

    "css.remoteStyleSheets": [
        "https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
    ],

Usage:
You can view a list of attributes via ctrl + space.

Enjoy auto completion Tailwind CSS in your HTML (EEx) files.

Upvote, please: https://stackoverflow.com/questions/58013281/how-to-force-the-tailwind-css-intellisense-extension-for-vscode-work-with-html/58017659#58017659

tme_317

tme_317

Wow, cool. No more manual file type switching!

Thank you so much!

stryrckt

stryrckt

Thanks for that! The next question is how to get it working with .leex LiveView templates.

stavanger

stavanger OP

This also works for .leex files. But I observe that on MacOS the extension works through time, I will look for a problem. I tested extension only on WSL (Windows Subsystem for Linux)

stavanger

stavanger OP

So, I found problem, Tailwind CSS loaded only through a class call at .html file, this must be do once, after that css classes will be available in all .html.eex and .html.leex files.

For example:

  1. Call any class in your assets/css/index.html (it’s kludge).
  2. You get all Tailwind CSS classes in your .html.eex and .html.leex files.

I read api docs for VSCode extension and think there is a solution, just need time.

The Language Server Protocol remote protocol is simply not called when opened .html.eex and .html.leex, only when opened .html (and other already a implemented files extensions).

stryrckt

stryrckt

Hmm, not sure if I am understanding the kludge correctly. I created an assets/css/index.html file with a div that references a class defined in app.css and some Tailwind classes, but still IntelliSense isn’t working in .leex files. It works in .eex files though.

dokuzbir

dokuzbir

I don’ use Tailwind css. But if vscode-elixir extension installed adding that code to setttings.json can solve problem.

    "files.associations": {
        "*.html.eex": "HTML (Eex)",
        "*.html.leex": "HTML (Eex)"
    }
stavanger

stavanger OP

Yes, you right. Tell me please, what is OS you use?

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews