本文介绍了将外部CSS文件添加到BoilerplateJS项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将一些UI组件合并到当前正在处理的BoilerplateJS项目中,具体来说,我想实现此[http://wijmo.com/wiki/index.php/Getting_Started_with_Wijmo]示例在BoilerplateJs组件中.如何将外部CSS文件添加到我的BoilerplateJs项目中.
I'm trying to incorporate some UI components to a BoilerplateJS project that I'm currently working on, to be specific I want to implement this [http://wijmo.com/wiki/index.php/Getting_Started_with_Wijmo] sample inside a BoilerplateJs component.How can I add the external css files to my BoilerplateJs project.
推荐答案
有几种方法可以导入样式表.
There are several ways to import style-sheets.
- 直接在索引文件中. (最适合您的情况下的jQueryUI和Wijmo之类的库样式表)
- 作为主题,在主题模块中
- 作为模块的一部分,在 modules文件夹中(最适合特定于模块的样式,例如模块内的位置和模块图像).
- Directly in the index file. (Best suited for style-sheets of libraries such as jQueryUI and Wijmo in your case)
- As a theme, in themes module
- As a part of the module, in modules folder (Best suited for module specific styles such as position within the module, and module images).
对于特定于模块的样式,您可以通过文件路径(示例):
For module specific styling, you can include files by file path (example):
Boiler.ViewTemplate.setStyleLink(cssPath);
或CSS文本本身:
Boiler.ViewTemplate.setStyleText(cssText);
这篇关于将外部CSS文件添加到BoilerplateJS项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!