Closed herbdool closed 1 year ago
Now I'm not so sure. I thought I could add external libraries with hook_library_info() but now I can't get it working.
Looks like I should close this issue. D7 (and I think Backdrop) doesn't allow passing of attributes to backdrop_add_css/js (https://www.drupal.org/project/drupal/issues/1664602). And can't add external libraries with backdrop_add_library
Here's a better approach for now, until core supports this. Use backdrop_add_html_head
. Got the idea from https://git.drupalcode.org/project/recaptcha/blob/7.x-2.x/recaptcha.module#n106
@herbdool - it looks like you got the ability to add attributes through backdrop_add_css
into core in 1.19.0 with https://github.com/backdrop/backdrop-issues/issues/4981
Therefore, I will close this as it is not needed. In addition, I think if we add the option for locally hosted files, using backdrop_add_css
will allow them to be aggregated.
~
backdrop_add_library
~backdrop_add_html_head
is more robust for adding third party libraries instead ofbackdrop_add_css
.It might not be an issue currently but I was playing around with adding Fork Awesome as an option and realized I couldn't create the link with the
integrity
andcrossorigin
attributes. I wonder if the other libraries have similar options.