Slds

Short description and motivation.

Installation

Add this line to your application's Gemfile:

gem 'slds'

And then execute:

$ bundle

Or install it yourself as:

$ gem install slds

Setup

  1. Add to your helper:
module ApplicationHelper
  include Slds::Helper
  slds_config version: '2.3.1', debug: false
end
  1. Add the link tag to your layout:
<%= slds_link_tag 'data-turbolinks-track': 'reload' %>
  1. Now you can also load images and any other asset from slds:
# uses relative path: `/slds/images/spinners/slds_spinner.gif`
<%= image_tag slds_assets_path('images/spinners/slds_spinner.gif') %>

# uses absolute url: `https://unpkg.com/@salesforce-ux/[email protected]/assets/images/spinners/slds_spinner.gif'
<%= image_tag slds_asset_url('images/spinners/slds_spinner.gif') %>

You can see all available assets on slds CDN at: https://unpkg.com/@salesforce-ux/[email protected]/assets/

Contributing

Contribution directions go here.

License

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