PhpStorm SCSS

编程入门 行业动态 更新时间:2024-10-26 14:33:49
PhpStorm SCSS - 文件监视器设置(PhpStorm SCSS - File Watcher Setting)

我有这样的结构:

我在哪里尝试设置SCSS文件观察器。

以下是我目前的选择:

我的目标是编译

../scss/style.scss到../css/style.css

../scss/user/profile.scss到../css/user/profile.css

如何在文件观察器中设置我的设置以实现此模式?

I have structure like this:

Where I am trying to setup SCSS file watcher.

Here are my current options:

My goal is to compile

../scss/style.scss to ../css/style.css

../scss/user/profile.scss to ../css/user/profile.css

How to setup my setting in file watcher to achieve this pattern?

最满意答案

如果您的项目可能,请考虑使用指南针编译您的scss 。 通过这种方式,无论scss目录中的文件结构如何,编译后都会将此结构镜像到css目录中。 设置非常简单,还有一个很好的阅读指南: PhpStorm /在Compass项目中使用SASS和SCSS

基本上你需要:

安装指南针: gem install compass cd到public\themes\701目录并运行compass init ,配置文件config.rb将在这里创建,编辑此配置以反映您的目录结构

在设置中启用Compass支持:

文件>设置>语言和框架>指南针

现在设置File Watcher,如图:

在此处输入图像描述

$ProjectFileDir$\public\themes\701是config.rb文件目录的完整路径。

这将按要求将scss文件编译到css目录。

If it's possible for your project, consider using compass to compile your scss. By doing it this way, regardless of file structure in scss directory, after compilation will be this structure mirrored in css directory. It is quite easy to setup, there is also a good guide to read: PhpStorm / Working with SASS and SCSS in Compass Projects

Basically you need to:

Install compass: gem install compass cd to public\themes\701 directory and run compass init, configuration file config.rb will be created here, edit this configuration to reflect your directory structure

Enable Compass support in settings:

File > Setting > Languages & Frameworks > Compass

Now setup File Watcher like in picture:

enter image description here

$ProjectFileDir$\public\themes\701 is full path to directory with config.rb file.

This will compile scss files to css directory as requested.

更多推荐

本文发布于:2023-08-07 20:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465636.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PhpStorm   SCSS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!