Custom CSS and Javascript
Custom CSS and Javascript
Description
CSS and JavaScript customization in the KU CMS - Sunflower is made possible with the Asset Injector Module. It provides advanced users the ability to quickly apply CSS and JavaScript.
Both CSS and JavaScript customization are advanced topics that require sufficient knowledge to use. If you need help please contact KU Web Services at webservices@ku.edu.
How to Add CSS
- Go to: Configuration > Development > Asset Injector
- Select Add CSS Injector
- Enter a Label*
- In the Code field, enter your custom CSS
- Leave the Media field set to "All" - except in special cases
- If you want to limit the CSS to specific content types, select the desired content types in the Content type area.
- Leave the Current Theme "Not restricted" or select "KU CMS - Sunflower"
- In the Pages field, provide specific paths to show/hide from the CSS override
- Leave User Role set to "Not restricted" - except in special cases
- Leave Condition Requirements set to "Require ALL Conditions" - except in special cases
*NOTE: A site may have multiple CSS Injectors
How to Add Javascript
- Go to: Configuration > Development > Asset Injector
- Select Add JS Injector
- Enter a Label*
- Enter the JavaScript Code
- Select the Advanced Options you wish to use
- Optionally select the Content type(s) you wish to use the override on
- Select KU CMS - Sunflower from the Theme tab
- Optionally select any pages you wish to apply or exclude from the override
- Optionally select any user roles you wish to apply or exclude from the override
- Optionally deselect the Require all conditions checkbox
*NOTE: A site may have multiple JS Injectors
Accessibility
All content on KU CMS sites must meet accessibility standards. See Accessibility for information, including guidelines and best practices.