umbraco / Umbraco.Forms.Issues

Public issue tracker for Umbraco Forms
29 stars 0 forks source link

Remove html and classes as much as possible #1168

Open ralphvanvugt opened 4 months ago

ralphvanvugt commented 4 months ago

We can override the default forms css by checking the box in the backend. But every form will still use the form.cshtml file which contains custom classes and bootstrap markup as "row-fluid" and such. Could you please remove all that from this file. We have to make adjustments to the form.cshtml file to fit our designs. We do that in a custom theme. But with every upgrade we have to compare the file against the default one over and over again.

AndyButland commented 4 months ago

It's difficult to remove things like this as you'll appreciate it could be other customers are relying on them as CSS hooks, and we'd break their implementations. If you aren't happy with just having the unnecessary classes in there and ignoring them with your CSS, then a custom theme is the way to go. Note you can just overwrite the files you need - so if you only need changes in Form.cshtml, you can just update that.

Occasionally we have made changes to that file as you've no doubt seen, but the aim is to keep that to a minimum and only do so if we have a good reason to - so hopefully it shouldn't be too onerous to keep your custom theme up to date.

c9mb commented 4 months ago

The cshtml could perhaps be written to be dependent on a config switch - disable default form styles - with the default being False (maintain existing) and the optional True applying "clean" layout in those files.

AndyButland commented 4 months ago

Might get a bit messy in the template, but maybe. We did similar when we introduced semantic rendering for fieldsets before making the new behaviour the default in a major version.

Can either of you be more specific as to what you'd like to see optionally removed from the default theme files? I presume it can't be all CSS classes as you'd need some as hooks for your styling.

c9mb commented 4 months ago

I was simply pointing out how simplification could be done, without impacting existing applications. I'll leave it to the OP to fully describe their use case for it.