mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
merge
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
App > Screen {
|
||||
|
||||
background: $surface;
|
||||
color: $text-surface;
|
||||
color: $text;
|
||||
layers: base sidebar;
|
||||
|
||||
color: $text-background;
|
||||
color: $text;
|
||||
background: $background;
|
||||
layout: vertical;
|
||||
|
||||
@@ -53,7 +53,7 @@ DataTable {
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
color: $text-panel;
|
||||
color: $text;
|
||||
background: $panel;
|
||||
dock: left;
|
||||
width: 30;
|
||||
@@ -70,7 +70,7 @@ DataTable {
|
||||
#sidebar .title {
|
||||
height: 1;
|
||||
background: $primary-background-darken-1;
|
||||
color: $text-primary-background-darken-1;
|
||||
color: $text-muted;
|
||||
border-right: wide $background;
|
||||
content-align: center middle;
|
||||
}
|
||||
@@ -78,14 +78,14 @@ DataTable {
|
||||
#sidebar .user {
|
||||
height: 8;
|
||||
background: $panel-darken-1;
|
||||
color: $text-panel-darken-1;
|
||||
color: $text-muted;
|
||||
border-right: wide $background;
|
||||
content-align: center middle;
|
||||
}
|
||||
|
||||
#sidebar .content {
|
||||
background: $panel-darken-2;
|
||||
color: $text-surface;
|
||||
color: $text;
|
||||
border-right: wide $background;
|
||||
content-align: center middle;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ Tweet {
|
||||
|
||||
|
||||
background: $panel;
|
||||
color: $text-panel;
|
||||
color: $text;
|
||||
layout: vertical;
|
||||
/* border: outer $primary; */
|
||||
padding: 1;
|
||||
@@ -129,13 +129,13 @@ Tweet {
|
||||
TweetHeader {
|
||||
height:1;
|
||||
background: $accent;
|
||||
color: $text-accent
|
||||
color: $text
|
||||
}
|
||||
|
||||
TweetBody {
|
||||
width: 100%;
|
||||
background: $panel;
|
||||
color: $text-panel;
|
||||
color: $text;
|
||||
height: auto;
|
||||
padding: 0 1 0 0;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ Tweet.scroll-horizontal TweetBody {
|
||||
|
||||
.button {
|
||||
background: $accent;
|
||||
color: $text-accent;
|
||||
color: $text;
|
||||
width:20;
|
||||
height: 3;
|
||||
/* border-top: hidden $accent-darken-3; */
|
||||
@@ -162,7 +162,7 @@ Tweet.scroll-horizontal TweetBody {
|
||||
|
||||
.button:hover {
|
||||
background: $accent-lighten-1;
|
||||
color: $text-accent-lighten-1;
|
||||
color: $text-disabled;
|
||||
width: 20;
|
||||
height: 3;
|
||||
border: tall $accent-darken-1;
|
||||
@@ -174,7 +174,7 @@ Tweet.scroll-horizontal TweetBody {
|
||||
}
|
||||
|
||||
#footer {
|
||||
color: $text-accent;
|
||||
color: $text;
|
||||
background: $accent;
|
||||
height: 1;
|
||||
|
||||
@@ -197,7 +197,7 @@ OptionItem {
|
||||
|
||||
OptionItem:hover {
|
||||
height: 3;
|
||||
color: $text-primary;
|
||||
color: $text;
|
||||
background: $primary-darken-1;
|
||||
/* border-top: hkey $accent2-darken-3;
|
||||
border-bottom: hkey $accent2-darken-3; */
|
||||
@@ -209,7 +209,7 @@ Error {
|
||||
width: 100%;
|
||||
height:3;
|
||||
background: $error;
|
||||
color: $text-error;
|
||||
color: $text;
|
||||
border-top: tall $error-darken-2;
|
||||
border-bottom: tall $error-darken-2;
|
||||
|
||||
@@ -222,7 +222,7 @@ Warning {
|
||||
width: 100%;
|
||||
height:3;
|
||||
background: $warning;
|
||||
color: $text-warning-fade-1;
|
||||
color: $text-muted;
|
||||
border-top: tall $warning-darken-2;
|
||||
border-bottom: tall $warning-darken-2;
|
||||
|
||||
@@ -236,7 +236,7 @@ Success {
|
||||
height:auto;
|
||||
box-sizing: border-box;
|
||||
background: $success;
|
||||
color: $text-success-fade-1;
|
||||
color: $text-muted;
|
||||
|
||||
border-top: hkey $success-darken-2;
|
||||
border-bottom: hkey $success-darken-2;
|
||||
|
||||
@@ -14,16 +14,11 @@
|
||||
|
||||
App > Screen {
|
||||
|
||||
background: $surface;
|
||||
color: $text-surface;
|
||||
layers: base sidebar;
|
||||
|
||||
color: $text-background;
|
||||
background: $background;
|
||||
color: $text;
|
||||
layers: base sidebar;
|
||||
layout: vertical;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
#tree-container {
|
||||
@@ -52,9 +47,9 @@ DataTable {
|
||||
height: 24;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
color: $text-panel;
|
||||
#sidebar {
|
||||
background: $panel;
|
||||
color: $text;
|
||||
dock: left;
|
||||
width: 30;
|
||||
margin-bottom: 1;
|
||||
@@ -71,7 +66,7 @@ DataTable {
|
||||
#sidebar .title {
|
||||
height: 1;
|
||||
background: $primary-background-darken-1;
|
||||
color: $text-primary-background-darken-1;
|
||||
color: $text;
|
||||
border-right: wide $background;
|
||||
content-align: center middle;
|
||||
}
|
||||
@@ -79,14 +74,14 @@ DataTable {
|
||||
#sidebar .user {
|
||||
height: 8;
|
||||
background: $panel-darken-1;
|
||||
color: $text-panel-darken-1;
|
||||
color: $text;
|
||||
border-right: wide $background;
|
||||
content-align: center middle;
|
||||
}
|
||||
|
||||
#sidebar .content {
|
||||
background: $panel-darken-2;
|
||||
color: $text-surface;
|
||||
color: $text;
|
||||
border-right: wide $background;
|
||||
content-align: center middle;
|
||||
}
|
||||
@@ -101,7 +96,7 @@ Tweet {
|
||||
|
||||
margin:0 2;
|
||||
background: $panel;
|
||||
color: $text-panel;
|
||||
color: $text;
|
||||
layout: vertical;
|
||||
/* border: outer $primary; */
|
||||
padding: 1;
|
||||
@@ -132,13 +127,13 @@ Tweet {
|
||||
TweetHeader {
|
||||
height:1;
|
||||
background: $accent;
|
||||
color: $text-accent
|
||||
color: $text;
|
||||
}
|
||||
|
||||
TweetBody {
|
||||
width: 100%;
|
||||
background: $panel;
|
||||
color: $text-panel;
|
||||
color: $text;
|
||||
height: auto;
|
||||
padding: 0 1 0 0;
|
||||
}
|
||||
@@ -149,7 +144,7 @@ Tweet.scroll-horizontal TweetBody {
|
||||
|
||||
.button {
|
||||
background: $accent;
|
||||
color: $text-accent;
|
||||
color: $text;
|
||||
width:20;
|
||||
height: 3;
|
||||
/* border-top: hidden $accent-darken-3; */
|
||||
@@ -165,7 +160,7 @@ Tweet.scroll-horizontal TweetBody {
|
||||
|
||||
.button:hover {
|
||||
background: $accent-lighten-1;
|
||||
color: $text-accent-lighten-1;
|
||||
color: $text;
|
||||
width: 20;
|
||||
height: 3;
|
||||
border: tall $accent-darken-1;
|
||||
@@ -177,7 +172,7 @@ Tweet.scroll-horizontal TweetBody {
|
||||
}
|
||||
|
||||
#footer {
|
||||
color: $text-accent;
|
||||
color: $text;
|
||||
background: $accent;
|
||||
height: 1;
|
||||
|
||||
@@ -200,7 +195,7 @@ OptionItem {
|
||||
|
||||
OptionItem:hover {
|
||||
height: 3;
|
||||
color: $text-primary;
|
||||
color: $text;
|
||||
background: $primary-darken-1;
|
||||
/* border-top: hkey $accent2-darken-3;
|
||||
border-bottom: hkey $accent2-darken-3; */
|
||||
@@ -212,7 +207,7 @@ Error {
|
||||
width: 100%;
|
||||
height:3;
|
||||
background: $error;
|
||||
color: $text-error;
|
||||
color: $text;
|
||||
border-top: tall $error-darken-2;
|
||||
border-bottom: tall $error-darken-2;
|
||||
|
||||
@@ -225,7 +220,7 @@ Warning {
|
||||
width: 100%;
|
||||
height:3;
|
||||
background: $warning;
|
||||
color: $text-warning-fade-1;
|
||||
color: $text;
|
||||
border-top: tall $warning-darken-2;
|
||||
border-bottom: tall $warning-darken-2;
|
||||
|
||||
@@ -239,7 +234,7 @@ Success {
|
||||
height:auto;
|
||||
box-sizing: border-box;
|
||||
background: $success;
|
||||
color: $text-success-fade-1;
|
||||
color: $text;
|
||||
|
||||
border-top: hkey $success-darken-2;
|
||||
border-bottom: hkey $success-darken-2;
|
||||
|
||||
@@ -24,7 +24,7 @@ Button {
|
||||
padding: 0 1;
|
||||
height: 100%;
|
||||
background: $primary-lighten-2;
|
||||
color: $text-primary-lighten-2;
|
||||
color: $text;
|
||||
}
|
||||
|
||||
#number-0 {
|
||||
|
||||
@@ -33,7 +33,7 @@ class CenterApp(App):
|
||||
|
||||
Static {
|
||||
background: $panel;
|
||||
color: $text-panel;
|
||||
color: $text;
|
||||
content-align: center middle;
|
||||
}
|
||||
|
||||
|
||||
23
sandbox/will/design.css
Normal file
23
sandbox/will/design.css
Normal file
@@ -0,0 +1,23 @@
|
||||
Screen {
|
||||
background: $surface;
|
||||
}
|
||||
|
||||
Container {
|
||||
height: auto;
|
||||
background: $boost;
|
||||
|
||||
}
|
||||
|
||||
Panel {
|
||||
height: auto;
|
||||
background: $boost;
|
||||
margin: 1 2;
|
||||
|
||||
}
|
||||
|
||||
Content {
|
||||
background: $boost;
|
||||
padding: 1 2;
|
||||
margin: 1 2;
|
||||
color: auto 95%;
|
||||
}
|
||||
35
sandbox/will/design.py
Normal file
35
sandbox/will/design.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from textual.app import App
|
||||
from textual.layout import Container
|
||||
from textual.widgets import Header, Footer, Static
|
||||
|
||||
|
||||
class Content(Static):
|
||||
pass
|
||||
|
||||
|
||||
class Panel(Container):
|
||||
pass
|
||||
|
||||
|
||||
class Panel2(Container):
|
||||
pass
|
||||
|
||||
|
||||
class DesignApp(App):
|
||||
BINDINGS = [("d", "toggle_dark", "Toggle dark mode")]
|
||||
|
||||
def compose(self):
|
||||
yield Header()
|
||||
yield Footer()
|
||||
yield Container(
|
||||
Content("content"),
|
||||
Panel(
|
||||
Content("more content"),
|
||||
Content("more content"),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
app = DesignApp(css_path="design.css")
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
21
sandbox/will/offset.css
Normal file
21
sandbox/will/offset.css
Normal file
@@ -0,0 +1,21 @@
|
||||
Screen {
|
||||
layout: center;
|
||||
}
|
||||
|
||||
#parent {
|
||||
width: 32;
|
||||
height: 8;
|
||||
background: $panel;
|
||||
}
|
||||
|
||||
#tag {
|
||||
color: $text;
|
||||
background: $success;
|
||||
padding: 2 4;
|
||||
width: auto;
|
||||
offset: -8 -4;
|
||||
}
|
||||
|
||||
#child {
|
||||
background: red;
|
||||
}
|
||||
17
sandbox/will/offset.py
Normal file
17
sandbox/will/offset.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from textual import layout
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Static
|
||||
|
||||
|
||||
class OffsetExample(App):
|
||||
def compose(self) -> ComposeResult:
|
||||
yield layout.Vertical(
|
||||
Static("Child", id="child"),
|
||||
id="parent"
|
||||
)
|
||||
yield Static("Tag", id="tag")
|
||||
|
||||
|
||||
app = OffsetExample(css_path="offset.css")
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
Reference in New Issue
Block a user