nitely / Spirit

Spirit is a modern Python based forum built on top of Django framework
http://spirit.readthedocs.io
MIT License
1.16k stars 334 forks source link

What is the easiest way to put multiple fields on a form on the same line? #317

Open sureshvv opened 1 year ago

sureshvv commented 1 year ago
  1. Does I need to override _form.html?
  2. Can this be done with just css?

Any pointers appreciated.

nitely commented 1 year ago

That's not so fresh in my mind. The css is all css grids and flexbox, so it should be doable with just css.

This override seems to do something in the login form:

.login form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}
.login .field {
  padding-right: 10px;
  width: 50%;
}

I restricted it to the login class because I have no idea if it may break some other forms (like the topic comment box).

The css is written using Sass, so unless you want to modify the actual source code (scss files) and recompile them as a single css file, you are better off just adding your own css with all the overrides you want.