Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Come up with a style guide, and actual styles, for all builtin widgets, relating to unfocused and disabled states #1780

Open
davep opened this issue Feb 13, 2023 · 2 comments
Labels
enhancement New feature or request Task

Comments

@davep
Copy link
Contributor

davep commented Feb 13, 2023

In part prompted by the start of work on #1748: it's time to think about a style guide, and an actual implementation of styles, for interactive Textual widgets in relation to being enabled/disabled and focused/unfocused. The main aims should be that a user of a Textual application can:

  • See at a glance which widgets are enabled
  • See at a glance which widgets are disabled
  • See at a glance which widgets that have their own "cursor" are focused and where the cursor is
  • See at a glance which widgets that have their own "cursor" are unfocused and where the cursor is

There should probably be an overlap here too. It would make sense, I think, for a Tree or a DataTable to have no focus, be disabled, but also have content and have a cursor highlighting something; done in a way that it's obvious that it's disabled and not just lacking focus.

Things to consider:

  • The styling should be as universal as possible
  • It should be possible to theme it (when themes become a thing)
  • It should work for both dark and light mode
  • It should always be easy for a developer to override it
@davep davep added enhancement New feature or request Task labels Feb 13, 2023
@davep
Copy link
Contributor Author

davep commented Feb 14, 2023

As part of the work on #1748 (see #1785) I've added this to App.DEFAULT_CSS:

    *:disabled {
        opacity: 0.6;
        text-opacity: 0.8;
    }

This actually seems to go a long way to solving the issue for a default :disabled style.

@davep
Copy link
Contributor Author

davep commented Feb 16, 2023

See also #1704 which is very much related to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Task
Projects
None yet
Development

No branches or pull requests

1 participant