Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tricky support for container styles #37

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions demo_respo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ readme = "README.md"
[dependencies]
memoize = "0.4.2"
respo = { path = "../respo/" }
js-sys = "0.3.69"
js-sys = "0.3.76"
wasm-bindgen = "0.2.93"
console_error_panic_hook = "0.1.7"
uuid = { version = "1.10.0", features = ["v4", "js"] }
serde = { version = "1.0.210", features = ["derive", "rc"] }
serde_json = "1.0.128"
uuid = { version = "1.11.0", features = ["v4", "js"] }
serde = { version = "1.0.216", features = ["derive", "rc"] }
serde_json = "1.0.133"
respo_state_derive = { path = "../respo_state_derive" }

[dependencies.web-sys]
version = "0.3.70"
version = "0.3.76"
features = [
"console",
'Document',
Expand Down
13 changes: 11 additions & 2 deletions demo_respo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::rc::Rc;

use inner_text::comp_inner_text;
use respo::css::respo_style;
use respo::{space, RespoAction};
use respo::{contained_styles, space, RespoAction};
tiye marked this conversation as resolved.
Show resolved Hide resolved
use web_sys::Node;

use respo::ui::ui_global;
Expand Down Expand Up @@ -64,7 +64,7 @@ impl RespoApp for App {

Ok(
div()
.class(ui_global())
.class(ui_global() + " " + &style_container())
tiye marked this conversation as resolved.
Show resolved Hide resolved
.style(respo_style().padding(12))
.children([
comp_counter(&states.pick("counter"), store.counted)?.to_node(),
Expand Down Expand Up @@ -97,3 +97,12 @@ fn main() {

app.render_loop().expect("app render");
}

contained_styles!(
style_container,
(
Some("@media only screen and (max-width: 600px)".to_owned()),
"&",
respo_style().background_color(respo::css::CssColor::Hsl(0, 0, 95))
)
);
10 changes: 5 additions & 5 deletions respo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "respo"
version = "0.1.14"
version = "0.1.15"
edition = "2021"
description = "a tiny virtual DOM library migrated from ClojureScript"
license = "Apache-2.0"
Expand All @@ -12,14 +12,14 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
js-sys = "0.3.69"
js-sys = "0.3.76"
tiye marked this conversation as resolved.
Show resolved Hide resolved
wasm-bindgen = "0.2.93"
lazy_static = "1.5.0"
cirru_parser = "0.1.31"
# cirru_parser = { path = "/Users/chenyong/repo/cirru/parser.rs" }
rust-hsluv = "0.1.4"
serde = { version = "1.0.210", features = ["derive", "rc"] }
serde_json = "1.0.128"
serde = { version = "1.0.216", features = ["derive", "rc"] }
serde_json = "1.0.133"
# respo_state_derive = { path = "../respo_state_derive" }
respo_state_derive = "0.0.1"

Expand All @@ -28,7 +28,7 @@ respo_state_derive = "0.0.1"
crate-type = ["cdylib", "rlib"]

[dependencies.web-sys]
version = "0.3.70"
version = "0.3.76"
features = [
"console",
'Document',
Expand Down
Loading
Loading