Bulma

Add bulma to rails
Icons/chart bar
Used 95 times
Created by
D Duarte M

Usage
Adds https://github.com/joshuajansen/bulma-rails, and optionally https://github.com/dhmgroup/bulma-extensions-rails. Choose the latter by answering Yes on prompt.

The script will also ask if you would like to delete the application.css file.

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/x7msBo"
Template Source

Review the code before running this template on your machine.

run "yarn add bulma"
run "touch app/assets/stylesheets/application.scss"

if yes?("Do you want bulma-extensions, too?")
  gem "bulma-rails"
  gem "bulma-extensions-rails"
  inject_into_file 'app/assets/stylesheets/application.scss' do <<~EOS
    @import "bulma";
    @import "bulma-extensions";
    EOS
  end
else
  gem "bulma-rails"
  inject_into_file 'app/assets/stylesheets/application.scss' do <<~EOS
    @import "bulma";
    EOS
  end
end

run "bundle install"
run "rm app/assets/stylesheets/application.css" if yes?("Delete CSS file?")
Comments

Sign up or Login to leave a comment.