Back to Shopify Liquid
Infinite info bar v2
Shopify Liquid

Infinite info bar v2

A high-performance announcement bar that uses CSS keyframe animations to create a seamless, infinitely looping text marquee. It is designed to highlight brand value propositions or features with a smooth horizontal scroll that requires zero JavaScript.

EasyAnnouncement BarTickerMarqueeCRO Racing BarHeader
95 lines · 4.1 KB
Setup 5–10 minutes 4 min read 95 lines
Key features
  • Infinite CSS-only horizontal animation
  • SVG background image integration
  • Responsive padding and white-space handling
  • Hardware-accelerated transform transitions
  • Auto-scrolling flexbox layout
Best use cases
  • Highlighting unique selling points (USPs) on a product page
  • Displaying sitewide shipping offers in the header
  • Showcasing brand benefits below the hero section
Compatibility
  • Most Shopify themes

The code

Shopify Liquid
1<div id="shopify-section-template--17138240979127__autoscrolling_text_9DGHnt" class="shopify-section autoscroll-text">
2 <style>
3 #sc-template--17138240979127__autoscrolling_text_9DGHnt {
4 padding: 16px 0;
5 background-position: center;
6 background-repeat: no-repeat;
7 background-size: cover;
8 background-image: url(//spacegoods.com/cdn/shop/files/bg_2000x.svg?v=1726480808);
9 }
10
11 #sc-template--17138240979127__autoscrolling_text_9DGHnt .text-wrapper {
12 align-items: center;
13 display: flex;
14 color: #fff;
15 font-family: "Apercu Pro";
16 font-size: 16px;
17 font-weight: 700;
18 width: fit-content;
19 position: relative;
20 animation: auto-scroll 60s linear infinite;
21 }
22
23 #sc-template--17138240979127__autoscrolling_text_9DGHnt .section_wrapper {
24 overflow: hidden;
25 }
26
27 #sc-template--17138240979127__autoscrolling_text_9DGHnt .block-text {
28 white-space: nowrap;
29 margin: 0 16px;
30 }
31
32 @keyframes auto-scroll {
33 0% {
34 transform: translateX(0);
35 }
36 100% {
37 transform: translateX(-50%);
38 }
39 }
40
41 @media screen and (max-width: 900px) {
42 #sc-template--17138240979127__autoscrolling_text_9DGHnt {
43 padding: 16px 0;
44 }
45 }
46 </style>
47 <div autoscrolling-text="" id="sc-template--17138240979127__autoscrolling_text_9DGHnt">
48 <div class="section_wrapper">
49 <div class="text-wrapper">
50 <div class="block-text">CONSISTENT CALM</div>
51 <div class="block-text">IMPROVE MOOD</div>
52 <div class="block-text">TASTES GREAT</div>
53 <div class="block-text">IMMUNE SUPPORT</div>
54 <div class="block-text">ZERO CRASH OR ANXIETY</div>
55 <div class="block-text">INCREASED FOCUS</div>
56 <div class="block-text">INCREASED FOCUS</div>
57 <div class="block-text">SUSTAINED ENERGY</div>
58 <div class="block-text">CONSISTENT CALM</div>
59 <div class="block-text">IMPROVE MOOD</div>
60 <div class="block-text">TASTES GREAT</div>
61 <div class="block-text">IMMUNE SUPPORT</div>
62 <div class="block-text">ZERO CRASH OR ANXIETY</div>
63 <div class="block-text">INCREASED FOCUS</div>
64 <div class="block-text">INCREASED FOCUS</div>
65 <div class="block-text">SUSTAINED ENERGY</div>
66 <div class="block-text">CONSISTENT CALM</div>
67 <div class="block-text">IMPROVE MOOD</div>
68 <div class="block-text">TASTES GREAT</div>
69 <div class="block-text">IMMUNE SUPPORT</div>
70 <div class="block-text">ZERO CRASH OR ANXIETY</div>
71 <div class="block-text">INCREASED FOCUS</div>
72 <div class="block-text">INCREASED FOCUS</div>
73 <div class="block-text">SUSTAINED ENERGY</div>
74 <div class="block-text">CONSISTENT CALM</div>
75 <div class="block-text">IMPROVE MOOD</div>
76 <div class="block-text">TASTES GREAT</div>
77 <div class="block-text">IMMUNE SUPPORT</div>
78 <div class="block-text">ZERO CRASH OR ANXIETY</div>
79 <div class="block-text">INCREASED FOCUS</div>
80 <div class="block-text">INCREASED FOCUS</div>
81 <div class="block-text">SUSTAINED ENERGY</div>
82 <div class="block-text">CONSISTENT CALM</div>
83 <div class="block-text">IMPROVE MOOD</div>
84 <div class="block-text">TASTES GREAT</div>
85 <div class="block-text">IMMUNE SUPPORT</div>
86 <div class="block-text">ZERO CRASH OR ANXIETY</div>
87 <div class="block-text">INCREASED FOCUS</div>
88 <div class="block-text">INCREASED FOCUS</div>
89 <div class="block-text">SUSTAINED ENERGY</div>
90 </div>
91 </div>
92 </div>
93
94
95</div>

