Skip to content

Commit 9a613b4

Browse files
committed
fix(css): remove union syntax
1 parent a154507 commit 9a613b4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tempered/src/css/extract.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
class CssOptions:
1616
is_global: bool
1717
scope_id: str
18-
lang: str | None
18+
lang: t.Optional[str]
1919

2020

2121
class ExtractResult(t.NamedTuple):
2222
html: str
2323
css: str
2424

2525

26-
def extract_css_from_html(body: str, prefix: str | None = None) -> ExtractResult:
26+
def extract_css_from_html(body: str, prefix: t.Optional[str] = None) -> ExtractResult:
2727
soup = HtmlSoup(body)
2828
css = ""
2929

@@ -65,7 +65,7 @@ def transform_styles(css: str, options: CssOptions) -> str:
6565
return css
6666

6767

68-
def get_bs4_attr(tag: bs4.Tag, attr: str) -> str | None:
68+
def get_bs4_attr(tag: bs4.Tag, attr: str) -> t.Optional[str]:
6969
value = tag.get(attr, None)
7070
if isinstance(value, list):
7171
value = value[0]

tempered/src/css/scoped.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def generate_scope_id(prefix: t.Union[str, None]) -> str:
6262
return f"{prefix}-{hash[:6]}"
6363

6464

65-
def apply_scope_to_soup(soup: bs4.BeautifulSoup, scope_id: str|None):
65+
def apply_scope_to_soup(soup: bs4.BeautifulSoup, scope_id: t.Union[str, None]):
6666
for tag in soup.find_all():
6767
if is_tag_in_head(tag):
6868
continue

0 commit comments

Comments
 (0)