docstring

This commit is contained in:
Will McGugan
2022-07-20 16:19:05 +01:00
parent 8f7b271b75
commit 42baf2ab8c
2 changed files with 18 additions and 9 deletions

View File

@@ -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 ;

View File

@@ -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}'?"