improves styles for flash notices

This commit is contained in:
Alberto Garcia Cabeza
2016-10-19 10:54:48 +02:00
parent fb8669292e
commit c835d9b1d1
2 changed files with 55 additions and 3 deletions

View File

@@ -732,6 +732,56 @@ form {
// 07. Callout // 07. Callout
// ----------- // -----------
.callout-slide {
animation-duration: 1s;
-webkit-animation-duration: 1s;
animation-fill-mode: both;
-webkit-animation-fill-mode: both;
animation-name: slide;
-webkit-animation-name: slide;
}
@-webkit-keyframes slide {
from {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
visibility: visible;
}
to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
@keyframes slide {
from {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
visibility: visible;
}
to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
.notice-container {
min-width: $line-height*12;
position: absolute;
right: 24px;
top: 24px;
.notice {
height: $line-height*4;
.notice-text {
width: 95%;
}
}
}
.callout { .callout {
font-size: $small-font-size; font-size: $small-font-size;

View File

@@ -1,10 +1,12 @@
<% flash.each do |flash_key, flash_message| %> <% flash.each do |flash_key, flash_message| %>
<div id="<%= flash_key %>" data-alert class="row" data-closable> <div id="<%= flash_key %>" data-alert class="notice-container callout-slide" data-closable>
<div class="callout <%= flash_key %>"> <div class="callout notice <%= flash_key %>">
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close> <button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
<%= flash_message %> <div class="notice-text">
<%= flash_message %>
</div>
</div> </div>
</div> </div>
<% end %> <% end %>