blocknotes / administrate-materialize-theme

A Material Design theme for Administrate based on Materialize framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Administrate Materialize Theme

gem version gem downloads linters specs

A Material theme for Administrate, based on Materialize framework.

Features:

  • easy to install, just include CSS/JS to apply the theme to a default Administrate structure;
  • Material Design responsive theme;
  • customizable via SASS variables;
  • allow to use Materialize components in the admin.

screenshot

Please ⭐ if you like it.

Installation

  • Add a SASS/SCSS gem to your Gemfile (ex. gem 'sassc')
  • After installing Administrate, add to Gemfile: gem 'administrate-materialize-theme' (and execute bundle)
  • Edit app/assets/config/manifest.js, adding at the end:
//= link administrate-materialize-theme/theme.css
//= link administrate-materialize-theme/theme.js
  • Edit app/views/layouts/admin/application.html.erb (you can generate it using rails generate administrate:views:layout), adding before head closing tag:
<%= stylesheet_link_tag 'administrate-materialize-theme/theme', media: 'all' %>
<%= javascript_include_tag 'administrate-materialize-theme/theme' %>

Customizations

To change Materialize variables it's necessary to create a new .scss (or .sass) file like this one (ex. admin.scss):

// app/assets/stylesheets/admin.scss
$primary-color: #FB1;
@import 'administrate-materialize-theme/theme';

And replace the link tag in the application.html.erb with: <%= stylesheet_link_tag 'admin', media: 'all' %>

For the complete list of options take a look here.

Extra features

  • Sidebar example:
<div class="row">
  <div class="col s3">
    <section class="mt-sidebar z-depth-1">
      <h3>Sidebar</h3>
      <p>Some content</p>
    </section>
  </div>
  <div class="col s9">
    <section class="main-content__body main-content__body--flush">
      <!-- ... -->
    </section>
  </div>
</div>

Do you like it? Star it!

If you use this component just star it. A developer is more motivated to improve a project when there is some interest.

Or consider offering me a coffee, it's a small thing but it is greatly appreciated: about me.

Contributors

License

The gem is available as open source under the terms of the MIT License.

About

A Material Design theme for Administrate based on Materialize framework

License:MIT License


Languages

Language:JavaScript 62.4%Language:SCSS 25.4%Language:Ruby 10.8%Language:HTML 1.3%Language:CSS 0.1%