mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Rename PercentageProperty to FractionalProperty
This commit is contained in:
@@ -775,7 +775,7 @@ class TransitionsProperty:
|
|||||||
obj.set_rule("transitions", transitions.copy())
|
obj.set_rule("transitions", transitions.copy())
|
||||||
|
|
||||||
|
|
||||||
class PercentageProperty:
|
class FractionalProperty:
|
||||||
"""Property that can be set either as a float (e.g. 0.1) or a
|
"""Property that can be set either as a float (e.g. 0.1) or a
|
||||||
string percentage (e.g. '10%'). Values will be clamped to the range (0, 1).
|
string percentage (e.g. '10%'). Values will be clamped to the range (0, 1).
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from ._style_properties import (
|
|||||||
StyleFlagsProperty,
|
StyleFlagsProperty,
|
||||||
StyleProperty,
|
StyleProperty,
|
||||||
TransitionsProperty,
|
TransitionsProperty,
|
||||||
PercentageProperty,
|
FractionalProperty,
|
||||||
)
|
)
|
||||||
from .constants import VALID_DISPLAY, VALID_VISIBILITY
|
from .constants import VALID_DISPLAY, VALID_VISIBILITY
|
||||||
from .scalar import Scalar, ScalarOffset, Unit
|
from .scalar import Scalar, ScalarOffset, Unit
|
||||||
@@ -124,7 +124,7 @@ class StylesBase(ABC):
|
|||||||
text_background = ColorProperty()
|
text_background = ColorProperty()
|
||||||
text_style = StyleFlagsProperty()
|
text_style = StyleFlagsProperty()
|
||||||
|
|
||||||
opacity = PercentageProperty()
|
opacity = FractionalProperty()
|
||||||
|
|
||||||
padding = SpacingProperty()
|
padding = SpacingProperty()
|
||||||
margin = SpacingProperty()
|
margin = SpacingProperty()
|
||||||
|
|||||||
0
tests/css/test_style_properties.py
Normal file
0
tests/css/test_style_properties.py
Normal file
Reference in New Issue
Block a user