Umbraco.Forms.Issues icon indicating copy to clipboard operation
Umbraco.Forms.Issues copied to clipboard

Remove html and classes as much as possible

Open ralphvanvugt opened this issue 1 year ago • 4 comments

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.

ralphvanvugt avatar Feb 20 '24 15:02 ralphvanvugt

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.

AndyButland avatar Feb 20 '24 15:02 AndyButland

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.

c9mb avatar Feb 20 '24 20:02 c9mb

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.

AndyButland avatar Feb 21 '24 13:02 AndyButland

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.

c9mb avatar Feb 23 '24 20:02 c9mb