mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
docstring
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
|
||||
|
||||
/* * {
|
||||
* {
|
||||
transition: color 300ms linear, background 300ms linear;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
*:hover {
|
||||
/* tint: 30% red;
|
||||
@@ -198,8 +198,8 @@ Error {
|
||||
height:3;
|
||||
background: $error;
|
||||
color: $text-error;
|
||||
border-top: tall $error-darken-1;
|
||||
border-bottom: tall $error-darken-1;
|
||||
border-top: tall $error-darken-2;
|
||||
border-bottom: tall $error-darken-2;
|
||||
|
||||
padding: 0;
|
||||
text-style: bold;
|
||||
@@ -211,8 +211,8 @@ Warning {
|
||||
height:3;
|
||||
background: $warning;
|
||||
color: $text-warning-fade-1;
|
||||
border-top: tall $warning-darken-1;
|
||||
border-bottom: tall $warning-darken-1;
|
||||
border-top: tall $warning-darken-2;
|
||||
border-bottom: tall $warning-darken-2;
|
||||
|
||||
text-style: bold;
|
||||
align-horizontal: center;
|
||||
@@ -226,8 +226,8 @@ Success {
|
||||
background: $success;
|
||||
color: $text-success;
|
||||
|
||||
border-top: hkey $success-darken-1;
|
||||
border-bottom: hkey $success-darken-1;
|
||||
border-top: hkey $success-darken-2;
|
||||
border-bottom: hkey $success-darken-2;
|
||||
|
||||
text-style: bold ;
|
||||
|
||||
|
||||
@@ -211,9 +211,18 @@ def parse_declarations(css: str, path: str) -> Styles:
|
||||
|
||||
|
||||
def _unresolved(variable_name: str, variables: Sequence[str], token: Token) -> NoReturn:
|
||||
"""Raise a TokenError regarding an unresolved variable.
|
||||
|
||||
Args:
|
||||
variable_name (str): A variable name.
|
||||
variables (Sequence[str]): Possible choices used to generate suggestion.
|
||||
token (Token): The Token.
|
||||
|
||||
Raises:
|
||||
TokenError: Always raises a TokenError.
|
||||
|
||||
"""
|
||||
message = f"reference to undefined variable '${variable_name}'"
|
||||
|
||||
suggested_variable = get_suggestion(variable_name, variables)
|
||||
if suggested_variable:
|
||||
message += f"; did you mean '{suggested_variable}'?"
|
||||
|
||||
Reference in New Issue
Block a user