Merge pull request #727 from Textualize/default-css

Default css
This commit is contained in:
Will McGugan
2022-09-02 14:01:56 +01:00
committed by GitHub
34 changed files with 70 additions and 54 deletions

View File

@@ -8,7 +8,7 @@ from textual.widgets import Placeholder
class VerticalContainer(Widget):
CSS = """
DEFAULT_CSS = """
VerticalContainer {
layout: vertical;
overflow: hidden auto;
@@ -24,7 +24,7 @@ class VerticalContainer(Widget):
class Introduction(Widget):
CSS = """
DEFAULT_CSS = """
Introduction {
background: indigo;
color: white;

View File

@@ -23,7 +23,7 @@ class ColorDisplay(Widget, can_focus=True):
class ColorNames(App):
CSS = """
DEFAULT_CSS = """
ColorDisplay {
height: 1;
}

View File

@@ -5,7 +5,7 @@ from textual.widget import Widget
class FiftyApp(App):
CSS = """
DEFAULT_CSS = """
Screen {
layout: vertical;
}
@@ -24,6 +24,7 @@ class FiftyApp(App):
yield layout.Horizontal(Widget(), Widget())
yield layout.Horizontal(Widget(), Widget())
app = FiftyApp()
if __name__ == "__main__":
app.run()

View File

@@ -9,7 +9,7 @@ placeholders_count = 12
class VerticalContainer(Widget):
CSS = """
DEFAULT_CSS = """
VerticalContainer {
layout: vertical;
overflow: hidden auto;
@@ -26,7 +26,7 @@ class VerticalContainer(Widget):
class Introduction(Widget):
CSS = """
DEFAULT_CSS = """
Introduction {
background: indigo;
color: white;

View File

@@ -10,7 +10,7 @@ initial_placeholders_count = 4
class VerticalContainer(Widget):
CSS = """
DEFAULT_CSS = """
VerticalContainer {
layout: vertical;
overflow: hidden auto;
@@ -30,7 +30,7 @@ class VerticalContainer(Widget):
class Introduction(Widget):
CSS = """
DEFAULT_CSS = """
Introduction {
background: indigo;
color: white;

View File

@@ -11,7 +11,7 @@ class Thing(Static):
class AddRemoveApp(App):
CSS = """
DEFAULT_CSS = """
#buttons {
dock: top;
height: auto;

View File

@@ -3,7 +3,7 @@ from textual.widgets import Static
class CenterApp(App):
CSS = """
DEFAULT_CSS = """
CenterApp Screen {
layout: center;

View File

@@ -4,7 +4,7 @@ from textual.widgets import Static
class CenterApp(App):
CSS = """
DEFAULT_CSS = """
#sidebar {
dock: left;

View File

@@ -10,7 +10,7 @@ from textual.widget import Widget
class Box(Widget, can_focus=True):
CSS = "#box {background: blue;}"
DEFAULT_CSS = "#box {background: blue;}"
def render(self) -> RenderableType:
return Panel("Box")

View File

@@ -21,7 +21,7 @@ class NewScreen(Screen):
class ScreenApp(App):
CSS = """
DEFAULT_CSS = """
ScreenApp Screen {
background: #111144;
color: white;

View File

@@ -5,7 +5,7 @@ from textual.widgets import DirectoryTree
class TreeApp(App):
CSS = """
DEFAULT_CSS = """
Screen {
overflow: auto;