2

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.

Dhananjaya
  • 1,510
  • 2
  • 14
  • 19

1 Answers1

1

There are several ways to import style-sheets.

  1. Directly in the index file. (Best suited for style-sheets of libraries such as jQueryUI and Wijmo in your case)
  2. As a theme, in themes module
  3. 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);

or by CSS text itself:

Boiler.ViewTemplate.setStyleText(cssText);
janith
  • 1,025
  • 5
  • 21
  • 2
    out of the last 2 options, the difference is that if you add CSS as a text, it get added to the HTML body directly. So if you are referring to an image from that CSS, those need to have relative paths from index.html itself. If you add as a css path, then a separate tag added to the header, so you may relatively refer and image from the css file location itself. – Hasith Sep 17 '12 at 09:28
  • But for your requirement, I would agree with the first suggestion from Janith. Add it statically on the index.html since you are probably using this across different modules. – Hasith Sep 17 '12 at 09:30