Pode.Web
Pode.Web copied to clipboard
Button in Form
Hi,
how can i apply cssstyle to button?
New-PodeWebForm -Name 'name' -Content @() -CssStyle @{?????} -ScriptBlock {}
like this:
Hi @eugen257,
-CssStyle
is just a hastable that takes the raw CSS property name/values. Such as:
-CssStyle @{ 'background-color' = 'purple' }
Hi @Badgerati,
it only affects the form itself:
Have you tried using the -CssStyle @{ 'background-color' = 'purple' } parameter on the New-PodeWebButton itself instead of the whole form? As documented here: https://badgerati.github.io/Pode.Web/Functions/Elements/New-PodeWebButton/
Hi @jbaechtelMT,
thanks )), but I meant when using the form: New-PodeWebForm
is it possible to do something with the button.
Hi @eugen257,
If you want to style the button the form renders you'll need to use -CssClass
to give the form a custom class:
New-PodeWebForm -Name Example -CssClass 'my-custom-class'
Then create a CSS file at /public/custom.css
to pin-point the button:
form.my-custom-class button[type='submit'] {
/* your properties here */
}
And then you can load the CSS file in Pode.Web via `Import-PodeWebStylesheet -Url '/custom.css'
Thanks @Badgerati 👍