Static content bundles for Theme Cosmos
By default, Theme Cosmos applications include script and style static content bundles that you can use to introduce global customizations to your application. Depending on the scope of changes and your preferences, you can either add your own JS and CSS files to the bundle, or expand the existing bundle files.
Static resources
Theme Cosmos applications include the following static content bundles and resources out-of-the-box:
- py-cosmos-custom-script
- Static content bundle holding JavaScript files that apply globally to the application. The bundle includes the py-cosmos-custom-js file by default.
- py-cosmos-custom-js
- Text file rule holding custom JavaScript code that applies globally to the application.
- py-cosmos-custom-styles
- Static content bundle holding CSS files that apply globally to the application. The bundle includes the py-cosmos-custom-css file by default.
- py-cosmos-custom-css
- Text file rule holding custom CSS markup that applies globally to the application.
Best practices
When using static content bundles, consider the following best practices:
- For minor adjustments, add the changes directly to the py-cosmos-custom-js or py-cosmos-custom-css files. The files are already included in their respective bundles, so no other action is required.
- For large changes, create a text file rule to hold the custom markup, and then add that file to the script or style bundle, as required. This approach keeps text file rules that are bundled distinct and shorter, which simplifies maintenance.
Previous topic Custom JavaScript in application design Next topic Customizing sections and controls with JavaScript