1

I'd like to change the primary font in Bulma as per https://stackoverflow.com/questions/64512940/setting-a-new-primary-font-family-with-bulma.

I've used composer to install libraries_provider

 composer require drupal/libraries_provider

Libraries provider is enabled

dr en -y libraries_provider

Looking at the libraries provider documentation and the drulma documentation I should add something to my theme libraries yml file.

At a rough guess as I can't find documentation on how to do this

bulma:
  libraries_provider:
  enabled: true
  source: https://asset-packagist.org
  npm_name: 'bulma'

Then I run

composer require npm-asset/bulma

Which does not work

Could not find a matching version of package npm-asset/bulma.

Then I set the variables in the sass file for the new font, which the stackoverflow question handles.

Finally, recompile the SASS file (what command is required?). Make sure the updated bulma CSS file is included in my theme and it is done.

3
  • 1
    Are you using the Bulma theme or the Drulma theme, or did you roll your own version of Bulma for Drupal? If you're using Drulma, I actually wrote out the exact steps for how to set up sass, minification, and so on: gist.github.com/ptmkenny/07f2a8b98b8dcffea0581c52343a62cf Commented Feb 7, 2021 at 1:06
  • Drulma. That documentation is great. Gets the loading of the bulma css done. The libraries-provider system for compiling the bulma css configuration is still confounding me. It looks like you bypassed that. I'm building the css from npm run build currently.
    – Interlated
    Commented Feb 7, 2021 at 1:34
  • 3
    I'm not familiar with Libraries Provider, but if you found it confusing, you can definitely use Drulma without it. Also, both of those modules have the same maintainer, who in my experience is very responsive to drupal.org issues, so if you do want to use Libraries Provider and are having trouble I would open an issue in the issue queue. Commented Feb 7, 2021 at 1:43

1 Answer 1

1

For

composer require npm-asset/bulma

to work https://asset-packagist.org/ is needed to be configured in your root composer.json Here is a more detailed guide on how to configure it for Drupal so the library end up in the web/libraries folder.

http://lightning.acquia.com/blog/round-your-front-end-javascript-libraries-composer

Once you succeed with that. Libraries provider will allow you to set the bulma library as "local" and given that you have the sassphp php extension installed then you can specify bulma variables on the libraries provider interface and that will recompile bulma to use them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.