Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions src/textual/highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,33 @@ class HighlightTheme:

STYLES: dict[TokenType, str] = {
Token.Comment: "$text 60%",
Token.Error: "$error on $error-muted",
Token.Generic.Error: "$error on $error-muted",
Token.Generic.Heading: "$primary underline",
Token.Generic.Subheading: "$primary",
Token.Keyword: "$accent",
Token.Keyword.Constant: "bold $success 80%",
Token.Keyword.Namespace: "$error",
Token.Error: "$text-error on $error-muted",
Token.Generic.Error: "$text-error on $error-muted",
Token.Generic.Heading: "$text-primary underline",
Token.Generic.Subheading: "$text-primary",
Token.Keyword: "$text-accent",
Token.Keyword.Constant: "bold $text-success 80%",
Token.Keyword.Namespace: "$text-error",
Token.Keyword.Type: "bold",
Token.Literal.Number: "$warning",
Token.Literal.String: "$success 90%",
Token.Literal.String.Doc: "$success 80% italic",
Token.Literal.String.Double: "$success 90%",
Token.Name: "$primary",
Token.Name.Attribute: "$warning",
Token.Name.Builtin: "$accent",
Token.Literal.Number: "$text-warning",
Token.Literal.String: "$text-success 90%",
Token.Literal.String.Doc: "$text-success 80% italic",
Token.Literal.String.Double: "$text-success 90%",
Token.Name: "$text-primary",
Token.Name.Attribute: "$text-warning",
Token.Name.Builtin: "$text-accent",
Token.Name.Builtin.Pseudo: "italic",
Token.Name.Class: "$warning bold",
Token.Name.Constant: "$error",
Token.Name.Decorator: "$primary bold",
Token.Name.Function: "$warning underline",
Token.Name.Function.Magic: "$warning underline",
Token.Name.Tag: "$primary bold",
Token.Name.Variable: "$secondary",
Token.Number: "$warning",
Token.Name.Class: "$text-warning bold",
Token.Name.Constant: "$text-error",
Token.Name.Decorator: "$text-primary bold",
Token.Name.Function: "$text-warning underline",
Token.Name.Function.Magic: "$text-warning underline",
Token.Name.Tag: "$text-primary bold",
Token.Name.Variable: "$text-secondary",
Token.Number: "$text-warning",
Token.Operator: "bold",
Token.Operator.Word: "bold $error",
Token.String: "$success",
Token.Operator.Word: "bold $text-error",
Token.String: "$text-success",
Token.Whitespace: "",
}

Expand Down
4 changes: 2 additions & 2 deletions src/textual/widgets/_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,11 @@ class Markdown(Widget):
}
&:dark .code_inline {
background: $warning-muted 30%;
color: $warning;
color: $text-warning;
}
&:light .code_inline {
background: $error-muted 30%;
color: $error;
color: $text-error;
}
}
.em {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/test_highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def test_highlight() -> None:
print(import_this.spans)
assert import_this.spans == [
Span(0, 11, style="$text"),
Span(0, 6, style="$error"),
Span(7, 11, style="$primary"),
Span(0, 6, style="$text-error"),
Span(7, 11, style="$text-primary"),
]


Expand Down
Loading