Common assets for Aptible's web clients.
Requires:
- SASS
- Bootstrap 3
- CoffeeScript
- jQuery
Underscore.js(vendored in as of 0.3.0)
The layouts require:
- HAML
- Our aptible-rails route helpers
- Add a
.bowerrc
file to your project. Specify where Bower should install the files with{ "directory": "your/path" }
bower install aptible-sass
.gitignore
the Bower install directory.- Add the aptible-sass resources to your asset manifests. If you use Sprockets, add the aptible-sass images and scripts directories to
config.asset.paths
inapplication.rb
. In addition, add the Javascripts to your Sprockets manifest. For SASS,@import
the mixins and a layout file before Bootstrap. Include the main aptible-sass manifest after Bootstrap.
Example project application.scss
:
@import "../../../vendor/assets/aptible-sass/dist/styles/aptible_fixed";
@import "font-awesome";
@import "policy_manuals";
Example project application.rb
:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module Policy
class Application < Rails::Application
# Sprockets needs this, in addition to the manifest
config.assets.paths << Rails.root.join(
'vendor',
'aptible-sass',
'dist',
'scripts'
)
config.assets.paths << Rails.root.join(
'vendor',
'assets',
'aptible-sass',
'dist',
'images'
)
end
end
Example project application.js
:
//= require jquery
//= require jquery_ujs
//= require jquery.turbolinks
//= require turbolinks
//= require bootstrap
//= require policy
//= require_directory ../../../vendor/assets/aptible-sass/dist/scripts
//= require_tree .
- For local development of both aptible-sass and a project that depends on it,
bower link
in this directory, thenbower link aptible-sass
in your project. - Render partials with references to the full path.
Copyright (c) 2019 Aptible