Instantly share code, notes, and snippets.

What would you like to do?
Disable animations
<!-- app/views/layouts/application.html.erb -->
<!DOCTYPE html>
<html lang="en">
<!-- ... -->
<% if Rails.application.config.disable_animations %>
<%= stylesheet_link_tag('disable_animations') %>
<!-- Turn off animations in jQuery -->
<script>$ = true;</script>
<% end %>
<!-- ... -->
# config/application.rb
module Urbanbound
class Application < Rails::Application
# ...
config.disable_animations = false
/* Disable animations, only for test environments.*/
* {
-webkit-transition: none !important;
-moz-transition: none !important;
-ms-transition: none !important;
-o-transition: none !important;
transition: none !important;
# config/environments/test.rb
Rails.application.configure do
# ...
config.disable_animations = true

This comment has been minimized.

Copy link

jersingh commented Jul 27, 2016

Had to add these extra transitions to get everything (bootstrap animations included) to disable:

transition-property: none !important;
 -o-transition-property: none !important;
 -moz-transition-property: none !important;
 -ms-transition-property: none !important;
 -webkit-transition-property: none !important;

 transform: none !important;
 -o-transform: none !important;
 -moz-transform: none !important;
 -ms-transform: none !important;
 -webkit-transform: none !important;

 animation: none !important;
 -o-animation: none !important;
 -moz-animation: none !important;
 -ms-animation: none !important;
 -webkit-animation: none !important;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment