Closed tabacitu closed 10 months ago
Maybe not as helpful to load images from CDNs. But you might want to load an img
from a non-public directory, if you're a package, right? And not ask devs to publish their assets in order to get them.
@promatik mentioned this might open Pandora's box. If we start supporting image filetypes... what's next? And where do we stop? And he might be right.
After all, if we do https://github.com/Laravel-Backpack/basset/issues/83 there will be a way for ALL filetypes to use Basset... by defining the HTML element themselves and using the basset()
helper alone. So that would be a solution too, I guess. And it's such an elegant solution that I'm pissed we hadn't thought of it ourselves, to be honest 😅
But let's entertain the idea a little bit longer. Let's crunch the numbers, see what's actually inside Pandora's box 😅
Here's a list of HTML elements that are commonly used to load external files, along with the attributes they use:
HTML Element | Purpose | Attribute | Basset support |
---|---|---|---|
\ | Include external JavaScript files | src | ✅ |
\ | Include external stylesheets (CSS) | href | ✅ |
\ |
Display images | src | - |
\ | Embed another HTML document | src | - |
\ | Embed audio content | src | - |
\ | Embed video content | src | - |
\ |
Specify media sources | src | - |
\ | Embed external resources | data | - |
\ | Embed external content | src | - |
\ | Provide text tracks for media | src | - |
\ | Define frames within a frameset | src | - |
\ (type="image") | Image-based submit button for forms | src | - |
\ Githubissues.
|
What if you want to internalize an image or SVG from a third-party website? Wouldn't it be cool if we could do:
and it would output
Of course... we'd have to do that for all image types... right? 👀 What do you think @promatik ? Worth doing or not?