3

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/sass/etc/ and use an @import in the all.scss file. But that uses the @import in the production file.

I'm hoping there is a way that I can get my existing CSS file compressed with the rest of my app's CSS.

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @cclerville. This will be a good fallback, I'm still hoping there will be a solution that will work at the custom theme level, so that my files get wrapped up in my theme.
1

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"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.