mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix specificity ordering
This commit is contained in:
@@ -11,12 +11,12 @@ from textual.dom import DOMNode
|
||||
|
||||
|
||||
def test_stylesheet_apply_takes_final_rule_in_specificity_clash():
|
||||
css = ".a {background: red; color: lime} .b {background:blue}"
|
||||
css = ".a {background: red; color: lime} .b {background: blue}"
|
||||
stylesheet = Stylesheet()
|
||||
stylesheet.source["test.css"] = css
|
||||
stylesheet.parse()
|
||||
|
||||
node = DOMNode(classes="a b")
|
||||
node = DOMNode(classes="a b", id="c")
|
||||
stylesheet.apply(node)
|
||||
|
||||
assert node.styles.color == Color(0, 255, 0) # color: lime
|
||||
|
||||
Reference in New Issue
Block a user