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:
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:
$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 :
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.