diff options
| author | Laurenz <laurmaedje@gmail.com> | 2025-07-10 12:42:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-10 10:42:34 +0000 |
| commit | 98802dde7e3eab456bf4892b586076431e3bb386 (patch) | |
| tree | c626c99df971d51a023a58063fc9a8c3fb0be25d /crates/typst-html/src/css.rs | |
| parent | ac77fdbb6ee9c4a33813a75e056cb5953d14b1db (diff) | |
Complete movement of HTML export code to `typst-html` (#6584)
Diffstat (limited to 'crates/typst-html/src/css.rs')
| -rw-r--r-- | crates/typst-html/src/css.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/crates/typst-html/src/css.rs b/crates/typst-html/src/css.rs index 6c84cba0..5916d314 100644 --- a/crates/typst-html/src/css.rs +++ b/crates/typst-html/src/css.rs @@ -3,28 +3,10 @@ use std::fmt::{self, Display, Write}; use ecow::EcoString; -use typst_library::html::{attr, HtmlElem}; use typst_library::layout::{Length, Rel}; use typst_library::visualize::{Color, Hsl, LinearRgb, Oklab, Oklch, Rgb}; use typst_utils::Numeric; -/// Additional methods for [`HtmlElem`]. -pub trait HtmlElemExt { - /// Adds the styles to an element if the property list is non-empty. - fn with_styles(self, properties: Properties) -> Self; -} - -impl HtmlElemExt for HtmlElem { - /// Adds CSS styles to an element. - fn with_styles(self, properties: Properties) -> Self { - if let Some(value) = properties.into_inline_styles() { - self.with_attr(attr::style, value) - } else { - self - } - } -} - /// A list of CSS properties with values. #[derive(Debug, Default)] pub struct Properties(EcoString); |
