Optimize
2K members online now
2K members online now
Everything you need to know about setting up Optimize including creating your account and container, linking to Google Analytics and how to tag your site.
Guide Me
star_border
Reply

100+ Changes Slow to Apply / Inefficient use of Style tags

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi, hoping to get some assistance on this issue. We're applying about 189 changes to a page using Optimize, by applying one block of global CSS changes to the entire page use the <> icon in the top right of the editor. Optimize seems to change this into 189 seperate style tags, as it seems to split shorthand CSS notation up into individual rules, which is really laggy when applied to the page on the Share Preview URL. Is there anyway to make it just add a single style tag with all the CSS at once?

In the end we're injecting the single style tag with a minified copy of the CSS using Javascript, but ideally we'd able to do it without this hack, any ideas?

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by Jason O (Community Manager)
April 2017

100+ Changes Slow to Apply / Inefficient use of Style tags

Google Employee
# 2
Google Employee

Another idea would be to use an "Insert HTML" change (perhaps using head as the css selector, so that it would be applied fast) and inside it add your CSS inside a

<style></style>

element.

This would be perhaps be a little better than using Javascript.

View solution in original post

Marked as Best Answer.
Solution
Accepted by Jason O (Community Manager)
April 2017

100+ Changes Slow to Apply / Inefficient use of Style tags

Google Employee
# 2
Google Employee

Another idea would be to use an "Insert HTML" change (perhaps using head as the css selector, so that it would be applied fast) and inside it add your CSS inside a

<style></style>

element.

This would be perhaps be a little better than using Javascript.