merging two style instance should give a style instance
This commit is contained in:
parent
9e36efbd21
commit
dd3e2bde22
@ -292,6 +292,19 @@ class Style(dict):
|
|||||||
)
|
)
|
||||||
super().__setitem__(key, value)
|
super().__setitem__(key, value)
|
||||||
|
|
||||||
|
def __or__(self, other: Style) -> Style:
|
||||||
|
"""Combine two styles.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
other: The other style to combine.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The combined style.
|
||||||
|
"""
|
||||||
|
if not isinstance(other, Style):
|
||||||
|
other = Style(other)
|
||||||
|
return Style(super().__or__(self, other))
|
||||||
|
|
||||||
|
|
||||||
def _format_emotion_style_pseudo_selector(key: str) -> str:
|
def _format_emotion_style_pseudo_selector(key: str) -> str:
|
||||||
"""Format a pseudo selector for emotion CSS-in-JS.
|
"""Format a pseudo selector for emotion CSS-in-JS.
|
||||||
|
Loading…
Reference in New Issue
Block a user