How to install Infinite info bar v2 on your Shopify theme

This snippet belongs in sections/announcement-bar.liquid (or the top of layout/theme.liquid), directly above your header so it renders on every page. Expect the whole job to take about 5–10 minutes.

  1. 1From your Shopify admin, open Online Store → Themes, click the button on your live theme and choose Duplicate. Always work on a copy so you can roll back instantly.
  2. 2On the duplicated theme, click … → Edit code to open the theme code editor.
  3. 3Open sections/announcement-bar.liquid (or the top of layout/theme.liquid) in the file tree. If your theme uses different file names, search for the template that renders the area where you want the block to show up.
  4. 4Click Copy code on this page, then paste the snippet directly above your header so it renders on every page.
  5. 5The snippet ships with its own scoped <style> block, so you do not need to touch base.css or theme.css. If you prefer to keep CSS centralised, move the contents of the style tag into your theme stylesheet and delete the inline block.
  6. 6Click Save, then hit Preview and check the block on desktop, tablet and mobile widths.
  7. 7When you are happy with the result, publish the duplicated theme from Online Store → Themes → Actions → Publish.

How to customise it

Every value below lives inside the snippet, so you can adapt Infinite info bar v2 to your brand without touching the rest of the theme.

  • Colours — the snippet uses #fff. Replace those values inside the style block with your brand palette, keeping at least a 4.5:1 contrast ratio between text and background so the block stays accessible.
  • Typography — the block declares font-family: "Apercu Pro". Delete that line to inherit your theme font instead, which usually looks better integrated.
  • Sizing — adjust the font-size values (16px) and the padding so the block carries the same visual weight as the elements around it.
  • Copy — rewrite the hard-coded text (for example “CONSISTENT CALM”) in your own brand voice, and translate it if you sell in more than one language.
  • Responsive behaviour — the @media query defines the mobile breakpoint. Adjust the pixel value if your theme uses a different breakpoint scale.

Common mistakes to avoid

These are the issues merchants run into most often when installing a snippet like this one.

  • Editing the live theme directly. Duplicate it first — a single unbalanced Liquid tag can take a storefront down mid-campaign.
  • Pasting the code into the wrong file. Dropped into layout/theme.liquid instead of sections/announcement-bar.liquid, this block will render on every page of the store, including ones where it makes no sense.
  • Renaming the CSS classes in the markup but not in the style block, or vice versa. The class names have to match exactly or the styling silently disappears.
  • Publishing without testing on a real phone. Most Shopify traffic is mobile, and layout problems almost always surface there first.

Performance notes

What this block costs you in load time, and how to keep that cost at zero.

  • The CSS is inline and scoped to this block, so it adds no extra network request. At a few kilobytes it has no measurable effect on your Lighthouse score.
  • The animation runs on CSS keyframes. Animate only transform and opacity where you can — animating width, height or top forces a layout recalculation on every frame.
  • Run PageSpeed Insights before and after you add the block so you have a concrete number rather than a guess.

SEO & accessibility

How to add this block without damaging your on-page structure or your rich results.

  • Nothing in this snippet should replace your page <h1>. Keep product and page headings intact and use <h2> or <h3> for the block's own heading so the document outline stays clean.
  • If the block shows review or rating content, keep it consistent with the structured data your review app already outputs. Duplicating or contradicting rating markup can cost you the rich result entirely.
  • The block does not create a new URL, so there is no canonical or indexing change to make. It improves on-page engagement signals rather than crawlability.
Frequently asked questions

Infinite info bar v2 — questions merchants ask

Will this snippet work with my theme?

It is built with standard Liquid, HTML and CSS, so it works with Dawn and virtually every Online Store 2.0 theme, as well as most vintage themes. The only thing that changes between themes is the file you paste it into — if yours has no sections/announcement-bar.liquid, look for the equivalent template that renders the same area.

Do I need an app to use it?

No. This is theme code you own outright: no monthly fee, no third-party script tag, and no app that can break your storefront the next time it updates.

How long does it take to add “Infinite info bar v2” to a store?

Most merchants have it live in under fifteen minutes — duplicate the theme, paste the code, adjust the colours and copy, preview on mobile, publish.

The styling looks broken after pasting. How do I fix it?

Confirm you copied the whole snippet including the closing style tag, then check whether one of your theme's own CSS rules is overriding it. If a theme rule wins, increase the specificity of the snippet's selector rather than scattering !important through the file.

Will it slow my store down?

Not meaningfully. It is inline markup with scoped CSS and at most a few lines of vanilla JavaScript — no external libraries, no extra HTTP request. Optimising your product images will always have a far bigger impact on load time.

Can I use it on a client store or a commercial project?

Yes. Every snippet in the MCO Hub library is free to copy, modify and ship on any store, including client work. Attribution is appreciated but not required.

Related snippets

Keep exploring