mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fixed !important not applying to border
This commit is contained in:
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed `!important` not applying to `border` https://github.com/Textualize/textual/issues/2420
|
||||
|
||||
## [0.22.3] - 2023-04-29
|
||||
|
||||
|
||||
@@ -486,6 +486,16 @@ class StylesBuilder:
|
||||
rules = self.styles._rules
|
||||
rules["border_top"] = rules["border_right"] = border
|
||||
rules["border_bottom"] = rules["border_left"] = border
|
||||
# If border is marked as important...
|
||||
if "border" in self.styles.important:
|
||||
# ...border alone at this depth isn't really a thing, only
|
||||
# border edges (that's to say, border gets expanded out to all 4
|
||||
# edges). So we remove "border" as important and mark all the
|
||||
# edges as important.
|
||||
self.styles.important.remove("border")
|
||||
self.styles.important.update(
|
||||
f"border_{edge}" for edge in ("top", "left", "bottom", "right")
|
||||
)
|
||||
|
||||
def process_border_top(self, name: str, tokens: list[Token]) -> None:
|
||||
self._process_border_edge("top", name, tokens)
|
||||
|
||||
Reference in New Issue
Block a user