I am new to Bootstrap and CSS/SCSS. I have a button group which I am using at many different locations in my rails application.
<div class="btn-group" role="group">
<%= link_to lesson, class: 'btn btn-sm btn-outline-primary' do %>
<i class="fa fa-eye" aria-hidden="true"></i>
<% end %>
<%= link_to edit_lesson_path(lesson), class: 'btn btn-sm btn-outline-primary' do %>
<i class="fa fa-pencil" aria-hidden="true"></i>
<% end %>
<%= link_to lesson, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-outline-primary' do %>
<i class="fa fa-trash" aria-hidden="true"></i>
<% end %>
<%= link_to vocabs_by_lesson_path(lesson), class: 'btn btn-sm btn-outline-primary' do %>
<i class="fa fa-arrow-down" aria-hidden="true"></i>
<% end %>
</div>
Like you can see I am using 'btn btn-small btn-outline-primary' very often. I want to define a css helper (or something like this), so that I can just write:
class: 'action-button'
instead of
class: 'btn btn-sm btn-outline-primary'
This would make it easier to change the layout of the buttons just at one place.
I have already read something about subclasses in css, but don't understand how I can create one class (action_button) which just extends all the bootstrap classes/helpers 'btn', 'btn-sm', and 'btn-outline-primary.'
Thanks in advance.