Menu bar home as a link

You need to replace all the : colons with = sign, you need to remove all ; semi-colons and you need to put the script block {} into a hashtable =@{}

Ha, I see what you’re getting at!

Yeah many thanks for this example, it sometimes helps just to see a solid example to build up on.

Cheers

Ok so using this I can get it working:

$GlobalStyle =’
#logoImage{
max-width: auto;
max-height: auto;
display: block;
margin-left: -5%;
}
padding: 5px;
font-size: 22px;
border-radius: 25px;
text-align: center;
}
.MuiCardContent-root {
text-align: center;
}’

New-UDStyle -Style $GlobalStyle -Content{}

However even thought eh text-align is applided in the css:

image

The text acually does not align center. Is this something to do with cards?

Using $theme and buiding it that way did not seem to work. So had to go with style and building the object as above.

Sadly @SnV it still doesn’t look like you are passing the CSS in a hashtable format…please see my blog here, which includes a few examples:-


And there is the official documentation pages which also explain how to style your own theme…to me it looks like you are still using a lot of raw css

I tried it as a Hashtable and it does not even apply the changes to the CSS.

Tried it like this:
$theme = @{
“.MuiPaper-root” =@{
“text-align” = “center”
}
“.MuiCardContent-root” =@{
“text-align” = “center”
}
}

and like:

$theme = @{
“MuiPaper-root” =@{
“text-align” = “center”
}
“MuiCardContent-root” =@{
“text-align” = “center”
}
}

Neither of these applied to the webpage.

With the above the css is not shown:

image

$UDScriptRoot = $PSScriptRoot
New-UDDashboard -theme $theme -Title “EdgeCloud Services” -Content {
#New-UDStyle -Style $GlobalStyle -Content{
New-UDCard -Id “cardStyleMain” -Title ‘Simple Card’ -Content {
“This is some content”
}
#}
}

If I do it like this:

$UDScriptRoot = $PSScriptRoot
New-UDDashboard -Title “EdgeCloud Services” -Content {
New-UDStyle -Style $theme -Content{
New-UDCard -Id “cardStyleMain” -Title ‘Simple Card’ -Content {
“This is some content”
}
}
}

Same thing no new CSS is applied. So I had to do it as above in raw CSS.

Do I need to use the new-theme command is that why?

$Theme = New-UDTheme -Name “Test” -Definition @{
‘.MuiPaper-root’ =@{
‘text-align’ = ‘center’
}
‘.MuiCardContent-root’ =@{
‘text-align’ = ‘center’
}
} -Parent “default”

New-UDDashboard -theme $theme -Title “EdgeCloud Services” -Content {
#New-UDStyle -Style $theme -Content{
New-UDCard -Id “cardStyleMain” -Title ‘Simple Card’ -Content {
“This is some content”
}
#}
}
Tried this and still nothing :man_shrugging::

If I use the same above but with the code:

New-UDDashboard -theme $theme -Title “EdgeCloud Services” -Content {
New-UDStyle -Style $theme -Content{
New-UDCard -Id “cardStyleMain” -Title ‘Simple Card’ -Content {
“This is some content”
}
}
}

Then nothing displays, so it breaks the styling.