Skip to content

Commit

Permalink
Extract pro icons CSS into separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Jul 10, 2024
1 parent ec28cea commit ecb52f8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
19 changes: 19 additions & 0 deletions app/assets/stylesheets/responsive/alaveteli_pro/_icons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.icon {
background-size: 13px 13px;
background-position: center;
background-repeat: no-repeat;
display: inline-block;
height: 13px;
width: 13px;
margin-right: 0.3em;
position: relative;
top: 1px;
@include image-replacement();

&.icon__download {
background-image: image-url("alaveteli-pro/download.png");
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
background-image: image-url("alaveteli-pro/[email protected]");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ $complete: rgb(112, 203, 99);
}
}

.download-icon {
background-image: image-url('alaveteli-pro/download.png');
background-size: 13px 13px;
background-position: center;
background-repeat: no-repeat;
display: inline-block;
height: 13px;
width: 13px;
margin-right: 0.3em;
position: relative;
top: 1px;
@include image-replacement();
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
background-image: image-url('alaveteli-pro/[email protected]');
}
}

/* Blank slate - when there are no requests to show */
.blank-slate {

Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/responsive/all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@

@import "responsive/alaveteli_pro/selectize";

@import "responsive/alaveteli_pro/_icons";

@import "responsive/alaveteli_pro/_dashboard_layout";
@import "responsive/alaveteli_pro/_dashboard_style";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
<%= link_to alaveteli_pro_info_request_batch_batch_download_path(
info_request_batch_id: info_request_batch,
format: :zip) do %>
<i class="download-icon"></i>
<i class="icon icon__download"></i>
<%= _('ZIP') %>
<% end %>
<%= link_to alaveteli_pro_info_request_batch_batch_download_path(
info_request_batch_id: info_request_batch,
format: :csv) do %>
<i class="download-icon"></i>
<i class="icon icon__download"></i>
<%= _('CSV') %>
<% end %>
</div> <!-- .request__download -->
Expand Down
4 changes: 2 additions & 2 deletions app/views/info_request_batch/_downloads.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<%= link_to alaveteli_pro_info_request_batch_batch_download_path(
info_request_batch_id: info_request_batch,
format: :zip) do %>
<i class="download-icon"></i>
<i class="icon icon__download"></i>
<%= _('ZIP') %>
<% end %>
<%= link_to alaveteli_pro_info_request_batch_batch_download_path(
info_request_batch_id: info_request_batch,
format: :csv) do %>
<i class="download-icon"></i>
<i class="icon icon__download"></i>
<%= _('CSV') %>
<% end %>
</div>

0 comments on commit ecb52f8

Please sign in to comment.