mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update reference for layer(s).
[skip ci]
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
The [`<border>`](/css_types/border.md) type can take any of the following values:
|
||||
The [`<border>`](/css_types/border) type can take any of the following values:
|
||||
|
||||
| Border type | Description |
|
||||
|-------------|----------------------------------------------------------|
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
# Layer
|
||||
|
||||
The `layer` property is used to assign widgets to a layer.
|
||||
Layers control the order in which widgets are painted on screen.
|
||||
The value of the `layer` property must be the name of a layer defined using a [`layers`](../layers) declaration.
|
||||
More information on layers can be found in the [guide](../guide/layout.md#layers).
|
||||
The `layer` property defines the layer a widget belongs to.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
layer: <STRING>;
|
||||
```
|
||||
--8<-- "docs/snippets/syntax_block_start.md"
|
||||
layer: <a href="../css_types/name.md"><name></a>;
|
||||
--8<-- "docs/snippets/syntax_block_end.md"
|
||||
|
||||
The `layer` rule accepts a [`<name>`](../css_types/name.md) that defines the layer this widget belongs to.
|
||||
This [`<name>`](../css_types/name.md) must correspond to a [`<name>`](../css_types/name.md) that has been defined in a [`layers`](./layers.md) rule by an ancestor of this widget.
|
||||
|
||||
More information on layers can be found in the [guide](../guide/layout.md#layers).
|
||||
|
||||
### Values
|
||||
|
||||
--8<-- "docs/snippets/type_syntax/name.md"
|
||||
|
||||
!!! warning
|
||||
|
||||
Using a `<name>` that hasn't been defined in a [`layers`](./layers.md) declaration of an ancestor of this widget has no effect.
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
# Layers
|
||||
|
||||
The `layers` property allows you to define an ordered set of layers.
|
||||
Layers control the order in which widgets are painted on screen.
|
||||
These `layers` can later be referenced using the [`layer`](../layer) property.
|
||||
More information on layers can be found in the [guide](../guide/layout.md#layers).
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
layers: <STRING> . . .;
|
||||
```
|
||||
--8<-- "docs/snippets/syntax_block_start.md"
|
||||
layers: <a href="../css_types/name.md"><name></a>+;
|
||||
--8<-- "docs/snippets/syntax_block_end.md"
|
||||
|
||||
Layers that come first in the list are drawn before the layers that come after.
|
||||
This means the first layer will be under all other layers and the last layer will be above all other layers.
|
||||
See the example below.
|
||||
The `layers` rule accepts one or more [`<name>`](../css_types/name.md) that define the layers that the widget is aware of, and the order in which they will be painted on the screen.
|
||||
|
||||
The values used here can later be referenced using the [`layer`](../layer) property.
|
||||
The layers defined first in the list are drawn under the layers that are defined later in the list.
|
||||
|
||||
More information on layers can be found in the [guide](../guide/layout.md#layers).
|
||||
|
||||
### Values
|
||||
|
||||
--8<-- "docs/snippets/type_syntax/name.md"
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
Reference in New Issue
Block a user