How to Use the Styles Element in Layout & Design Tool

RebelMouse makes it easy to build intricate, sleek websites through our Layout & Design Tool. Given the critical importance of site performance when it comes to ranking well in search and retaining audiences, we've optimized how the Styles element works with CSS. Here's an overview of what you need to know.


There are two core ways a Styles element can be set to serve CSS: Lazy Load Enabled and Lazy Load Disabled.

When Lazy Load is enabled in the Properties card, all styles defined are minified, inserted into the page header, and put into use upon the first load of a page. When you minify your code into one style tag that fits into your page header, this helps improve your site's page speed.

For CSS styles that are not essential, the Lazy Load checkbox should remain unchecked, and the Styles element should instead be appended in your layout after the initial Styles element that's set to load in the viewport upon first load. If the Styles element has heavy CSS, like backgrounds and animations, it's good for your site's page speed if it's set to load after your users' first screen, once they start scrolling and the content enters their viewport at a later point in time.

Additionally, you can use Jinja in a Styles element, which is helpful if you want to reuse variables via Global Settings. For example, when primary-color is your global variable:

{{context.global_settings['primary-color']}}

Here are some screenshots that show how to reuse a variable from Global Settings in a Styles element:

When using a Styles element, consider the following best practices:

  • A Styles element should be used in your Top Bar for any CSS that repeats on more than two pages. This will minimize the occurrence of bugs that commonly appear when you change code on one page, and forget to make the same changes to other pages that need the same CSS.
  • If different CSS needs to be written for one page only, add another Styles element. This ensures that you minimize the CSS on your pages and avoid loading unnecessary CSS.
  • Your CSS tag should be well formatted. Strategic commenting should help group styles by type. This makes it easier to navigate through the code. For example, here's what an open-and-closed comment should look like:

  • You can select all code in a Styles element and then press Shift + Tab to automatically format your code. You can also use a tool like Unminify to help unpack your minified code.
  • Don't forget to write mobile-first CSS. This helps ensure that unnecessary styles are not loaded on mobile devices.
  • Do not use IDs that are generated by RebelMouse. For example, "id=Section_UTC_0_0_17_0_0_2." Instead, add classes to rows and columns:

A class can be added to any post:

  • All posts with the same design can be styled in a Styles element. This is helpful because if you style one post, and there are four others that should have the same look and feel, the CSS will be duplicated on our server for each of them:

If you have any questions about how to use the Styles element, contact your account manager or email support@rebelmouse.com today.

Why RebelMouse Is the Best Content Marketing Platform

RebelMouse is a unique platform and company. The company was founded on the vision that media companies would need an always-modern solution to thrive in the new connected internet, and that brands would have to behave like new media companies and use the same platforms.

Keep reading... Show less

Why Premium Creative Agencies and CTOs Choose to Develop on RebelMouse vs. WordPress and Drupal

The Intersection of Design and Development: Where Your Clients Thrive

We started RebelMouse seven years ago knowing that there was a fundamental design flaw in the world of traditional CMSs: Every instance, on every platform, had to be updated independently. It's similar to an era when users had to manage their own Microsoft Exchange Server for email. The costs of managing, maintaining, and iterating on a CMS to keep it awesome and world class is typically a $10 million-a-year endeavor. But even then, these cost-prohibitive CMSs are still behind the times.

Keep reading... Show less

Native Multivariate Testing at Scale With RebelMouse

What Differentiates Our Approach

There are many popular tools that allow you to perform experiments and A/B tests on your users — primarily Google Chrome Experiments and Optimizely. But all of these solutions are JavaScript additions to your web page that sidestep the problem of old, outdated, and clumsy CMSs. These solutions work by calling on a third-party JavaScript library that rewrites a page after it's rendered. This approach adds extra page weight and creates strange user experiences due to having to wait for everything to load and be rewritten on the fly.

At RebelMouse, we've solved this in a very elegant way. At the core level of our platform, we can natively render different layouts and track the exact differences in performance when comparing a test to your other layouts.

Keep reading... Show less

Modern E-Commerce: Blur the Line Between Content and Design

Create Modular + Reusable Design Patterns on RebelMouse

Content saturation is an industry-wide problem, and the e-commerce space is no exception given that it's filled with big brands, small Etsy stores, and everyone in between all fighting for similar audiences. The best way to fight this symptom is to understand your audience and provide them with what they want.

