diff --git a/tachys/src/html/style.rs b/tachys/src/html/style.rs
index 8d46a6951..b12fc5e66 100644
--- a/tachys/src/html/style.rs
+++ b/tachys/src/html/style.rs
@@ -1,4 +1,6 @@
use super::attribute::{Attribute, NextAttribute};
+#[cfg(feature = "nightly")]
+use crate::view::static_types::Static;
use crate::{
renderer::DomRenderer,
view::{Position, ToTemplate},
@@ -412,6 +414,80 @@ where
}
}
+#[cfg(feature = "nightly")]
+impl<'a, const V: &'static str, R> IntoStyle for (&'a str, Static)
+where
+ R: DomRenderer,
+{
+ type State = ();
+ type Cloneable = (Arc, Static);
+ type CloneableOwned = (Arc, Static);
+
+ fn to_html(self, style: &mut String) {
+ let (name, _) = self;
+ style.push_str(name);
+ style.push(':');
+ style.push_str(V);
+ style.push(';');
+ }
+
+ fn hydrate(self, _el: &R::Element) -> Self::State {
+ }
+
+ fn build(self, el: &R::Element) -> Self::State {
+ let (name, _) = &self;
+ let style = R::style(el);
+ R::set_css_property(&style, name, V);
+ }
+
+ fn rebuild(self, _state: &mut Self::State) {}
+
+ fn into_cloneable(self) -> Self::Cloneable {
+ (self.0.into(), self.1)
+ }
+
+ fn into_cloneable_owned(self) -> Self::CloneableOwned {
+ (self.0.into(), self.1)
+ }
+}
+
+#[cfg(feature = "nightly")]
+impl<'a, const V: &'static str, R> IntoStyle for (Arc, Static)
+where
+ R: DomRenderer,
+{
+ type State = ();
+ type Cloneable = (Arc, Static);
+ type CloneableOwned = (Arc, Static);
+
+ fn to_html(self, style: &mut String) {
+ let (name, _) = self;
+ style.push_str(&name);
+ style.push(':');
+ style.push_str(V);
+ style.push(';');
+ }
+
+ fn hydrate(self, _el: &R::Element) -> Self::State {
+ }
+
+ fn build(self, el: &R::Element) -> Self::State {
+ let (name, _) = &self;
+ let style = R::style(el);
+ R::set_css_property(&style, &name, V);
+ }
+
+ fn rebuild(self, _state: &mut Self::State) {}
+
+ fn into_cloneable(self) -> Self::Cloneable {
+ (self.0, self.1)
+ }
+
+ fn into_cloneable_owned(self) -> Self::CloneableOwned {
+ (self.0, self.1)
+ }
+}
+
#[cfg(feature = "nightly")]
impl IntoStyle
for crate::view::static_types::Static