How to add CSS and JavaScript file in shopware 5?

How to add CSS and JavaScript file in shopware 5

Please follow the below steps to add javascript and CSS file in the shopware 5 themes.

For CSS

File Structure

themes>Frontend>Custom>frontend>_public>src>css.

Step 1: Create a new file called style.css in css folder.

Step 2: Click on the style.css file and add some css.

Step 3: Now go to the Theme.php file .To add the file paths to the $css variable.

Step 4: After saving the file. Go to the Store-Front to make sure it changes the background color.

For JavaScript

File Structure

themes>Frontend>Custom>frontend>_public>src>style.js

Step 5: Create a new file called style.js in js folder.

Step 5: Click on the style.js file and add some js.

Step 6: Now go to the Theme.php file .To add the file paths to the $js variable.

Step 7: After saving the file. Go to the Store-Front to make sure it work.