Beercss

Add Beercss to your Rails app using Webpacker with this app template.
Icons/chart bar
Used 27 times
β€’ Created by
T Tadeu Granemann

Usage
"Build material design interfaces in record time... without stress for devs... πŸΊπŸ’› "

All credits to https://www.beercss.com/

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

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

Review the code before running this template on your machine.

run("yarn add beercss")
  
inject_into_file 'app/javascript/packs/application.js' do <<~EOF

// Import Beercss assets
import "beercss/dist/cdn/beer.min.js";
import "beercss/dist/cdn/beer.min.css";
// Init Beercss UI
if (typeof Turbolinks === "undefined") {
  document.addEventListener("DOMContentLoaded", function () {
    ui();
  });
} else {
  document.addEventListener("turbolinks:load", function () {
    ui();
  });
}
  EOF
end
Comments

Sign up or Login to leave a comment.