backdrop-contrib / font_awesome

Include Font Awesome Icons via CSS classes in your Backdrop CMS website
https://backdropcms.org/project/font_awesome
GNU General Public License v2.0
2 stars 4 forks source link

Use backdrop_add_html_head instead of backdrop_add_css #12

Closed herbdool closed 1 year ago

herbdool commented 3 years ago

~backdrop_add_library~ backdrop_add_html_head is more robust for adding third party libraries instead of backdrop_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 and crossorigin attributes. I wonder if the other libraries have similar options.

herbdool commented 3 years 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.

herbdool commented 3 years ago

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

herbdool commented 3 years ago

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

yorkshire-pudding commented 1 year ago

@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.