Include an existing CSS file in custom extjs theme

前端 未结 2 915
傲寒
傲寒 2021-01-06 18:22

I have an existing CSS file that I would like to include in my ExtJS production build.

I am using a custom theme. I know I can go to MyApp/packages/myCustomTheme/sa

相关标签:
2条回答
  • 2021-01-06 18:29

    To include your custom css file in your production build, you can include the stylesheet above the <!-- <x-compile> --> comment in your index.html. So your index.html should look like this:

    <!DOCTYPE HTML>
        <html>
        <head>
        <meta charset="UTF-8">
        <title>YourAppName</title>
        <link rel="stylesheet" href="link-to-custom.css">
        <link rel="stylesheet" href="link-to-another-custom.css">
            <!-- <x-compile> -->
                <!-- <x-bootstrap> -->
                    <link rel="stylesheet" href="bootstrap.css">
                    <script src="ext/ext-dev.js"></script>
                    <script src="bootstrap.js"></script>
                <!-- </x-bootstrap> -->
                <script src="app/app.js"></script>
            <!-- </x-compile> -->
    </head>
    <body></body>
    

    I don't know if there is better way of doing this. So far this has worked for me. Hope this helps.

    0 讨论(0)
  • 2021-01-06 18:36

    According to the guide, we should be placing @import statements in etc/all.scss.

    I found that in doing this, any imported files were in fact compiled in our theme's css file. Imports were not used in the production build.

    http://docs.sencha.com/extjs/4.2.1/#!/guide/theming - see the section on "Adding Custom Utility SASS"

    0 讨论(0)
提交回复
热议问题