Keep reading... Show less

Instagram-style E-commerce Features on RebelMouse

Revolutionizing E-commerce on RebelMouse

Whether you're a brand with a blog or a media company with a site, driving purchasing behavior and building an audience that uses your content to find things they love to buy is vital. We're very proud to have built out the same functionality that everyone is now used to on Instagram, with layovers on images that lead to products with attribution.

Keep reading... Show less

Building Premium Communities and User Journeys on RebelMouse

RebelMouse is much more than just a replacement for a traditional CMS. Our platform is a tremendous community-building experience. Today's social ecosystem has given us a seemingly limitless number of premium creators who understand how to create gorgeous and relevant content that drives the growth of their own audiences. These creators and influencers are either experts in certain topics, or heavily engaged in targeted content that drives their interests. They're not only consuming the content they're passionate about, but they're contributing to the conversation, too. The new role of the editor is not just to cover the most important topics and people around their expertise, but also to invite those preferred influencers into their community and get them to participate in creating premium content.

Read our deck here...

Keep reading... Show less

Dynamic Voting: Grow Traffic and Engagement Organically

Help your audience find its voice.

Creating quality content is no longer on marketers alone. We live in a universe of creators who are willing to not only consume content that resonates, but play a role in the creation, promotion, and conversations surrounding it.

Since the start of RebelMouse, we've been on a journey to create dynamic media that is easier for content creators to curate and amplify on social. It's why we've built an online engagement platform centered around the power of communities that thrive naturally in the digital ecosystem.

Keep reading... Show less

How to Monetize Your Website in Today’s Publishing Environment

In order to define distributive publishing, we have to ask the following question: If you have quality content, but nobody sees it, does it even exist? The answer is no, because your content needs to be supported in a way that lets it move seamlessly across all channels, especially site, search, and social. But let's take this question a step further: If you can't monetize your content to generate the support it needs, how do you create quality content in the first place?

Keep reading... Show less

A Modern Story of Web Performance From RebelMouse Founder + CEO Andrea Breanna

If I had more time, this website would have loaded faster

In the first months of 2020, we've focused at RebelMouse on page speed and performance. We worked very hard and found ways to take 90% of the sites we power to 90+ performance scores via Google's PageSpeed Insights tool — even with sites that are loaded with ads, embeds, third-party analytics, and other typical slow-loading elements. You can read more about our victories here.

A few months after we started this process, COVID-19 hit the world very hard. Suddenly, every media company was faced with a huge problem: Advertising fell off a cliff in what seemed like seconds. The only way to survive this unprecedented downturn is to grow traffic and control costs at the same time. So we started to shave our code and made our websites faster. We dropped costs just as dramatically as we were increasing scores.

Here are some surprises we found when doing this: If you want truly exceptional performance, none of the JavaScript and CSS frameworks that developers love so much make the cut. We thought the React version of RebelMouse was going to be the huge page speed breakthrough, until we realized the only way to achieve this goal was to write the code carefully and refactor it endlessly until it was as short as possible. As any author will tell you, like editing a book or a blog post, the revision process is never really done. By stepping away from frameworks, and methodically shaving vanilla code, our customers continue to see major improvements in performance.

As we announced this to our site network and rolled it out publicly, many of our clients asked me personally, "How did you do it?" The answer is easy to understand regardless of how technical you may be. It's perfectly summarized in this wonderful quote attributed to Mark Twain:

"If I had more time, I would have written a shorter letter."
—Blaise Pascal, 1657 (and later, more famously Mark Twain)

The universe is sometimes very beautiful, and especially when you keep it simple. If you would like to start publishing on a site optimized for both speed and sustainability, request a proposal and let's start working together.

Google Launches Journalism Emergency Relief Fund for COVID-19 Publishers

Through the Google News Initiative, relief fund aids news outlets covering the virus

Small and medium-sized news organizations producing original content about the COVID-19 pandemic for their local communities could be eligible for money from Google.

The search engine announced a global Journalism Emergency Relief Fund through the Google News Initiative to support journalism during the crisis. Funds will range from the low thousands to tens of thousands depending on the size of the newsroom, according to Google.

Keep reading... Show less
Subscribe to Our Newsletter