Skip to content

Commit

Permalink
Example of custom CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Dec 22, 2023
1 parent 17e2774 commit 200578c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions spec/example_app/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
//= link administrate/application.css
//= link administrate/application.js
//= link admin.css
1 change: 1 addition & 0 deletions spec/example_app/app/assets/stylesheets/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= require_tree ./admin
18 changes: 18 additions & 0 deletions spec/example_app/app/assets/stylesheets/admin/identity.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.identity__banner {
margin: 0;

&--admin {
background-image: repeating-linear-gradient(45deg, violet, indigo, blue, green, yellow, orange, red, violet);
text-align: center;
background-size: 800% 800%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: rainbow 1s ease;
}
}

@keyframes rainbow {
0%{background-position:0% 50%}
50%{background-position:100% 25%}
100%{background-position:0% 50%}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
<%= content_for(:title) %>
</h1>

<div>
You are logged in as <em><%= pundit_user.name %></em>.
<%= link_to("Become the Admin", become_admin_customer_path("admin")) unless pundit_user.admin? %>
</div>
<p class="identity__banner<%= " identity__banner--admin" if pundit_user.admin? %>">You are logged in as <em><%= pundit_user.name %></em>. <%= link_to("Become the Admin", become_admin_customer_path("admin")) unless pundit_user.admin? %></p>

<% if show_search_bar %>
<%= render(
Expand Down
1 change: 1 addition & 0 deletions spec/example_app/config/initializers/administrate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Administrate::Engine.add_stylesheet("admin")

0 comments on commit 200578c

Please sign in to comment.