refactor: govern CSS tokens and cascade

This commit is contained in:
leefer
2026-07-29 21:56:39 +08:00
parent 8d617cfa17
commit ed2b47fe90
11 changed files with 551 additions and 425 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ class FrontendContractTests(unittest.TestCase):
cls.ui_core = (STATIC_DIR / "ui-core.js").read_text(encoding="utf-8")
cls.design_system = (STATIC_DIR / "design-system.css").read_text(encoding="utf-8")
cls.theme = (STATIC_DIR / "theme.css").read_text(encoding="utf-8")
cls.tokens = (STATIC_DIR / "shared" / "tokens.css").read_text(encoding="utf-8")
collector = IdCollector()
collector.feed(cls.html)
cls.ids = collector.ids
@@ -268,7 +269,7 @@ class FrontendContractTests(unittest.TestCase):
self.assertIn("#sentimentCycleView .sentiment-history-frame {", self.theme)
self.assertIn("margin-bottom: var(--card-gap);", self.theme)
self.assertIn("padding-bottom: var(--card-gap);", self.theme)
self.assertIn("--sentiment-history-max-height:510px;", self.design_system)
self.assertIn("--sentiment-history-max-height: 510px;", self.tokens)
self.assertIn("max-height:var(--sentiment-history-max-height);", self.design_system)
self.assertIn("overflow:auto;", self.design_system)