Hooks for assets
Quick reference for where to hook in styles and scripts:
Where | Action |
Admin | admin_enqueue_scripts |
Frontend | wp_enqueue_scripts |
Block editor (admin) | enqueue_block_editor_assets |
Blocks (front and admin) | enqueue_block_assets |
Don't register or enqueue scripts and styles in init, this will break WordPress updates and unexpected things might happen.