Every Mother

How to Recolor Text, SVGs, and Divider Lines in a Wix Studio Section using Custom CSS

H

When I build infographics in Wix Studio, I often create all the elements in Adobe Illustrator and export them as SVGs. I give them black fills in Illustrator on purpose. This way, when I upload them to Wix Studio as shapes or vector images, I can recolor them there. Recoloring can be changed one-by-one in the WixStudio editor, or, to my preference, I can recolor the entire infographic at once using CSS.

Example infographic built in Wix Studio - uses custom CSS to colorize the icons and borders gold and the text and numbers navy.

This all-at-once CSS approach should work beautifully in most website builders, but Wix Studio introduces one important complication. During the build and publish process, Wix Studio automatically generates a large number of internal classes with names like .JGtLUp, .xuzjBY, or .Vq6kJx. These class names are not meaningful, not documented, and not stable. They exist purely for Wix’s rendering engine and can change at any time, even between republishings of the same page.

Because of this, relying on element IDs or these auto-generated classes is unreliable. The ID you see while editing may not match the ID that appears in the published code, and any class that looks like random letters is intentionally not designed for developers to target.

A more stable, future-proof approach is to add your own class at the <section> level and then style all elements inside that section. This approach allows you to bypass the shifting IDs and focus on a predictable CSS structure. Even with this strategy, though, Wix Studio still wraps elements in deeply nested components with strong default styling, which can require using more specific selectors — and occasionally !important — to fully override the colors.

In this post, I will show how I recolored every element inside a section, including text, headings, SVGs, vector images, and divider lines, using a single CSS class. I will also show how to use Wix Studio color palette variables so your colors adapt automatically when your site colors change.


Assign a Custom Class to Your Section

First, select the section containing your infographic (choose from the Layers panel on the left) and add a class. Add a custom class by opening the code panel from the bottom and selecting the CSS Classes tab. In the custom classes field, type in the name of your new class.

In this case, I added bluetext custom CSS to each of the sections labeled: #row1, #row2, and #row3, too. The remaining examples will use bluetext as the custom class; substitute this custom naming for what makes sense in your design and code.

The class you create allows you to select your <section> and recolor elements.


Use Wix Studio Color Variables

WixStudio lets your site use a theme color palette, and each color in this palette has a variable that you can use in custom CSS.

Wix Studio exposes your site theme color palette as CSS variables like this:

--color_25: 0, 75, 201

To use this color in CSS, wrap it in an rgba function:

rgba(var(--color_25), 1)

Using palette variables instead of hard-coded hex values ensures your colors update automatically if you change your theme.


Recolor Text, Headings, and SVGs

Next, open your Global.css file. You can access this file by clicking the link that reads,”Go to global.css“This file is where you will add your CSS declarations.

Wix Studio applies strong default styles to text, rich text elements, and SVGs. To override all of them, target the section and all its children. Instead of using the section id, the CSS that works is to use the generic element section and then the class we added, in this case, bluetext:

section.bluetext,
section.bluetext * {
  color: rgba(var(--color_25), 1) !important;
  fill: rgba(var(--color_25), 1) !important;
  stroke: rgba(var(--color_25), 1) !important;
}

/* RICH TEXT */
section.bluetext .wixui-rich-text__text {
  color: rgba(var(--color_25), 1) !important;
}

The CSS above recolors the text and SVG icons in my infographic section because of the use of * (universal selector and wildcard), including:

  • Paragraphs and headings
  • Links and buttons
  • SVG fills and strokes
  • Vector images imported from Illustrator

Because the SVG icons I uploaded have a black fill by default, this CSS recolors them.


Make Sure Vector Images Respond

To explicitly color the SVG icons, I can use more specific CSS, especially since some vector images contain nested elements or paths that require explicit targeting. Add this CSS to ensure every part recolors. In my case, I’m using color_26 so the icons are gold.

/* SVGs + vector images */
section.bluetext .wixui-vector-image svg *,
section.bluetext svg *,
section.bluetext [data-testid="svgRoot"],
section.bluetext [data-testid="svgRoot"] * {
  fill: rgba(var(--color_26), 1) !important;
  stroke: rgba(var(--color_26), 1) !important;
}

The above CSS covers all SVGs, including grouped paths and masked elements.

If you’re working with SVG icons in Wix Studio and want them to behave consistently — including how they’re sized and styled — see my SVG icons + repeater guide: Mastering SVG Icons and Repeaters in Wix Studio


Recolor Divider Lines

Divider lines in Wix Studio can render in multiple ways: as borders, small rotated divs, or line elements. Finally, to recolor horizontal and vertical lines, use:

/* Divider lines inside any .bluetext section */
section.bluetext .wixui-horizontal-line,
section.bluetext .wixui-horizontal-line *,
section.bluetext [class*="horizontal-line"],
section.bluetext [class*="vertical-line"] {
  border-color: rgba(var(--color_26), 1) !important;
  background-color: rgba(var(--color_26), 1) !important;
}

