assets/ directory contains all static resources required by the theme, including images, JavaScript functionality, and SCSS stylesheets. These assets are processed during build time and optimized for production.
Directory structure
Images
Theimages/ directory contains essential theme graphics:
Placeholder images are used during lazy loading and for empty states throughout the theme. Multiple aspect ratios are provided to maintain proper layout during loading.
JavaScript
Theme Raed uses vanilla JavaScript with ES6 modules for all interactive functionality.Core JavaScript files
app.js - Main application controller
app.js - Main application controller
The central application class that initializes all theme functionality.Location: Initialization:
src/assets/js/app.jsKey responsibilities:- Mobile menu initialization using mmenu-light
- Sticky header behavior
- Add to cart functionality
- Dropdown and modal management
- Collapse component handling
- Wishlist event listeners
- Notification system
app-helpers.js - Utility functions
app-helpers.js - Utility functions
Helper methods used throughout the application.Location:
src/assets/js/app-helpers.jsProvides common utility functions for:- DOM manipulation
- Event handling
- API requests
- Data formatting
- Common UI interactions
base-page.js - Base page class
base-page.js - Base page class
Base class for page-specific JavaScript functionality.Location:
src/assets/js/base-page.jsProvides a foundation for page controllers to extend from.Page-specific JavaScript
Each major page type has its own JavaScript controller:| File | Purpose | Location |
|---|---|---|
home.js | Homepage interactive blocks | src/assets/js/home.js |
cart.js | Shopping cart functionality | src/assets/js/cart.js |
product.js | Single product page features | src/assets/js/product.js |
products.js | Product listing and filters | src/assets/js/products.js |
blog.js | Blog functionality | src/assets/js/blog.js |
brands.js | Brand listing page | src/assets/js/brands.js |
order.js | Order details and tracking | src/assets/js/order.js |
wishlist.js | Wishlist management | src/assets/js/wishlist.js |
loyalty.js | Loyalty program features | src/assets/js/loyalty.js |
testimonials.js | Testimonials display | src/assets/js/testimonials.js |
thankyou.js | Order confirmation page | src/assets/js/thankyou.js |
twilight.js | Twilight mode integration | src/assets/js/twilight.js |
JavaScript partials
Reusable modules injs/partials/:
Styles
Theme Raed uses SCSS with Tailwind CSS, following the ITCSS architecture for scalable and maintainable styles.Main stylesheet
Location:src/assets/styles/app.scss
The main SCSS file imports all style modules in order:
The theme uses Tailwind’s
@apply directive to keep HTML templates clean while maintaining the utility-first approach in SCSS files.01-settings: Configuration
Global configuration and variables:tailwind.scss
tailwind.scss
Imports Tailwind CSS base, components, and utilities.
fonts.scss
fonts.scss
Font family definitions and custom font imports.Defines typography used throughout the theme.
global.scss
global.scss
Global variables for colors, spacing, and theme configuration.Contains SCSS variables that control the theme’s appearance.
breakpoints.scss
breakpoints.scss
Responsive breakpoint mixins for mobile-first design.Provides mixins like
@include mobile, @include tablet, etc.02-generic: Base styles
Foundation styles that apply globally:| File | Purpose |
|---|---|
reset.scss | CSS reset for consistent cross-browser styling |
common.scss | Common styles and helper classes |
animations.scss | Animation keyframes from anime.css library |
lazyload.scss | Placeholder styles for lazy-loaded images |
rtl.scss | Right-to-left language adjustments |
ltr.scss | Left-to-right language adjustments |
tooltip.scss | Base tooltip component styles |
_mixins.scss | Reusable SCSS mixins |
03-elements: HTML elements
Styling for bare HTML elements:| File | Elements Styled |
|---|---|
buttons.scss | Button elements and variants |
form.scss | Input, textarea, select, label |
radio.scss | Custom radio button styling |
radio-images.scss | Image-based radio options |
04-components: UI components
Component-specific styles organized by feature:Layout components
Layout components
header.scss- Header, logo, search bar, cart iconfooter.scss- Footer links, newsletter, social mediamenus.scss- Main navigation and mobile menuuser-menu.scss- User account dropdown
Homepage components
Homepage components
home-blocks.scss- All homepage block variationsslider.scss- Image and product sliders
Product components
Product components
product.scss- Single product page layout and featuresfilters.scss- Product filtering sidebar and controlsadd-product-toast.scss- Add to cart notification
User area components
User area components
user-pages.scss- Profile, orders, notifications stylingloyalty.scss- Loyalty program UIgifting.scss- Gift wrapping and messaging
Other components
Other components
brands.scss- Brand listing gridlanding-page.scss- Custom landing page builderno-content-placeholder.scss- Empty state displaysvirtooal.scss- Virtual try-on integration
05-utilities: Helpers
Utility styles and third-party integrations:| File | Purpose |
|---|---|
swal.scss | Sweet Alert modal customization |
chat-bots.scss | Chat widget positioning and styling |
safari-fixes.scss | Safari-specific CSS bug fixes |
font-customization.scss | Custom font utilities |
Asset optimization
During the build process:- JavaScript: Bundled, minified, and tree-shaken
- SCSS: Compiled to CSS, autoprefixed, minified
- Images: Optimized and compressed
- Fonts: Subset and optimized for web delivery
Using assets in templates
Assets are referenced in Twig templates using theasset() function:
Next steps
Views folder
Learn about Twig templates and components
Customization
Customize styles and add functionality