is there a way to style the Label of mx-focus radio button?

1
Hi Guys,   When I click on the label of a radio button the class "mx-focus" is added to input. I would like to style the label, based on what has been selected. is this possible?    
asked
5 answers
3

label:focus-within{
    background-color: red;
  }

I guess I needed some lunch to think about it.

:D 

answered
0

Ok so after doing some digging, I dont think it is viable to stype labels due to how CSS works and how Mendix create the dom.

"normally" the input is placed BEFORE the label, meaning you can use some CSS selectors to do a:
Is this field checked, if so, style the following label.

CSS can only target "following" as it is a "cascading" style sheet.

With Mendix the input is nested inside the label, so there is no way to style the label with CSS.

 

answered
0

We used the Radiobutton list widget from the appstore (https://appstore.home.mendix.com/link/app/20/Mendix/Radiobutton-List).

And completely changed the styling...

answered
0

This is what the Radiobutton-list produces:

And this is how we made it look in the browser:

answered
0

I submitted a recommendation for this as I noticed I am unable to style labels on disabled buttons without a custom class wrapper: https://forum.mendix.com/link/ideas/1637

answered