Button colors not working in chrome

Hi,

Seeing a weird issue. The colors I chose for various buttons do not display right in Chrome, but they do in IE / Edge.

Blockquote
########################################################

    #Load a grid



    New-UDCard -Title "Your Staff" -TitleAlignment "Left" -Endpoint {

        New-UDGrid -Endpoint {

            $Session:Page_MyCTVs_All_Employees | Select-Object -Property Icon,Name,Button_Details,Checkbox | Out-UDGridData

            }



        New-UDCard -Title "Actions" -TitleAlignment "Left" -Endpoint {

            New-UDParagraph -Text 'These are a series of actions you can take.  Once you have checked the box for all users, click one of the buttons to perform the action'

            New-UDButton -Text "Extend" -BackgroundColor "Green" -OnClick {

                $Session:Page_MyCTVs_All_Employees_Find_Checked = $null

                $Session:Page_MyCTVs_All_Employees_Find_Checked = Find-PMIUDCheckedObjects -CheckBoxIDPropertyName "Checkbox_ID" -ArrayOfObjectsWithCheckBox $Session:Page_MyCTVs_All_Employees

                Show-UDModal -Content {

                    New-UDGrid -Endpoint {

                        $Session:Page_MyCTVs_All_Employees_Find_Checked | Select-Object -Property Name | Out-UDGridData

                        }

                    }

                }

            New-UDButton -Text "Mark as not my staff" -BackgroundColor "Yellow" -FontColor "Black" -OnClick {}

            New-UDButton -Text "Disable" -BackgroundColor "Orange" -OnClick {}

            New-UDButton -Text "Delete" -BackgroundColor "Red" -OnClick {}

            }

        }

Here is what it looks like in chrome:

BTW, this is running in IIS on PS7 incase that helps.

Any ideas? Do i need an update or something?

Here is what it should looks like:

@ericcsinger am using ps7.1 and have no issues but i use the color code instead, try that and i think it will work

New-UDButton -Text “Extend” -BackgroundColor “#2EFE2E” -OnClick

Thank you for the reply, I gave it a go, but not luck.

Incase it helps, this is the output from the chrome dev tools:

@ericcsinger what version of UD you are using?also are you using a specific theme or the default one

HI,

Using version 2.9.0, no theme specified at all.

Hi @ericcsinger,

I believe this is a bug in 2.9.0,

Could you try to add the following instead:

New-UDButton -Text "Demo" -Style {
    "background-color" = "Red"
}
1 Like

Is that the right syntax? Getting the following error:

PS C:\Users\ericcsinger> New-UDButton -Text “Mark as not my staff” -Style {
“background-color” = “Orange”
} -OnClick {}
ParserError:
Line |
2 | “background-color” = “Orange”
| ~~~~~~~~~~~~~~~~~~
| At line:2 char:21 + “background-color” = “Orange” + ~~~~~~~~~~~~~~~~~~
The assignment expression is not valid. The input to an assignment operator must be an
| object that is able to accept assignments, such as a variable or a property.

@ericcsinger as UD is so flexible there is this super-cool extension you can download https://marketplace.universaldashboard.io/Dashboard/UniversalDashboard.Style
Which will allow you to apply any custom CSS styling to any components, so this should be a work-around that should show correctly in all browsers

Sorry, i forgot…

New-UDButton -Text "Demo" -Style @{
    "background-color" = "Red"
}
1 Like
1 Like

ok, that didn’t error out this time, let me give it a go in a bit. Thanks :slight_smile:

1 Like

Looks like that did the trick :slight_smile: Thanks!!!

1 Like