SASS with Codeigniter

让人想犯罪 __ 提交于 2020-06-25 09:43:11

问题


I have a big codeigniter project that has been going on / selling for a while. I want to integrate SASS into it however SASS seems mainly - not strictly - for rails. I have been reading up on it and even though there are sparks for codeigniter that will allow SASS, it does not support recent versions of it very well.

I have yet to see instructions on how to implement SASS on codeigniter. Anyone can provide some clean instructions please?

Thank you !


回答1:


Sass and CodeIgniter does not need to be integrated in that sense. They are separate parts of your application.

Sass is a CSS pre-processor built in Ruby, but it's output is just normal CSS. It's these CSS files that you will reference is your HTML (CodeIgniter views) and that you will deploy to your server. On your development machine you need to have Ruby installed to run the Sass compiler, but that's it.




回答2:


We can compile SCSS file in any Project / Framework with desire folder structure with the help of node-sass have a look this answer

For Codeigniter, I create assets folder (assets/scss/style.scss) in the root of the application and compile my CSS in assets/css/style.css and then call my CSS like this.

<link rel="stylesheet" href="<?php echo base_url() . 'assets/css/style.css' ?>">


来源:https://stackoverflow.com/questions/17415738/sass-with-codeigniter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!