Blazer
UIKit wrapper for rails
Installation
First up add blazer-rails
to your Gemfile and ensure that the sass-rails
gem is present
gem 'blazer-rails'
gem 'sass-rails', '~> 5.0'
Then bundle install
Once installed you'll need to import blazer in your main application stylesheet (app/assets/stylesheets/application.scss
):
@import 'blazer';
Note that your main application stylesheet must be a sass (i.e. .scss
or .sass
) file - if it isn't then rename it:
$ cd my_app
$ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
Now ensure the javascript is included in your main application javascript (app/assets/javascripts/application.js
):
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require blazer
Now you should be all good to go!
Usage
To get UIKit, its components and fonts, simply import it in your sass:
@import 'uikit';
Alternatively if you need to get picky and choose the components of UI kit to load, then you may load them individually.
@import "uikit/scss/uikit-mixins.scss";
@import "uikit/scss/uikit.scss";
@import "uikit/scss/components/autocomplete.scss";
The paths above are relative to the UIKit Bower Repo, the same goes for the javascript, fonts, and compiled css files.
Development
JS, CSS and font dependencies are managed using bower, which is available on npm. See Installing Bower for more on how to get setup.
Once you've got bower, to get developing against this you'll need to:
- Download the repo
- Run
bundle install
- Go forth and do things!
If you need to update ou may do so with Bower:
If you need to update UIKit, y
bower update uikit
To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/andrewbigger/blazer-rails.
License
The gem is available as open source under the terms of the MIT License.