amoschou / hyle
Material Components for the web as a Laravel package.
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/amoschou/hyle
Requires
- php: ^8.0
This package is auto-updated.
Last update: 2025-09-29 02:58:07 UTC
README
Material Components for the web as a Laravel package.
© Andrew Gilbert Moschou 2021
This package has two purposes:
- Exposes Material Design UI components to the Laravel developer as view components.
- Implements a theming system
Installation
-
composer require amoschou/hyle -
php artisan vendor:publishand selectAMoschou\Hyle\HyleServiceProvider. This publishesconfig/hyle.json, which can be configured before installation. -
php artisan hyle:installThis command installs Hyle and configures the themes. This must be done after step 2, it assumesconfig/hyle.jsonis present. -
npm install && npm run devInstall dependencies and runmixto compile assets according towebpack.mix.js.
Usage
Themes
This package helps the user to define multiple themes, and generates the Sass and CSS files to manage them. One aspect of Material themes is colour, and the primary and secondary colours are principal to this. config/hyle.json defines a list of primary colours and a list of secondary colours. When Hyle is installed into a Laravel application, all combinations of primary and secondary colours are managed. For example, if there are four primary colours and two secondary colours defined, then eight combinations of primary and secondary colours will be generated. Furthermore, a light theme and a dark theme is generated for each combination, reaching a total of sixteen CSS themes.
Each element of the array primaryColours and secondaryColours has a name, a value and a desaturated property. name is a string to label the colour, value is the colour as used in light themes and desaturated is the colour as used in dark themes. These can be a string that matches one of the colours of Material colour pallette from 2014 (e.g. deep-purple-500), or a hexadecimal string of the form #123456 representing the literal RGB colour. In the future, this may be expanded to include other colour pallettes in an easy way. If one of value and desaturated are omitted, then values will be generated automatically, which may be suitable.