I’d like to customize some elements via CSS, but using the global css doesn’t allow me to scope certain styles to light/dark mode. The styles in my CSS file are being applied to both themes the same way, but this is really not ideal.
What I’m trying to do is use the “overrides” item as part of the MUI theme settings, but it doesn’t seem to work. Here’s what I’m trying to do (see overrides → MuiButton):
@{
light = @{
palette = @{
primary = @{
main = '#1C148D' # main top bar
contrastText = '#ffffff' # Top bar text
}
secondary = @{
main = '#ED1C24' # checkboxes, what else?
}
background = @{
default = '#F6F8FB'
paper = '#FFFFFF'
}
text = @{
primary = '#00001f'
secondary = '#00001f'
disabled = '#D9D9D9'
hint = '#D9D9D9'
}
}
}
dark = @{
palette = @{
primary = @{
main = '#000021'
contrastText = '#ffffff'
}
secondary = @{
main = '#1B1487' # checkboxes, what else?
}
background = @{
default = '#00004D'
paper = '#D8DBDC'
}
text = @{
primary = '#00001f'
secondary = '#00001f'
disabled = '#D9D9D9'
hint = '#D9D9D9'
}
divider = '#424242'
overrides = @{
MuiButton = @{
root = @{
color = '#ffffff'
}
}
}
}
}
}
Am I using this wrong, or is support for it just not implemented? If not, can we get it? I’m open to any workarounds. I’d just like to be able to have different CSS styles applied when in dark vs light mode.
Does anyone know if it’s possible to build my own UDv3 “build”? I cloned the repo at GitHub - ironmansoftware/universal-dashboard: Build beautiful websites with PowerShell. and tried to build what was in “v3” folder but it seems that the dependencies are really old. After updating them, I’m having issues with the webpack config being older it seems, with deprecated/removed options. Is there an up to date version of UD that I can modify and build myself? Or is it closed source? Its pretty damn annoying having my hands tied behind my back and not being able to submit PRs for all the bugs and glaring omissions in this product.
I’ll have to look into the MUI overrides. I haven’t tried that myself. I’ll open an issue for it.
As for the UDv3 build, your the first to ask about that since I published it
I’ll publish and updated version. It’s very out of date but you should be able to run the build script and produce a framework with any tweaks you make. I’ll try to get that done by the end of the week.
Thanks @adam! So I understand that there is a process for building custom components, but I’d like to know more about modifying what’s already there. I was thinking that it would be nice to be able to investigate and implement or fix that lack of MUI override myself, then possibly submit a PR for that. It just doesn’t seem like the project is setup for community contributions. If I was to make modifications to my own UD build, would I also be able to modify the associated powershell cmdlets that we call to show various components? Or is that C#-based and closed source? I suspect that only being able to modify the JS-side of things would be a bit limiting.
Everything for the UD framework is accessible via PowerShell and JavaScript. There are a couple cmdlets that are C# based but all the UDv3 MUI components are built using PS scripts.
Once I get the new source uploaded, I’ll you be able to run Invoke-Build on the v3 directory to build the framework.
The frameworks are loaded from the %ProrgamData%\PowerShellUniversal\Dashboard\Frameworks folder. You can place the built version in there to load it up in your PSU instance.
You’re the first person with a desire to contribute to UD post PSU. I haven’t put much effort into making it easier than described. I can certainly make it more automatic to merge better the closed source branch and the open source framework branch.
I sorta doubt that others are trying to get as much mileage out of this product as I am. I’ve been building a “cloud” control panel, and while trying to attain the first-class UI/UX that I’m looking for, I’ve run into quite a few roadblocks. I’m trying to see how far I can push it before I have no choice but to move to pure Node & React. While you’ve been pretty responsive with fixing/adding things, I don’t see any reason I couldn’t contribute some fixes of my own if they are within the open source area of the product. I’d rather have you look into the things I can’t fix myself!
I’ll keep submitting bugs and enhancements as I go. Is it better for you to post them here or on github?
Hey @adam can you link to the issue you raised for this? Did you end up making any progress on this? I just received a PM from someone asking if I made any headway on this issue, so I wanted to follow up. Thanks!