nextcloud / forms

đź“ť Simple form & survey app for Nextcloud
https://apps.nextcloud.com/apps/forms
GNU Affero General Public License v3.0
316 stars 97 forks source link

fix: Improve styles of layout for QuestionFile #2253 #2259

Closed Koc closed 1 month ago

Koc commented 2 months ago

See #2253 for more info. I'm not css-guy, so, if you have any suggestions how to fix it in a proper way - welcome :pray:

Fixed version has same height and paddings line other input types for both edit/view versions: image image

Chartman123 commented 2 months ago

@Koc thanks for looking into it. Perhaps @susnux can also have a look at it, as I'm not an CSS expert either...

Koc commented 2 months ago

I guess for a long term it would be nice to add type=file support to NcActionInput

susnux commented 2 months ago

Just use the variables, but otherwise fine :)

Koc commented 1 month ago

@susnux for some reason it not works for me with variables :confused:

Input should have height: 44px for edit mode, but variable is only 34px

image image

Seems like it's overwritten with min-height: 44px without variables.

susnux commented 1 month ago

Input should have height: 44px for edit mode, but variable is only 34px

No starting with Nextcloud 30 all inputs should be 34px, that why we should only use the variables to be independent from the server version.

Koc commented 1 month ago

ok, but how can I properly calculate paddings?

susnux commented 1 month ago

ok, but how can I properly calculate paddings?

Paddings should always be multiple of --default-grid-baseline, if it is about centering then probably something like this: calc((var(--default-clickable-area) - 1lh) / 2) (this would be the padding needed to center something).

susnux commented 1 month ago

I pushed another commit with unifies the style with other inputs form Nextcloud. Note that it might look not 100% equal currently (border width), but this is due to a missing fix for e.g. NcDatetimePicker which will be release this week.

Feel free to adjust or even drop my commit if you want to adjust :)

Screenshot 2024-08-14 at 18-58-14 oo - Formulare - Nextcloud

Koc commented 1 month ago

@susnux mate, it looks really amazing, thank you. This css is too hard for backend developers like me :see_no_evil: . I've fixed formatting to pass pipeline

Koc commented 1 month ago

I guess for a long term it would be nice to add type=file support to NcActionInput

we have ticket for that™ https://github.com/nextcloud-libraries/nextcloud-vue/issues/4339

Chartman123 commented 1 month ago

@Koc yeah nice, so we could switch in the future, when it's integrated into the lib

Until then: let's get this merged :)