Styling apps and elements with CSS (that normally you can't)

Introduction:
Having learned that you can use combinators in CSS, I decided to see what elements within Studio I could target and customize further than what the inspector tools allow. A good example is rounding out the corners of the Blog Post page, which doesn’t have a setting within the inspector panel.

How I did it:
I used the code panel within Wix Studio, the global.css file, the element toolset within my browser’s Developer tools to find the selectors, and the MDN web docs to learn more about CSS syntax.

Tools, Documentation and APIs:

Example:
You can check out a video of what is CSS, how to add it within Studio, setting custom classes, the general ruleset, and then how to use combinators to target these elements/selectors/attributes.
Youtube Video

5 Likes

Thats great to know. I have heard many ask about rounded corners to the blog post page

2 Likes

Glad it helps. I’ve gotten a few requests for blog post rounded corners.

Hey everyone.

This use case came up in one of the communities I help out in and I noticed that some have asked about this but if you want to change the input color for radio buttons and checkboxes inside your new forms, you can target just them with the trick above. Normally, the input color dictates what you type inside of the input fields as well as radio buttons, single checkboxes and multi-checkboxes.

Normally, this works well but if you have dark form background, the text input might be too dark to see but it’s needed otherwise you are unable to see the inputted text.

With the CSS trick above, you can manage this without having to make various changes within the settings.

/*used for single and multichoice*/
.form-section [data-hook="label-wrapper"],
/*used for single checkbox*/
.form-section [data-hook="label-wrapper"] span{
color: darkmagenta;
}

You can see the result below:

span is needed for the single checkbox as the text is nested inside of the [data-hook] so if you have a single checkbox, make sure you use
.form-section [data-hook="label-wrapper"] span

PS. I took a look at the hover and disabled state and these elements aren’t changed by the settings so there should be no need to do it but you could customize the it if you need.

3 Likes

These are awesome Roberto! Thanks for sharing!

/*To do the checkbox border color for a single checkbox*/
.footerSection [data-hook="checkbox-core"] span {
border-color: #ffffff !important;
}
1 Like

Thanks for the update. I checked and I found using

border: 1px solid #ffffff !important

as better to control the sizing, border type and color as well as !important to tell the browser to use this over any defaults.

This is awesome! Really valuable insights here

1 Like