Developers

How to Use Variables to Set Colors Across Your Site

How to Use Variables to Set Colors Across Your Site

Why This Is Important

You can easily set colors for every element of your site on RebelMouse, including the color of your text, links, and headlines. Usually there's a set of 2–3 colors used across a site. But instead of hardcoding the color on every element, you can use variables to make it so that if a color needs to change, you can update it in one place instead of everywhere — making future maintenance easy.


How to Use Color Variables

To set a variable, you need to navigate to Global Settings in our Layout & Design tool. This is the first page you land on after you choose Layout & Design from the hamburger menu (☰) as a logged-in user.

Next, click on the Code view in Global Settings:

Then, add in a variable like this:

<variable caption="AnyName " name="name_you_will_use_in_code" type="color" value="hex_value" />

Once added, it will look like this:

You can then use it in the Style tab of the Properties card for any element:

You can also use color variables in Custom HTML elements:

Then, you can add a <style></style> tag as follows to set up color overrides:

However, do not use color variables in the Header Code element because it will not render any results.

If you have any questions about this, please email support@rebelmouse.com.

What Is RebelMouse?
Request a Proposal
subscription model for publishers
Rebel Insights

In 2023, Publishers Take Back Control With Subscription Success

Users are ready to pay for content that delivers

The Rise of the Mature User

It's been a long and winding path, but in 2023 the subscription model continues its upward trajectory as a top revenue strategy for publishers of all sizes. The tug of war between platforms and publishers reached its peak in the last few years of the previous decade, leaving users desperate for a modern user experience that's clear of any clutter from the duopoly that is Google and Facebook. This is why intelligent paywall models are a top choice for users looking to consume content right from the source. When done correctly, the strategy can work for any type of media. The New York Times, a frequent showpiece example of the power of paywalls, is constantly reporting record-busting subscription numbers, with 7.6 million digital subscriptions in 2021.

And it all makes perfect sense. The subscription model eliminates the middleman — such as the platforms — so readers get the experience and content they want, and publishers get the cash they need.

Keep reading...Show less
The Most Secure CMS of 2023
Featured

The Most Secure CMS of 2023

Why RebelMouse Is the Most Secure CMS on the Web

Delivering a secure, high-performing environment with extreme reliability is essential to all of our clients at RebelMouse. We only use industry-leading, reliable approaches to host our infrastructure. This ensures maximum stability and security for all of our clients’ data. Here are just some of the reasons we’re able to maintain a hard-bodied product that’s flexible, too.

Keep reading...Show less
Interested in a Free Website Health Check?Check Your
Website's Health
Get Your Free Analysis Now