0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/app/assets/stylesheets/admin/schema_field.scss
Régis Hanol 7297e482bc
UX: improve schema setting editor layout (#37058)
The schema setting editor used for theme/component object settings had a
cramped layout that didn't make good use of available space.

This commit improves the layout by:

- Increasing the navigation tree minimum width from 10em to 14em
- Changing fields from horizontal layout (label beside input) to
vertical layout (label above input), matching FormKit patterns
- Reducing the gap between navigation and fields from 5vw to 2rem
- Allowing field inputs to stretch to full width

This is the "fix it in core" approach rather than adding theme-specific
CSS identifiers, as discussed in the meta topic.

Ref: https://meta.discourse.org/t/392690
Follow-up to: https://github.com/discourse/discourse/pull/37043

**BEFORE**

<img width="1961" height="1453" alt="2026-01-12 @ 09 58 38"
src="https://github.com/user-attachments/assets/fc78d8fb-6097-440c-8131-0dc98cda0e6d"
/>

**AFTER**

<img width="1961" height="1453" alt="2026-01-12 @ 09 58 32"
src="https://github.com/user-attachments/assets/9f98483c-b2a3-49fc-8d70-5de6fe2b37a3"
/>
2026-01-14 14:50:23 +01:00

71 lines
1.2 KiB
SCSS
Vendored

@use "lib/viewport";
.schema-field {
margin-bottom: 1em;
width: 100%;
display: flex;
flex-direction: column;
gap: 0.5em;
.schema-field__label {
word-break: break-all;
}
&[data-type="boolean"] .schema-field__input {
flex-direction: row;
}
.schema-field__input {
display: flex;
flex-direction: column;
min-width: 0;
input {
width: 100%;
margin-bottom: 0;
}
input[type="checkbox"] {
width: auto;
}
.select-kit {
width: 100%;
&.--invalid {
summary {
border-color: var(--danger);
}
}
}
.schema-field__input-description {
font-size: var(--font-down-1);
color: var(--primary-medium);
min-width: 0;
overflow-wrap: break-word;
}
}
.schema-field__input-supporting-text {
display: flex;
flex-direction: row;
margin-top: 0.2em;
width: 100%;
gap: 0 0.5em;
.schema-field__input-count {
margin-left: auto;
font-size: var(--font-down-1);
&.--error {
color: var(--danger);
}
}
.schema-field__input-error {
font-size: var(--font-down-1);
color: var(--danger);
}
}
}