add context
This commit is contained in:
parent
78e3d6b798
commit
f3a85de02e
2 changed files with 13 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
use maud::{PreEscaped, html};
|
||||
|
||||
use super::UIWidget;
|
||||
|
||||
pub mod aspect;
|
||||
pub mod background;
|
||||
pub mod container;
|
||||
|
@ -25,6 +27,16 @@ pub fn Nothing() -> PreEscaped<String> {
|
|||
html! {}
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[must_use]
|
||||
/// Create a new inheritance context
|
||||
///
|
||||
/// This acts as a hard barrier for inheritance.
|
||||
/// This allows you to embed Widgets without them interacting with the rest of the tree.
|
||||
pub fn Context<T: UIWidget>(inner: T) -> PreEscaped<String> {
|
||||
html! { (inner) }
|
||||
}
|
||||
|
||||
/// Generates a `<script>` element containing the provided JavaScript code.
|
||||
///
|
||||
/// This function wraps the provided JavaScript code in a `<script>` tag,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue