Skip to content

Improve default colors for text_input widgets#23960

Merged
alice-i-cecile merged 8 commits intobevyengine:mainfrom
alice-i-cecile:better-default-colors
Apr 24, 2026
Merged

Improve default colors for text_input widgets#23960
alice-i-cecile merged 8 commits intobevyengine:mainfrom
alice-i-cecile:better-default-colors

Conversation

@alice-i-cecile
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile commented Apr 23, 2026

Objective

  • Text input is one of the headline feature in Bevy 0.19.
  • Our defaults are currently very ugly, and shown across our user-facing text examples.
  • Good default matter for user perception of quality, and to make quick prototyping easier.
  • Additionally, the layout in the text_input example is erratic in a way that looks poorly made.

Fixes #23955.

Solution

  1. Clean up the default colors for text input by picking boring, uncontroversial tailwind colors.
  2. Change the css::YELLOW borders in our text input examples to something neutral that looks nice with our background.
  3. Fix up the layout for the text_input example so it's both simpler and looks much better.

Testing

cargo run --example text_input

Showcase

Before:

image

After:

image

@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Apr 23, 2026
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 23, 2026
@alice-i-cecile alice-i-cecile added A-Art Art, UX or graphic design C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. labels Apr 23, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Apr 23, 2026
Comment thread crates/bevy_text/src/cursor.rs
@Zeophlite
Copy link
Copy Markdown
Contributor

One "nice to have" would be to highlight the border color of the focused text input

@viridia
Copy link
Copy Markdown
Contributor

viridia commented Apr 23, 2026

One "nice to have" would be to highlight the border color of the focused text input

Unfortunately, that's not something that is the hands of EditableText. While it would be possible to modify the example to do this, it would complicated the example unnecessarily.

Feathers, by contrast, uses the outline on the parent entity to indicate input focus, because the feathers text input has an outer frame which holds both the actual text input entity and the adornments.

@Zeophlite
Copy link
Copy Markdown
Contributor

One more bit of followup, in #23947 crates/bevy_feathers/src/dark_theme.rs , we have

            (tokens::TEXT_INPUT_SELECTION, palette::ACCENT),
            (
                tokens::TEXT_INPUT_SELECTION_UNFOCUSED,
                palette::ACCENT.lighter(0.2),
            ),

This looks like

Screenshot 2026-04-24 at 7 45 49 am

Someone with a design eye should say if this is distinct enough

@viridia
Copy link
Copy Markdown
Contributor

viridia commented Apr 24, 2026

My personal preference would be:

  • don't show selection rect for non-focused fields (make it completely transparent)
  • for focused fields, let the selection be relatively understated - I'd go with a slightly dimmer version of accent color

@alice-i-cecile
Copy link
Copy Markdown
Member Author

image

@viridia
Copy link
Copy Markdown
Contributor

viridia commented Apr 24, 2026

OK let me be clear: when I was speaking of having the unfocused selection rect be fully transparent, I was only speaking in the context of feathers. For the non-feathers example, I can see how we would want to display the full capabilities of the EditableText component.

More specifically, feathers needs to be judicious in its use of color: the idea is that the widgets should be readable, but should not distract from the star of the show - the media or game scene being edited. It should not call attention to itself - except for cases like primary buttons, where it is intentionally calling attention to itself.

The non-feathers example, OTOH, just has to look pretty.

@jordanhalase
Copy link
Copy Markdown
Contributor

LGTM

@jordanhalase jordanhalase self-requested a review April 24, 2026 03:50
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 24, 2026
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 24, 2026
Merged via the queue into bevyengine:main with commit 90b4154 Apr 24, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in UI Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Art Art, UX or graphic design A-UI Graphical user interfaces, styles, layouts, and widgets C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Improve default colors for editable text

5 participants