Skip to content

Commit d06dedc

Browse files
authored
fix: handle uppercase hexes from pygments (#109)
1 parent b9a3d59 commit d06dedc

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dev = [
2828
"mypy>=1.15.0",
2929
"pytest>=8.3.5",
3030
"pytest-cov>=6.0.0",
31-
"ruff>=0.11.0",
31+
"ruff>=0.11.2",
3232
"types-pygments>=2.19.0.20250305",
3333
"types-colorama>=0.4.15.20240205",
3434
]

scripts/build-gh-pages

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def write(content: str, path: Path) -> None:
3131

3232

3333
def postprocess_css(content: str, important: bool) -> str:
34-
rules = tinycss2.parse_stylesheet(
35-
content, skip_comments=True, skip_whitespace=True)
34+
rules = tinycss2.parse_stylesheet(content, skip_comments=True, skip_whitespace=True)
3635
for rule in rules:
3736
declarations = tinycss2.parse_declaration_list(
3837
rule.content, skip_comments=True, skip_whitespace=True
@@ -65,6 +64,9 @@ def variable_css() -> str:
6564
css = flavor_css(flavor.identifier)
6665
for color in flavor.colors:
6766
css = css.replace(color.hex, f"var(--ctp-{color.identifier})")
67+
# pygments emits *some* colours (but not all) in uppercase now...
68+
# https://github.com/pygments/pygments/commit/0853028bfe180b7c56ef20502f44a5d8d340216c
69+
css = css.replace(color.hex.upper(), f"var(--ctp-{color.identifier})")
6870
return css
6971

7072

uv.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)