简体   繁体   English

如何在服务器上编译SASS / SCSS文件?

[英]How to compile SASS/SCSS files on the server?

I have an applications on AWS styled using SASS(SCSS). 我在AWS上使用SASS(SCSS)样式的应用程序。 The SCSS files are structured on a modular way and I have one file with all the variables making it very easy to rebrand. SCSS文件以模块化方式构建,我拥有一个包含所有变量的文件,因此很容易重命名。

I've built an CMS and I would like to let the user to pick his colors and fonts and once done, by clicking on a button I would like to do the following: 我建立了一个CMS,我想让用户选择他的颜色和字体,完成后,通过单击一个按钮,我要执行以下操作:

1) Write to the variables file the values entered on the CMS. 1)将在CMS上输入的值写入变量文件。 2) Compile the SCSS files, generate a new CSS file on the server and replace the current one if no errors. 2)编译SCSS文件,在服务器上生成一个新的CSS文件,如果没有错误,请替换当前文件。

Any ideas? 有任何想法吗?

I'd say that is a bad idea to begin with. 我会说这是一个坏主意。 You could just take the direct CSS input from the user instead of SASS. 您可以直接从用户那里获取CSS的直接输入,而不是SASS。 Why? 为什么? Because the job of pre-compiling the stylesheet is left to the user who is uploading it, not the person who is hosting it. 因为预编译样式表的工作留给了上载它的用户,而不是承载它的人。 You could give them a space to write the CSS, but if they want a pre-processor, then I guess you'd have to install / run RUBY. 您可以给他们一个编写CSS的空间,但是如果他们想要一个预处理器,那么我想您必须安装/运行RUBY。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM