Problems Getting External CSS files to work with ExtJS 6

时间:2016-04-04 16:36:08

标签: extjs extjs6

I've created my app the normal way with cmd in ext 5 and what I had done was simply put my css files (in the index.html file) and when I would run sencha app build my styles word override the ones in ext (that is things like the body tag).

Now, I've recreated my ext project with cmd again from scratch, copied in my app.js and app folder and it works but it seems that my app flashes my body tag but then it goes away and the standard css takes over.

That is, in my in my index.html I have the lines:

<link href="/Content/Styles/scrum-style.css" rel="stylesheet" type="text/css"/>
<link href="/Content/Styles/SessionSchedule.css" rel="stylesheet" type="text/css"/>

***Added Note: After reading, I've copied the css from the two files into /sass/etc/all.scss and that pushed the css into the top of the generated file but it still seems to be overridden.

(also posted to sencha forums yesterday but got no response so trying here)

1 个答案:

答案 0 :(得分:1)

有两种方法可以在您的应用程序中包含外部CSS文件。

  1. 您可以在index.html文件中添加引用。在这种情况下,您需要在构建应用程序资源文件夹中手动复制CSS文件。
  2. 您可以在css数组和构建应用中的app.json文件中添加引用。在这种情况下,如果您更改了css文件,则需要构建app。