+ {children()}
+
+ }
+ .into_any(),
TextTag::Em => view! {
-
+
{children()}
}
.into_any(),
TextTag::H1 => view! {
- +
{children()}
} .into_any(), TextTag::Pre => view! { -+{children()}} .into_any(), TextTag::Span => view! { - + {children()} } .into_any(), TextTag::Strong => view! { - + {children()} } @@ -138,9 +145,10 @@ pub fn Text( } } -#[derive(Default)] +#[derive(Default, PartialEq)] pub enum TextTag { B, + Code, Em, H1, H2, diff --git a/thaw/src/text/text.css b/thaw/src/text/text.css index fbed300..0b784cd 100644 --- a/thaw/src/text/text.css +++ b/thaw/src/text/text.css @@ -11,6 +11,15 @@ font-family: var(--fontFamilyBase); } +code.thaw-text { + padding: 1px 4px; + margin: 0 3px 0 3px; + background-color: var(--colorNeutralBackground4); + color: var(--colorNeutralForeground1); + font-family: var(--fontFamilyMonospace); + border-radius: var(--borderRadiusMedium); +} + .thaw-caption-1 { line-height: var(--lineHeightBase200); font-weight: var(--fontWeightRegular); diff --git a/thaw/src/theme/common.rs b/thaw/src/theme/common.rs index 6193220..fa460f6 100644 --- a/thaw/src/theme/common.rs +++ b/thaw/src/theme/common.rs @@ -3,6 +3,8 @@ use thaw_macro::WriteCSSVars; #[derive(Clone, WriteCSSVars)] pub struct CommonTheme { pub font_family_base: String, + pub font_family_monospace: String, + pub font_family_numeric: String, pub font_size_base_100: String, pub font_size_base_200: String, @@ -67,7 +69,9 @@ impl CommonTheme { pub fn new() -> Self { Self { font_family_base: "'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif".into(), - + font_family_monospace: "Consolas, 'Courier New', Courier, monospace".into(), + font_family_numeric: "Bahnschrift, 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif".into(), + font_size_base_100: "10px".into(), font_size_base_200: "12px".into(), font_size_base_300: "14px".into(),