How can I add 'text/jsx' type to a script tag via libraries.yml?
I want to add some react js files to a theme's libraries.yml and I don't know how I can do this in drupal 8. <script type="text/babel" src="scripts/example.js"></script> or <script type="text/jsx" src="scripts/example.js"></script> I can't figure it out hot to make the type="text/jsx" appear when the file is added to the pag...
CSS order in Drupal 8 libraries.yml
From what I read about Drupal 8 themes there does not appear to be anything to order CSS file loading. As you know, CSS cascades down to a specific order when there is a conflict with an element. Since I have a class that is named the same as Twitter Bootstrap which is loaded from the CDN from the page.html.twig, I can usually modify a bootstrap cl...
Is there a way to override paths defined in *.libraries.yml
Guess I found a bug here and already filed it: libraries_get_path('mmenu') returns correct path (profiles/profile_name/libraries/mmenu). drupal_get_profile() returns correct profile. Drupal seems to only take the paths defined in mmenu.libraries.yml into account. Changing them makes everything work as desired. So, I'm asking myself now: Is there an...
How to add variables in *.libraries.yml in drupal 8
I need to convert the below code added in hook_page_attachments() and add the external js in *.libraries.yml but not sure how to add variables like $token and $user->mail in the *.libraries.yml so I can just attach library Add Your Script to a file In *.libraries.yml, I have added Added that file to the library under $attachments['#attached']['libr...