There is a way to use again inline css for webpack?
I need it for inline in some blade mails
Thanks :)
Mix will create a dedicated output file for your CSS. You can inline it with PHP if you want.
you suggest to use something like ?
{{readfile(mix('/public/css/mail.css')}}
I think that still a feature request can be needed.
For googlers! Bonobomagno's method does not work. You should use this code:
<style>
{!! readfile(public_path('css/app.css')) !!}
</style>
For googlers - mezhevikin's answer doesn't work properly either. It will output the number of bytes read, which you don't want. Use this code:
{!! file_get_contents(public_path('css/app.css')) !!}
Hi @slavicd ! You are right. Now my old method does not work.
However, I would recommend using readfile instead of file_get_contents, because it does not read data into RAM.
Just use php directly in your blade template.
<style>
<?php readfile(public_path('css/app.css')) ?>
</style>
Most helpful comment
For googlers! Bonobomagno's method does not work. You should use this code:
<style> {!! readfile(public_path('css/app.css')) !!} </style>