The provided CSS above ensures that all lines in my infographic section match the site-wide color palette, even if they change in the future.


Why This CSS Method Works

By giving my infographic section a class and targeting all child elements, I avoid relying on IDs that Wix Studio changes automatically. My SVGs from Illustrator stay fully controllable. All text, headings, and lines adopt the color I choose, and the color can update automatically if I change my site palette.

This approach is perfect for infographics, icon-heavy sections, and other visual content where you want to recolor and perhaps even test colors consistently. This method eliminates the need to select each element in the section one by one, then use the UI to choose the fill or outline color.

Watch Video Overview

Hello, today we’re in Wix Studio, and we’re looking at an infographic, so if I click Run here, I’ll give you a quick view. So we have Stowe Boasts, it’s an animated infographic, an SVG, A text number, text, horizontal and vertical lines. And what I wanted to do is each of these icons was brought in as a shape, so an SVG in Wix Studio, which means that I can select the icon layer and change its color here. Now, you can see this says it’s black. I am overriding that black color, which each one of these elements, if you click here also, you can see this says that it’s black. I brought everything in black, and I use CSS, actually, these four areas. So, if I comment these areas- area. It’s out, and I am clicking command + forward slash (CMD + /) on my Mac to go ahead and create comments. And you can see that now, all of my lines, my icons, my text, my links, they have all become black. Because that’s how I loaded them. Now what’s important here for the SPGs is I’m a designer who works in Illustrator. So I designed my infographic first in Illustrator. And each one of these icons, I know that I have them right for upload to Wix Studio. When I have used my shape mode and united all of the lines and I’ve made sure that the color is created by the fill. So I can see here in Illustrator I have a fill. It would let me change one color and it would change the entire icon. Now that is in contrast to if I select this image, you can see it has a stroke. So that means this is not ready for me to put into Wix Studio. So what I would do in- instead is object expand. Okay, so now I’ve expanded it. Then I will use shape mode unite. Now everything is united and you can see now I have a fill and I could pick any color and it’s using fill. So that’s the steps and then I would export it as an SVG. So I brought everything in as black and then I know. I wanted to use CSS to go ahead and change the colors. And I wanted to use the colors that are part of my theme colors. So in WIC Studio, each theme color is assigned a variable that we can use as a developer or designer in CSS. So here’s the steps and I have this in my blog as well which will have more detail if you want to go ahead and dig in. So my infographic has the infographic section and then row 1, 2, and 3. And I’ve ID these. Meaning this is using the hashtag and it has an ID. And this ID works great when I’m in my velo code. However, it is not a consistent ID when I start publishing my code. So the best way to be able to create specific CSS is to come here to your CSS classes tab and to create a custom class. So mine is called blue text. And I’m assigning that blue text class to the infographic section to the row 1, row 2, and row 3. Now, I have my first area. This first piece of text is all general text and headings. So when I undo that, you can see it turns my header, my icons. It’s basically everything that is in, um, this set. It’s a section that’s classed to the blue. And color 25 is the variable for my blue. Alright, so the next thing is rich text, which can be different. So I’ve added that in as well. Just to make sure I grab everything. Alright, so now as we come down, you can see I have these divider lines. And divider lines in WIX Studio can be created in multiple ways. So we have multiple selectors, um, to try to grab those. And this time I’m using 26, which is my gold color. And then lastly, I come in with this next CSS and it, is grabbing the SVGs and it is changing the color with CSS. So now I’m able to use any of the colors that I have. So if I chose for my SVG, instead of color 26, if I chose 24, you can see now it’s this light color. I don’t know if I have a one. That’s white. So this allows me to grab from my palette really easily and make adjustments. Alright, so I hope that this was helpful. And again, please look at the blog. There are multiple WIX Studio, post and videos and other web builders as well. Happy designing!


Further Wix Studio Resources

If you’re new to Wix Studio or curious what it’s like to design in this environment, check out my first impressions and workflow tips from when I started using Wix Studio as a web and graphic designer: First Impressions Using Wix Studio as a Web & Graphic Designer

For another foundational layout tip in Wix Studio — specifically how to set and use max width on content sections — check out my guide to setting a max width in Wix Studio: How to Set a Max Width in Wix Studio (And Why You’ll Actually Want To)

For dynamic pages in Wix Studio, I also have a guide on customizing breadcrumbs beyond the default (Item) label — handy if you’re building CMS-driven content layouts: Customize Breadcrumbs for Dynamic Pages in Wix Studio

About the author

Kelly Barkhurst

Designer to Fullstack is my place to geek out and share tech solutions from my day-to-day as a graphic designer, programmer, and business owner (portfolio). I also write on Arts and Bricks, a parenting blog and decal shop that embraces my family’s love of Art and LEGO bricks!

By Kelly Barkhurst

Recent Posts

Archives

Categories