From 06d1b19ca2d8994d444ebfa3bb17634a4ae5ea7b Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Thu, 6 Dec 2018 15:32:26 -0500 Subject: [PATCH] FIX: Refactor lightbox mobile icon - Fixes a performance issue on a site with lots of images in posts - turns out that "filter: invert(100%)" performs very poorly on Safari/iPhone - also disables transition on the element on mobile --- app/assets/stylesheets/mobile/lightbox.scss | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/mobile/lightbox.scss b/app/assets/stylesheets/mobile/lightbox.scss index d1ca00bb4e1..5f3d98bfc7b 100644 --- a/app/assets/stylesheets/mobile/lightbox.scss +++ b/app/assets/stylesheets/mobile/lightbox.scss @@ -1,6 +1,7 @@ .lightbox .meta, .lightbox:hover .meta { opacity: 0.7; + transition: none; } .meta { @@ -21,8 +22,15 @@ .expand { position: initial; - filter: invert(100%); float: none; height: 16px; + &:before { + // ideally, the SVG used here should be in HTML and reference the SVG sprite + // the SVG used here is the "expand" icon from FontAwesome 4.7.0 + content: svg-uri( + '' + ); + opacity: inherit; + } } }