mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
ws
This commit is contained in:
@@ -74,7 +74,7 @@ App > Screen {
|
|||||||
Tweet {
|
Tweet {
|
||||||
height: 22;
|
height: 22;
|
||||||
max-width: 80;
|
max-width: 80;
|
||||||
margin: 1 3;
|
margin: 1 3;
|
||||||
background: $panel;
|
background: $panel;
|
||||||
color: $text-panel;
|
color: $text-panel;
|
||||||
layout: vertical;
|
layout: vertical;
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ class App(DOMNode):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if len(objects) == 1:
|
if len(objects) == 1 and not kwargs:
|
||||||
if self._log_console is not None:
|
if self._log_console is not None:
|
||||||
self._log_console.print(objects[0])
|
self._log_console.print(objects[0])
|
||||||
if self.devtools.is_connected:
|
if self.devtools.is_connected:
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from textual.css.stylesheet import Stylesheet, StylesheetParseError
|
|||||||
from textual.css.tokenize import tokenize
|
from textual.css.tokenize import tokenize
|
||||||
from textual.css.tokenizer import Token, ReferencedBy
|
from textual.css.tokenizer import Token, ReferencedBy
|
||||||
from textual.css.transition import Transition
|
from textual.css.transition import Transition
|
||||||
|
from textual.geometry import Spacing
|
||||||
from textual.layouts.dock import DockLayout
|
from textual.layouts.dock import DockLayout
|
||||||
|
|
||||||
|
|
||||||
@@ -1065,3 +1066,19 @@ class TestParseOpacity:
|
|||||||
with pytest.raises(StylesheetParseError):
|
with pytest.raises(StylesheetParseError):
|
||||||
stylesheet.parse(css)
|
stylesheet.parse(css)
|
||||||
assert stylesheet.rules[0].errors
|
assert stylesheet.rules[0].errors
|
||||||
|
|
||||||
|
|
||||||
|
class TestParseMargin:
|
||||||
|
def test_margin_partial(self):
|
||||||
|
css = "#foo {margin: 1; margin-top: 2; margin-right: 3; margin-bottom: -1;}"
|
||||||
|
stylesheet = Stylesheet()
|
||||||
|
stylesheet.parse(css)
|
||||||
|
assert stylesheet.rules[0].styles.margin == Spacing(2, 3, -1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
class TestParsePadding:
|
||||||
|
def test_padding_partial(self):
|
||||||
|
css = "#foo {padding: 1; padding-top: 2; padding-right: 3; padding-bottom: -1;}"
|
||||||
|
stylesheet = Stylesheet()
|
||||||
|
stylesheet.parse(css)
|
||||||
|
assert stylesheet.rules[0].styles.padding == Spacing(2, 3, -1, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user