imherer

WebStorm 究竟如何设置 tailwindcss 才能有语法提示和鼠标悬停显示 css 呢

  •  
  •   imherer · Dec 20, 2024 · 2643 views
    This topic created in 696 days ago, the information mentioned may be changed or developed.

    https://www.jetbrains.com/help/webstorm/tailwind-css.html

    按照官方这一套配置下来还是不行

    它没提示我都不知道我写没写对,反观 unocss 支持的却很好

    vscode 也没提示,但是鼠标悬停后能显示对应的 css 代码,我怎么确定我没写错了,总不能每次写完了鼠标悬停上去看一下吧?

    各位前端大佬咋解决这个问题的呢?

    8 replies  •  2024-12-20 16:39:54 +08:00
    llcczz
    llcczz
    Dec 20, 2024
    1
    装插件 unocss

    10bkill1p
    10bkill1p
    Dec 20, 2024
    2
    VSCode 安装 [Tailwind CSS IntelliSense - Visual Studio Marketplace]( https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)
    TimG
    TimG
    Dec 20, 2024 via Android
    3
    看看下面状态栏的 language server 服务启动没有,里面有没有 tailwindcss ,没启动的话看日志报错,一般 jb 系的 IDE 没有代码提示都是这里出问题了
    imherer
    imherer
    OP
    Dec 20, 2024
    4
    @10bkill1p 装了这插件的,但是写的时候还是没语法提示,写完了鼠标放上去会提示它对应的 css 代码。其实我想要的是写的时候就给语法提示,这样能确定我是写对了的
    imherer
    imherer
    OP
    Dec 20, 2024
    5
    @TimG 看了下 tailwindcss 的是正常,vue 的反而有个红色感叹号,但是 vue 写起来却有语法提示
    10bkill1p
    10bkill1p
    Dec 20, 2024
    6
    @imherer #4 你看它的 Homepage 是有 autocomplete 和 lint 截图的呀,我实际使用上没有发现 lint 功能生效,但是你说的这个语法提示是有的,除非是使用了自定义的 className
    10bkill1p
    10bkill1p
    Dec 20, 2024
    7
    @10bkill1p #6 By default VS Code will not trigger completions when editing "string" content, for example within JSX attribute values. Updating the editor.quickSuggestions setting may improve your experience 。也许可以试试这个推荐设置
    imherer
    imherer
    OP
    Dec 20, 2024
    8
    @10bkill1p #7 感谢,生效了,有提示了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4487 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 07:46 · PVG 15:46 · LAX 23:46 · JFK 02:46
    ♥ Do have faith in what you're doing.