我正在从Extjs 4.2迁移到Extjs 6.2。 我曾经在头部包含一个自定义的css文件,在包含Extjs之后放置了一个简单的链接。
<link rel="stylesheet" href="/custom.css" type="text/css" charset="utf-8" />
由于Extjs 6加载其css文件的方式,这不再起作用了。它们是在头部注射的。
那么如何在ExtJs 6中包含自定义css文件以覆盖内置规则?
编辑:对,这个问题已经有了一些答案,但是
https://stackoverflow.com/a/25176803/1951708提供了一些链接,可以归结为:
将custom.css文件复制到/packages/local/custom-theme/sass/etc
@import 'custom.scss'
添加到all.scss
到目前为止一切顺利,但是:
sass/etc
文件夹在 所有其他样式之前加载 答案 0 :(得分:4)
在app.json
文件中是外部css文件的一部分。
如果该部分不存在,您可以创建它。
在sencha构建之后,加载了css文件。
/**
* List of all CSS assets in the right inclusion order.
*
* Each item is an object with the following format:
*
* {
* // Path to file. If the file is local this must be a relative path from
* // this app.json file.
* //
* "path": "path/to/stylesheet.css", // REQUIRED
*
* // Specify as true if this file is remote and should not be copied into the
* // build folder. Defaults to false for a local file which will be copied.
* //
* "remote": false, // OPTIONAL
*
* // If not specified, this file will only be loaded once, and cached inside
* // localStorage until this value is changed. You can specify:
* //
* // - "delta" to enable over-the-air delta update for this file
* // - "full" means full update will be made when this file changes
* //
* "update": "" // OPTIONAL
* }
*/
"css": [
{
"path": "bootstrap.css",
"bootstrap": true
},
{
"path": "custom.css"
}
],
"output": {
"page": {
"path": "index.html"
},
"manifest": {
"embed": true
}
},